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:Find space for dquot

Proto:static uint find_free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, int *err)

Type:uint

Parameter:

TypeParameterName
struct qtree_mem_dqinfo *info
struct dquot *dquot
int *err
230  buf = getdqbuf(Space usable in block for quota data )
233  err = 0
234  If Not buf Then
235  err = -ENOMEM
236  Return 0
238  dh = buf
239  If First block with free entry Then
240  blk = First block with free entry
241  err = read_blk(info, blk, buf)
242  If err < 0 Then Go to out_buf
244  Else
245  blk = Remove empty block from list and return it
246  If blk < 0 Then
247  err = blk
248  kfree(buf)
249  Return 0
251  memset(buf, 0, Space usable in block for quota data )
254  First block with free entry = blk
255  mark_info_dirty( superblock this applies to , USRQUOTA (uid) or GRPQUOTA (gid) or PRJQUOTA (projid) )
258  If le16_to_cpu(Number of valid entries in block ) + 1 >= Number of entries in one blocks Then
259  err = Remove given block from the list of blocks with free entries
260  If err < 0 Then
261  quota_error( superblock this applies to , "Can't remove block (%u) from entry free list", blk)
263  Go to out_buf
266  le16_add_cpu( & Number of valid entries in block , 1)
268  ddquot = buf + sizeof(structqt_disk_dqdbheader)
269  When i < Number of entries in one blocks cycle
270  If Is the entry in the block free? Then Break
272  ddquot += Size of quota entry in quota file
275  If i == Number of entries in one blocks Then
276  quota_error( superblock this applies to , "Data block full but it shouldn't")
277  err = -EIO
278  Go to out_buf
281  err = write_blk(info, blk, buf)
282  If err < 0 Then
283  quota_error( superblock this applies to , "Can't write quota data block %u", blk)
285  Go to out_buf
287  Offset of dquot on disk [dq_lock, stable once set] = (blk << Block size of quota file ) + sizeof(structqt_disk_dqdbheader) + i * Size of quota entry in quota file
290  kfree(buf)
291  Return blk
292  out_buf :
293  kfree(buf)
294  Return 0
Caller
NameDescribe
do_insert_treeInsert reference to structure into the trie