Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Read information header from quota file

Proto:static int v2_read_file_info(struct super_block *sb, int type)

Type:int

Parameter:

TypeParameterName
struct super_block *sb
inttype
96  dqopt = sb_dqopt(sb)
97  info = Information for each quota type [type]
103  lock for reading
104  ret = v2_read_header(sb, type, & dqhead)
105  If ret < 0 Then Go to out
107  version = le32_to_cpu(File version )
108  If Id of the dqi_format - used when turning * quotas on after remount RW == QFMT_VFS_V0 && version != 0 || Id of the dqi_format - used when turning * quotas on after remount RW == QFMT_VFS_V1 && version != 1 Then
110  ret = -EINVAL
111  Go to out
114  size = quota_read(sb, type, (char * ) & dinfo, sizeof(structv2_disk_dqinfo), Offset of info header in file )
116  If size != sizeof(structv2_disk_dqinfo) Then
117  quota_error(sb, "Can't read info structure")
118  If size < 0 Then ret = size
120  Else ret = -EIO
122  Go to out
124  dqi_priv = Allocation memory
125  If Not dqi_priv Then
126  ret = -ENOMEM
127  Go to out
129  qinfo = dqi_priv
130  If version == 0 Then
132  Maximum space limit [static] = 0xffffffffLL << QUOTABLOCK_BITS
133  Maximum inode limit [static] = 0xffffffff
134  Else
140  Maximum space limit [static] = 0x7fffffffffffffffLL
141  Maximum inode limit [static] = 0x7fffffffffffffffLL
143  Space grace time [dq_data_lock] = le32_to_cpu(Time before block soft limit becomes hard limit )
144  Inode grace time [dq_data_lock] = le32_to_cpu(Time before inode soft limit becomes hard limit )
146  DFQ_ flags [dq_data_lock] = 0
147  Sb quota is on = sb
148  Quota type = type
149  # of blocks in quota file = le32_to_cpu(Number of blocks in file )
150  First block in list of free blocks = le32_to_cpu(Number of first free block in the list )
151  First block with free entry = le32_to_cpu(Number of block with at least one free entry )
152  Block size of quota file = Size of leaf block in tree
153  Space usable in block for quota data = 1 << Size of leaf block in tree
154  Precomputed depth of quota tree = qtree_depth(qinfo)
155  If version == 0 Then
156  Size of quota entry in quota file = sizeof(structv2r0_disk_dqblk)
157  Operations for entry manipulation = v2r0_qtree_ops
158  Else
159  Size of quota entry in quota file = sizeof(structv2r1_disk_dqblk)
160  Operations for entry manipulation = v2r1_qtree_ops
162  ret = 0
163  out :
164  lease a read lock
165  Return ret