Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\quota\quota_tree.c Create Date:2022-07-28 20:33:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Insert reference to structure into the trie

Proto:static int do_insert_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot, uint *treeblk, int depth)

Type:int

Parameter:

TypeParameterName
struct qtree_mem_dqinfo *info
struct dquot *dquot
uint *treeblk
intdepth
301  buf = getdqbuf(Space usable in block for quota data )
302  ret = 0 , newson = 0 , newact = 0
306  If Not buf Then Return -ENOMEM
308  If Not treeblk Then
309  ret = Remove empty block from list and return it
310  If ret < 0 Then Go to out_buf
312  treeblk = ret
313  memset(buf, 0, Space usable in block for quota data )
314  newact = 1
315  Else
316  ret = read_blk(info, * treeblk, buf)
317  If ret < 0 Then
318  quota_error( superblock this applies to , "Can't read tree quota block %u", * treeblk)
320  Go to out_buf
323  ref = buf
324  newblk = le32_to_cpu(ref[get_index(info, ID this applies to (uid, gid, projid) , depth)])
325  If Not newblk Then newson = 1
327  If depth == Precomputed depth of quota tree - 1 Then
329  If newblk Then
334  ret = -EIO
335  Go to out_buf
338  newblk = Find space for dquot
339  Else
340  ret = Insert reference to structure into the trie
342  If newson && ret >= 0 Then
343  ref[get_index(info, ID this applies to (uid, gid, projid) , depth)] = cpu_to_le32(newblk)
345  ret = write_blk(info, * treeblk, buf)
346  Else if newact && ret < 0 Then
347  Insert empty block to the list
349  out_buf :
350  kfree(buf)
351  Return ret
Caller
NameDescribe
do_insert_treeInsert reference to structure into the trie
dq_insert_treeWrapper for inserting quota structure into tree