函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\quota\quota_tree.c Create Date:2022-07-29 11:09:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Find space for dquot

函数原型:static uint find_free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, int *err)

返回类型:uint

参数:

类型参数名称
struct qtree_mem_dqinfo *info
struct dquot *dquot
int *err
230  buf等于getdqbuf(Space usable in block for quota data )
233  err等于0
234  如果非buf
235  err等于负ENOMEM
236  返回:0
238  dh等于buf
239  如果First block with free entry
240  blk等于First block with free entry
241  err等于read_blk(info, blk, buf)
242  如果err小于0则转到:out_buf
244  否则
245  blk等于Remove empty block from list and return it
246  如果blk小于0则
247  err等于blk
248  释放内存
249  返回: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  如果le16_to_cpu(Number of valid entries in block )加1大于等于Number of entries in one blocks
259  err等于Remove given block from the list of blocks with free entries
260  如果err小于0则
261  quota_error( superblock this applies to , "Can't remove block (%u) from entry free list", blk)
263  转到:out_buf
266  le16_add_cpu( & Number of valid entries in block , 1)
268  ddquot等于bufsizeof(structqt_disk_dqdbheader)
269 i小于Number of entries in one blocks 循环
270  如果Is the entry in the block free? 退出
272  ddquot加等于Size of quota entry in quota file
275  如果i恒等于Number of entries in one blocks
276  quota_error( superblock this applies to , "Data block full but it shouldn't")
277  err等于负EIO
278  转到:out_buf
281  err等于write_blk(info, blk, buf)
282  如果err小于0则
283  quota_error( superblock this applies to , "Can't write quota data block %u", blk)
285  转到:out_buf
287  Offset of dquot on disk [dq_lock, stable once set] 等于blk左移Block size of quota file 位的值加sizeof(structqt_disk_dqdbheader)加iSize of quota entry in quota file
290  释放内存
291  返回:blk
292  out_buf :
293  释放内存
294  返回:0
调用者
名称描述
do_insert_treeInsert reference to structure into the trie