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:Free dquot entry in data block

Proto:static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, uint blk)

Type:int

Parameter:

TypeParameterName
struct qtree_mem_dqinfo *info
struct dquot *dquot
uintblk
417  buf = getdqbuf(Space usable in block for quota data )
418  ret = 0
420  If Not buf Then Return -ENOMEM
422  If Offset of dquot on disk [dq_lock, stable once set] >> Block size of quota file != blk Then
423  quota_error( superblock this applies to , "Quota structure has offset to other block (%u) than it should (%u)", blk, (uint)( Offset of dquot on disk [dq_lock, stable once set] >> Block size of quota file ))
426  Go to out_buf
428  ret = read_blk(info, blk, buf)
429  If ret < 0 Then
430  quota_error( superblock this applies to , "Can't read quota data block %u", blk)
432  Go to out_buf
434  dh = buf
435  le16_add_cpu( & Number of valid entries in block , - 1)
436  If Not le16_to_cpu(Number of valid entries in block ) Then
437  ret = Remove given block from the list of blocks with free entries
438  If ret >= 0 Then ret = Insert empty block to the list
440  If ret < 0 Then
441  quota_error( superblock this applies to , "Can't move quota data block (%u) to free list", blk)
443  Go to out_buf
445  Else
446  memset(buf + ( Offset of dquot on disk [dq_lock, stable once set] & ((1 << Block size of quota file ) - 1)), 0, Size of quota entry in quota file )
453  If ret < 0 Then
454  quota_error( superblock this applies to , "Can't insert quota data block (%u) to free entry list", blk)
456  Go to out_buf
458  Else
459  ret = write_blk(info, blk, buf)
460  If ret < 0 Then
461  quota_error( superblock this applies to , "Can't write quota data block %u", blk)
463  Go to out_buf
467  Offset of dquot on disk [dq_lock, stable once set] = 0
468  out_buf :
469  kfree(buf)
470  Return ret
Caller
NameDescribe
remove_treeRemove reference to dquot from tree