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_initialize

Proto:static int __dquot_initialize(struct inode *inode, int type)

Type:int

Parameter:

TypeParameterName
struct inode *inode
inttype
1431  init_needed = 0
1432  struct dquot * * dquots, * got[3] = {}
1433  sb = i_sb
1435  ret = 0
1437  If Not dquot_active(inode) Then Return 0
1440  dquots = i_dquot(inode)
1443  When cnt < MAXQUOTAS cycle
1449  If type != -1 && cnt != type Then Continue
1456  If dquots[cnt] Then Continue
1459  If Not sb_has_quota_active(sb, cnt) Then Continue
1462  init_needed = 1
1467  Break
1470  Break
1472  rc = get_projid(inode, & projid)
1473  If rc Then Continue
1476  Break
1478  dquot = Get reference to dquot* Locking is slightly tricky here. We are guarded from parallel quotaoff()* destroying our dquot by:* a) checking for quota flags under dq_list_lock and* b) getting a reference to dquot before we release dq_list_lock
1479  If IS_ERR(dquot) Then
1481  If PTR_ERR(dquot) != -ESRCH Then
1482  ret = PTR_ERR(dquot)
1483  Go to out_put
1485  dquot = NULL
1487  got[cnt] = dquot
1491  If Not init_needed Then Return 0
1494  spin_lock( & dq_data_lock)
1495  If IS_NOQUOTA(inode) Then Go to out_lock
1497  When cnt < MAXQUOTAS cycle
1498  If type != -1 && cnt != type Then Continue
1501  If Not sb_has_quota_active(sb, cnt) Then Continue
1504  If Not got[cnt] Then Continue
1506  If Not dquots[cnt] Then
1507  dquots[cnt] = got[cnt]
1508  got[cnt] = NULL
1525  out_lock :
1526  spin_unlock( & dq_data_lock)
1527  out_put :
1529  dqput_all(got)
1531  Return ret
Caller
NameDescribe
add_dquot_refThis routine is guarded by s_umount semaphore
dquot_initialize