Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Put reference to dquot

Proto:void dqput(struct dquot *dquot)

Type:void

Parameter:

TypeParameterName
struct dquot *dquot
756  If Not dquot Then Return
766  dqstats_inc(DQST_DROPS)
767  we_slept :
768  spin_lock( & There are five quota SMP locks:* * dq_list_lock protects all lists with quotas and quota formats)
769  If atomic_read( & Use count ) > 1 Then
771  atomic_dec( & Use count )
773  If Not sb_has_quota_active( superblock this applies to , USRQUOTA (uid) or GRPQUOTA (gid) or PRJQUOTA (projid) ) && atomic_read( & Use count ) == 1 Then wake_up( & dquot_ref_wq)
776  spin_unlock( & There are five quota SMP locks:* * dq_list_lock protects all lists with quotas and quota formats)
777  Return
780  If dquot_dirty(dquot) Then
781  spin_unlock( & There are five quota SMP locks:* * dq_list_lock protects all lists with quotas and quota formats)
783  ret = write_dquot(dquot)
784  If ret < 0 Then
785  quota_error( superblock this applies to , "Can't write quota structure (error %d). Quota may get out of sync!", ret)
794  Go to we_slept
796  If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then
797  spin_unlock( & There are five quota SMP locks:* * dq_list_lock protects all lists with quotas and quota formats)
798  release_dquot(dquot)
799  Go to we_slept
801  atomic_dec( & Use count )
806  Add a dquot to the tail of the free list
807  spin_unlock( & There are five quota SMP locks:* * dq_list_lock protects all lists with quotas and quota formats)
Caller
NameDescribe
dqput_all
invalidate_dquotsInvalidate all dquots on the list
dquot_scan_activeCall callback for every active dquot on given filesystem
dquot_writeback_dquotsWrite all dquot structures to quota files
dqgetGet 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
remove_inode_dquot_refRemove references to dquots from inode and add dquot to list for freeing* if we have the last reference to dquot
put_dquot_listFree list of dquots* Dquots are removed from inodes and no new references can be got so we are* the only ones holding reference
dquot_get_dqblk
dquot_get_next_dqblk
dquot_set_dqblk