Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Generic routine for setting common part of quota structure

Proto:static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)

Type:int

Parameter:

TypeParameterName
struct dquot *dquot
struct qc_dqblk *di
2653  dm = Diskquota usage [dq_dqb_lock]
2654  check_blim = 0 , check_ilim = 0
2655  dqi = Information for each quota type [ USRQUOTA (uid) or GRPQUOTA (gid) or PRJQUOTA (projid) ]
2657  If mask of fields to change in ->set_dqblk() & ~VFS_QC_MASK Then Return -EINVAL
2660  If mask of fields to change in ->set_dqblk() & QC_SPC_SOFT && preferred limit on used space > Maximum space limit [static] || mask of fields to change in ->set_dqblk() & QC_SPC_HARD && absolute limit on used space > Maximum space limit [static] || mask of fields to change in ->set_dqblk() & Field specifiers for ->set_dqblk() in struct qc_dqblk and also for* ->set_info() in struct qc_info && preferred inode limit > Maximum inode limit [static] || mask of fields to change in ->set_dqblk() & QC_INO_HARD && maximum # allocated inodes > Maximum inode limit [static] Then Return -ERANGE
2670  spin_lock( & Lock protecting dq_dqb changes )
2671  If mask of fields to change in ->set_dqblk() & QC_SPACE Then
2672  current used space = Space owned by the user - current reserved space for delalloc
2673  check_blim = 1
2674  Atomically set a bit in memory
2677  If mask of fields to change in ->set_dqblk() & QC_SPC_SOFT Then preferred limit on disk blks = preferred limit on used space
2679  If mask of fields to change in ->set_dqblk() & QC_SPC_HARD Then absolute limit on disk blks alloc = absolute limit on used space
2681  If mask of fields to change in ->set_dqblk() & (QC_SPC_SOFT | QC_SPC_HARD) Then
2682  check_blim = 1
2683  Atomically set a bit in memory
2686  If mask of fields to change in ->set_dqblk() & QC_INO_COUNT Then
2687  current # allocated inodes = # inodes owned by the user
2688  check_ilim = 1
2689  Atomically set a bit in memory
2692  If mask of fields to change in ->set_dqblk() & Field specifiers for ->set_dqblk() in struct qc_dqblk and also for* ->set_info() in struct qc_info Then preferred inode limit = preferred inode limit
2694  If mask of fields to change in ->set_dqblk() & QC_INO_HARD Then absolute limit on allocated inodes = maximum # allocated inodes
2696  If mask of fields to change in ->set_dqblk() & (Field specifiers for ->set_dqblk() in struct qc_dqblk and also for* ->set_info() in struct qc_info | QC_INO_HARD) Then
2697  check_ilim = 1
2698  Atomically set a bit in memory
2701  If mask of fields to change in ->set_dqblk() & QC_SPC_TIMER Then
2702  ime limit for excessive disk use = similar to above; for space
2703  check_blim = 1
2704  Atomically set a bit in memory
2707  If mask of fields to change in ->set_dqblk() & QC_INO_TIMER Then
2708  ime limit for excessive inode use = zero if within inode limits
2709  check_ilim = 1
2710  Atomically set a bit in memory
2713  If check_blim Then
2718  Else if Not (mask of fields to change in ->set_dqblk() & QC_SPC_TIMER) Then 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. + Space grace time [dq_data_lock]
2722  If check_ilim Then
2727  Else if Not (mask of fields to change in ->set_dqblk() & QC_INO_TIMER) Then ime limit for excessive inode 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. + Inode grace time [dq_data_lock]
2731  If absolute limit on disk blks alloc || preferred limit on disk blks || absolute limit on allocated inodes || preferred inode limit Then lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
2734  Else Atomically set a bit in memory
2736  spin_unlock( & Lock protecting dq_dqb changes )
2737  mark_dquot_dirty(dquot)
2739  Return 0
Caller
NameDescribe
dquot_set_dqblk