Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:dquot_add_space

Proto:static int dquot_add_space(struct dquot *dquot, qsize_t space, qsize_t rsv_space, unsigned int flags, struct dquot_warn *warn)

Type:int

Parameter:

TypeParameterName
struct dquot *dquot
qsize_tspace
qsize_trsv_space
unsigned intflags
struct dquot_warn *warn
1315  sb = superblock this applies to
1316  ret = 0
1318  spin_lock( & Lock protecting dq_dqb changes )
1319  If Not sb_has_quota_limits_enabled(sb, USRQUOTA (uid) or GRPQUOTA (gid) or PRJQUOTA (projid) ) || st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then Go to finish
1323  tspace = current used space + current reserved space for delalloc + space + rsv_space
1326  If absolute limit on disk blks alloc && tspace > absolute limit on disk blks alloc && Not ignore_hardlimit(dquot) Then
1329  If flags & DQUOT_SPACE_WARN Then prepare_warning(warn, dquot, Block hardlimit reached )
1331  ret = -EDQUOT
1332  Go to finish
1335  If preferred limit on disk blks && tspace > preferred limit on disk blks && ime limit for excessive disk use && ktime_get_real_seconds - Get the seconds portion of CLOCK_REALTIME* Returns the wall clock seconds since 1970. This replaces the* get_seconds() interface which is not y2038 safe on 32bit systems. >= ime limit for excessive disk use && Not ignore_hardlimit(dquot) Then
1340  If flags & DQUOT_SPACE_WARN Then prepare_warning(warn, dquot, Block grace time expired )
1342  ret = -EDQUOT
1343  Go to finish
1346  If preferred limit on disk blks && tspace > preferred limit on disk blks && ime limit for excessive disk use == 0 Then
1349  If flags & DQUOT_SPACE_WARN Then
1353  Else
1358  ret = -EDQUOT
1359  Go to finish
1362  finish :
1368  If flags & DQUOT_SPACE_NOFAIL Then ret = 0
1370  If Not ret Then
1371  current reserved space for delalloc += rsv_space
1372  current used space += space
1374  spin_unlock( & Lock protecting dq_dqb changes )
1375  Return ret
Caller
NameDescribe
__dquot_alloc_spaceThis operation can block, but only after everything is updated
__dquot_transferTransfer the number of inode and blocks from one diskquota to an other