cregit-Linux how code gets into the kernel

Release 4.12 include/linux/quotaops.h

Directory: include/linux
/*
 * Definitions for diskquota-operations. When diskquota is configured these
 * macros expand to the right source-code.
 *
 * Author:  Marco van Wieringen <mvw@planets.elm.net>
 */
#ifndef _LINUX_QUOTAOPS_

#define _LINUX_QUOTAOPS_

#include <linux/fs.h>


#define DQUOT_SPACE_WARN	0x1

#define DQUOT_SPACE_RESERVE	0x2

#define DQUOT_SPACE_NOFAIL	0x4


static inline struct quota_info *sb_dqopt(struct super_block *sb) { return &sb->s_dquot; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara20100.00%2100.00%
Total20100.00%2100.00%

/* i_mutex must being held */
static inline bool is_quota_modification(struct inode *inode, struct iattr *ia) { return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) || (ia->ia_valid & ATTR_UID && !uid_eq(ia->ia_uid, inode->i_uid)) || (ia->ia_valid & ATTR_GID && !gid_eq(ia->ia_gid, inode->i_gid)); }

Contributors

PersonTokensPropCommitsCommitProp
Dmitriy Monakhov6486.49%150.00%
Eric W. Biedermann1013.51%150.00%
Total74100.00%2100.00%

#if defined(CONFIG_QUOTA) #define quota_error(sb, fmt, args...) \ __quota_error((sb), __func__, fmt , ## args) extern __printf(3, 4) void __quota_error(struct super_block *sb, const char *func, const char *fmt, ...); /* * declaration of quota_function calls in kernel. */ void inode_add_rsv_space(struct inode *inode, qsize_t number); void inode_claim_rsv_space(struct inode *inode, qsize_t number); void inode_sub_rsv_space(struct inode *inode, qsize_t number); void inode_reclaim_rsv_space(struct inode *inode, qsize_t number); int dquot_initialize(struct inode *inode); bool dquot_initialize_needed(struct inode *inode); void dquot_drop(struct inode *inode); struct dquot *dqget(struct super_block *sb, struct kqid qid);
static inline struct dquot *dqgrab(struct dquot *dquot) { /* Make sure someone else has active reference to dquot */ WARN_ON_ONCE(!atomic_read(&dquot->dq_count)); WARN_ON_ONCE(!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)); atomic_inc(&dquot->dq_count); return dquot; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara52100.00%1100.00%
Total52100.00%1100.00%

void dqput(struct dquot *dquot); int dquot_scan_active(struct super_block *sb, int (*fn)(struct dquot *dquot, unsigned long priv), unsigned long priv); struct dquot *dquot_alloc(struct super_block *sb, int type); void dquot_destroy(struct dquot *dquot); int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags); void __dquot_free_space(struct inode *inode, qsize_t number, int flags); int dquot_alloc_inode(struct inode *inode); int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); void dquot_free_inode(struct inode *inode); void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number); int dquot_disable(struct super_block *sb, int type, unsigned int flags); /* Suspend quotas on remount RO */
static inline int dquot_suspend(struct super_block *sb, int type) { return dquot_disable(sb, type, DQUOT_SUSPENDED); }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig25100.00%1100.00%
Total25100.00%1100.00%

int dquot_resume(struct super_block *sb, int type); int dquot_commit(struct dquot *dquot); int dquot_acquire(struct dquot *dquot); int dquot_release(struct dquot *dquot); int dquot_commit_info(struct super_block *sb, int type); int dquot_get_next_id(struct super_block *sb, struct kqid *qid); int dquot_mark_dquot_dirty(struct dquot *dquot); int dquot_file_open(struct inode *inode, struct file *file); int dquot_enable(struct inode *inode, int type, int format_id, unsigned int flags); int dquot_quota_on(struct super_block *sb, int type, int format_id, const struct path *path); int dquot_quota_on_mount(struct super_block *sb, char *qf_name, int format_id, int type); int dquot_quota_off(struct super_block *sb, int type); int dquot_writeback_dquots(struct super_block *sb, int type); int dquot_quota_sync(struct super_block *sb, int type); int dquot_get_state(struct super_block *sb, struct qc_state *state); int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii); int dquot_get_dqblk(struct super_block *sb, struct kqid id, struct qc_dqblk *di); int dquot_get_next_dqblk(struct super_block *sb, struct kqid *id, struct qc_dqblk *di); int dquot_set_dqblk(struct super_block *sb, struct kqid id, struct qc_dqblk *di); int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); int dquot_transfer(struct inode *inode, struct iattr *iattr);
static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) { return sb_dqopt(sb)->info + type; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara27100.00%2100.00%
Total27100.00%2100.00%

/* * Functions for checking status of quota */
static inline bool sb_has_quota_usage_enabled(struct super_block *sb, int type) { return sb_dqopt(sb)->flags & dquot_state_flag(DQUOT_USAGE_ENABLED, type); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2996.67%480.00%
Dmitriy Monakhov13.33%120.00%
Total30100.00%5100.00%


static inline bool sb_has_quota_limits_enabled(struct super_block *sb, int type) { return sb_dqopt(sb)->flags & dquot_state_flag(DQUOT_LIMITS_ENABLED, type); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2996.67%266.67%
Dmitriy Monakhov13.33%133.33%
Total30100.00%3100.00%


static inline bool sb_has_quota_suspended(struct super_block *sb, int type) { return sb_dqopt(sb)->flags & dquot_state_flag(DQUOT_SUSPENDED, type); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2996.67%375.00%
Dmitriy Monakhov13.33%125.00%
Total30100.00%4100.00%


static inline unsigned sb_any_quota_suspended(struct super_block *sb) { return dquot_state_types(sb_dqopt(sb)->flags, DQUOT_SUSPENDED); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara1664.00%360.00%
Konstantin Khlebnikov832.00%120.00%
Dmitriy Monakhov14.00%120.00%
Total25100.00%5100.00%

/* Does kernel know about any quota information for given sb + type? */
static inline bool sb_has_quota_loaded(struct super_block *sb, int type) { /* Currently if anything is on, then quota usage is on as well */ return sb_has_quota_usage_enabled(sb, type); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2395.83%375.00%
Dmitriy Monakhov14.17%125.00%
Total24100.00%4100.00%


static inline unsigned sb_any_quota_loaded(struct super_block *sb) { return dquot_state_types(sb_dqopt(sb)->flags, DQUOT_USAGE_ENABLED); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara1664.00%250.00%
Konstantin Khlebnikov832.00%125.00%
Dmitriy Monakhov14.00%125.00%
Total25100.00%4100.00%


static inline bool sb_has_quota_active(struct super_block *sb, int type) { return sb_has_quota_loaded(sb, type) && !sb_has_quota_suspended(sb, type); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara3096.77%375.00%
Dmitriy Monakhov13.23%125.00%
Total31100.00%4100.00%

/* * Operations supported for diskquotas. */ extern const struct dquot_operations dquot_operations; extern const struct quotactl_ops dquot_quotactl_sysfile_ops; #else
static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig633.33%116.67%
Linus Torvalds633.33%233.33%
Linus Torvalds (pre-git)527.78%233.33%
Jan Kara15.56%116.67%
Total18100.00%6100.00%


static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Mingming Cao1372.22%150.00%
Christoph Hellwig527.78%150.00%
Total18100.00%2100.00%


static inline int sb_has_quota_suspended(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara738.89%350.00%
Christoph Hellwig633.33%116.67%
Linus Torvalds316.67%116.67%
Linus Torvalds (pre-git)211.11%116.67%
Total18100.00%6100.00%


static inline int sb_any_quota_suspended(struct super_block *sb) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara15100.00%2100.00%
Total15100.00%2100.00%

/* Does kernel know about any quota information for given sb + type? */
static inline int sb_has_quota_loaded(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara18100.00%1100.00%
Total18100.00%1100.00%


static inline int sb_any_quota_loaded(struct super_block *sb) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara15100.00%1100.00%
Total15100.00%1100.00%


static inline int sb_has_quota_active(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara18100.00%1100.00%
Total18100.00%1100.00%


static inline int dquot_initialize(struct inode *inode) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara1386.67%360.00%
Linus Torvalds (pre-git)16.67%120.00%
Christoph Hellwig16.67%120.00%
Total15100.00%5100.00%


static inline bool dquot_initialize_needed(struct inode *inode) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
Tahsin Erdogan15100.00%1100.00%
Total15100.00%1100.00%


static inline void dquot_drop(struct inode *inode) { }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton763.64%133.33%
Linus Torvalds (pre-git)327.27%133.33%
Christoph Hellwig19.09%133.33%
Total11100.00%3100.00%


static inline int dquot_alloc_inode(struct inode *inode) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton1173.33%133.33%
Linus Torvalds (pre-git)320.00%133.33%
Christoph Hellwig16.67%133.33%
Total15100.00%3100.00%


static inline void dquot_free_inode(struct inode *inode) { }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton763.64%133.33%
Linus Torvalds (pre-git)327.27%133.33%
Christoph Hellwig19.09%133.33%
Total11100.00%3100.00%


static inline int dquot_transfer(struct inode *inode, struct iattr *iattr) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton1470.00%125.00%
Linus Torvalds (pre-git)420.00%125.00%
Christoph Hellwig15.00%125.00%
Linus Torvalds15.00%125.00%
Total20100.00%4100.00%


static inline int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags) { if (!(flags & DQUOT_SPACE_RESERVE)) inode_add_bytes(inode, number); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1540.54%116.67%
Christoph Hellwig924.32%116.67%
Eric Sandeen616.22%116.67%
Jan Kara513.51%233.33%
Adrian Bunk25.41%116.67%
Total37100.00%6100.00%


static inline void __dquot_free_space(struct inode *inode, qsize_t number, int flags) { if (!(flags & DQUOT_SPACE_RESERVE)) inode_sub_bytes(inode, number); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1441.18%120.00%
Christoph Hellwig1132.35%120.00%
Eric Sandeen617.65%120.00%
Adrian Bunk25.88%120.00%
Jan Kara12.94%120.00%
Total34100.00%5100.00%


static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) { inode_add_bytes(inode, number); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1560.00%120.00%
Jan Kara520.00%240.00%
Christoph Hellwig312.00%120.00%
Adrian Bunk28.00%120.00%
Total25100.00%5100.00%


static inline int dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number) { inode_sub_bytes(inode, number); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara25100.00%1100.00%
Total25100.00%1100.00%


static inline int dquot_disable(struct super_block *sb, int type, unsigned int flags) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig22100.00%1100.00%
Total22100.00%1100.00%


static inline int dquot_suspend(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig18100.00%1100.00%
Total18100.00%1100.00%


static inline int dquot_resume(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig18100.00%1100.00%
Total18100.00%1100.00%

#define dquot_file_open generic_file_open
static inline int dquot_writeback_dquots(struct super_block *sb, int type) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara18100.00%1100.00%
Total18100.00%1100.00%

#endif /* CONFIG_QUOTA */
static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) { return __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1664.00%120.00%
Christoph Hellwig520.00%120.00%
Adrian Bunk28.00%120.00%
Eric Sandeen14.00%120.00%
Jan Kara14.00%120.00%
Total25100.00%5100.00%


static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr) { __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL); mark_inode_dirty_sync(inode); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Sandeen3096.77%150.00%
Jan Kara13.23%150.00%
Total31100.00%2100.00%


static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) { int ret; ret = dquot_alloc_space_nodirty(inode, nr); if (!ret) { /* * Mark inode fully dirty. Since we are allocating blocks, inode * would become fully dirty soon anyway and it reportedly * reduces lock contention. */ mark_inode_dirty(inode); } return ret; }

Contributors

PersonTokensPropCommitsCommitProp
Mingming Cao2353.49%240.00%
Christoph Hellwig1637.21%120.00%
David Shaohua Li36.98%120.00%
Dave Chinner12.33%120.00%
Total43100.00%5100.00%


static inline int dquot_alloc_block_nodirty(struct inode *inode, qsize_t nr) { return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1244.44%120.00%
Christoph Hellwig933.33%120.00%
Jan Kara414.81%240.00%
Adrian Bunk27.41%120.00%
Total27100.00%5100.00%


static inline void dquot_alloc_block_nofail(struct inode *inode, qsize_t nr) { dquot_alloc_space_nofail(inode, nr << inode->i_blkbits); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Sandeen26100.00%1100.00%
Total26100.00%1100.00%


static inline int dquot_alloc_block(struct inode *inode, qsize_t nr) { return dquot_alloc_space(inode, nr << inode->i_blkbits); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds1659.26%125.00%
Christoph Hellwig829.63%125.00%
Adrian Bunk27.41%125.00%
Jan Kara13.70%125.00%
Total27100.00%4100.00%


static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr) { return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2482.76%250.00%
Christoph Hellwig413.79%125.00%
Mingming Cao13.45%125.00%
Total29100.00%4100.00%


static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr) { int ret; ret = dquot_prealloc_block_nodirty(inode, nr); if (!ret) mark_inode_dirty_sync(inode); return ret; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2255.00%375.00%
Christoph Hellwig1845.00%125.00%
Total40100.00%4100.00%


static inline int dquot_reserve_block(struct inode *inode, qsize_t nr) { return __dquot_alloc_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2477.42%240.00%
Eric Sandeen39.68%120.00%
Christoph Hellwig39.68%120.00%
Mingming Cao13.23%120.00%
Total31100.00%5100.00%


static inline int dquot_claim_block(struct inode *inode, qsize_t nr) { int ret; ret = dquot_claim_space_nodirty(inode, nr << inode->i_blkbits); if (!ret) mark_inode_dirty_sync(inode); return ret; }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2454.55%360.00%
Christoph Hellwig1943.18%120.00%
Mingming Cao12.27%120.00%
Total44100.00%5100.00%


static inline void dquot_reclaim_block(struct inode *inode, qsize_t nr) { dquot_reclaim_space_nodirty(inode, nr << inode->i_blkbits); mark_inode_dirty_sync(inode); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara31100.00%1100.00%
Total31100.00%1100.00%


static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr) { __dquot_free_space(inode, nr, 0); }

Contributors

PersonTokensPropCommitsCommitProp
Mingming Cao1875.00%150.00%
Christoph Hellwig625.00%150.00%
Total24100.00%2100.00%


static inline void dquot_free_space(struct inode *inode, qsize_t nr) { dquot_free_space_nodirty(inode, nr); mark_inode_dirty_sync(inode); }

Contributors

PersonTokensPropCommitsCommitProp
Mingming Cao1970.37%133.33%
Christoph Hellwig725.93%133.33%
Jan Kara13.70%133.33%
Total27100.00%3100.00%


static inline void dquot_free_block_nodirty(struct inode *inode, qsize_t nr) { dquot_free_space_nodirty(inode, nr << inode->i_blkbits); }

Contributors

PersonTokensPropCommitsCommitProp
Mingming Cao2492.31%150.00%
Christoph Hellwig27.69%150.00%
Total26100.00%2100.00%


static inline void dquot_free_block(struct inode *inode, qsize_t nr) { dquot_free_space(inode, nr << inode->i_blkbits); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2388.46%250.00%
Christoph Hellwig27.69%125.00%
Mingming Cao13.85%125.00%
Total26100.00%4100.00%


static inline void dquot_release_reservation_block(struct inode *inode, qsize_t nr) { __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Kara2382.14%240.00%
Christoph Hellwig310.71%120.00%
Mingming Cao13.57%120.00%
Eric Sandeen13.57%120.00%
Total28100.00%5100.00%

unsigned int qtype_enforce_flag(int type); #endif /* _LINUX_QUOTAOPS_ */

Overall Contributors

PersonTokensPropCommitsCommitProp
Jan Kara82642.93%2739.13%
Christoph Hellwig30916.06%1014.49%
Andrew Morton1598.26%22.90%
Mingming Cao1236.39%34.35%
Dmitriy Monakhov1075.56%34.35%
Linus Torvalds1005.20%34.35%
Eric Sandeen874.52%22.90%
Linus Torvalds (pre-git)784.05%22.90%
Jiaying Zhang341.77%11.45%
Tahsin Erdogan241.25%11.45%
Al Viro201.04%22.90%
Eric W. Biedermann170.88%34.35%
Konstantin Khlebnikov160.83%11.45%
Adrian Bunk130.68%22.90%
Joe Perches40.21%22.90%
David Shaohua Li30.16%11.45%
Alexey Dobriyan20.10%22.90%
Dave Chinner10.05%11.45%
Dave Jones10.05%11.45%
Total1924100.00%69100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.