cregit-Linux how code gets into the kernel

Release 4.7 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 karajan 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 monakhovdmitriy monakhov6486.49%150.00%
eric w. biedermaneric w. biederman1013.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); 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 karajan 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 hellwigchristoph 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, 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 karajan 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 karajan kara2996.67%480.00%
dmitriy monakhovdmitriy 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 karajan kara2996.67%266.67%
dmitriy monakhovdmitriy 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 karajan kara2996.67%375.00%
dmitriy monakhovdmitriy 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 karajan kara1664.00%360.00%
konstantin khlebnikovkonstantin khlebnikov832.00%120.00%
dmitriy monakhovdmitriy 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 karajan kara2395.83%375.00%
dmitriy monakhovdmitriy 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 karajan kara1664.00%250.00%
konstantin khlebnikovkonstantin khlebnikov832.00%125.00%
dmitriy monakhovdmitriy 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 karajan kara3096.77%375.00%
dmitriy monakhovdmitriy 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_ops; 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 hellwigchristoph hellwig633.33%116.67%
linus torvaldslinus torvalds633.33%233.33%
pre-gitpre-git527.78%233.33%
jan karajan 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 caomingming cao1266.67%150.00%
christoph hellwigchristoph hellwig633.33%150.00%
Total18100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
christoph hellwigchristoph hellwig1477.78%150.00%
mingming caomingming cao422.22%150.00%
Total18100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
jan karajan kara960.00%350.00%
linus torvaldslinus torvalds320.00%116.67%
christoph hellwigchristoph hellwig213.33%116.67%
pre-gitpre-git16.67%116.67%
Total15100.00%6100.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 karajan kara18100.00%1100.00%
Total18100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
jan karajan 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 karajan kara18100.00%1100.00%
Total18100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
jan karajan kara640.00%125.00%
andrew mortonandrew morton533.33%125.00%
pre-gitpre-git320.00%125.00%
christoph hellwigchristoph hellwig16.67%125.00%
Total15100.00%4100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton763.64%133.33%
pre-gitpre-git327.27%133.33%
christoph hellwigchristoph hellwig19.09%133.33%
Total11100.00%3100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton1173.33%133.33%
pre-gitpre-git320.00%133.33%
christoph hellwigchristoph hellwig16.67%133.33%
Total15100.00%3100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton763.64%133.33%
pre-gitpre-git327.27%133.33%
christoph hellwigchristoph hellwig19.09%133.33%
Total11100.00%3100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton1470.00%125.00%
pre-gitpre-git420.00%125.00%
christoph hellwigchristoph hellwig15.00%125.00%
linus torvaldslinus 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 torvaldslinus torvalds1540.54%116.67%
christoph hellwigchristoph hellwig924.32%116.67%
eric sandeeneric sandeen616.22%116.67%
jan karajan kara513.51%233.33%
adrian bunkadrian 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 torvaldslinus torvalds1441.18%120.00%
christoph hellwigchristoph hellwig1132.35%120.00%
eric sandeeneric sandeen617.65%120.00%
adrian bunkadrian bunk25.88%120.00%
jan karajan 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 torvaldslinus torvalds1560.00%120.00%
jan karajan kara520.00%240.00%
christoph hellwigchristoph hellwig312.00%120.00%
adrian bunkadrian 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 karajan 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 hellwigchristoph hellwig22100.00%1100.00%
Total22100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
christoph hellwigchristoph hellwig18100.00%1100.00%
Total18100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
christoph hellwigchristoph 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 karajan 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 torvaldslinus torvalds1664.00%120.00%
christoph hellwigchristoph hellwig520.00%120.00%
adrian bunkadrian bunk28.00%120.00%
jan karajan kara14.00%120.00%
eric sandeeneric sandeen14.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 sandeeneric sandeen3096.77%150.00%
jan karajan 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 caomingming cao2353.49%240.00%
christoph hellwigchristoph hellwig1637.21%120.00%
li shaohuali shaohua36.98%120.00%
dave chinnerdave 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 torvaldslinus torvalds1244.44%120.00%
christoph hellwigchristoph hellwig933.33%120.00%
jan karajan kara414.81%240.00%
adrian bunkadrian 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 sandeeneric 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 torvaldslinus torvalds1659.26%125.00%
christoph hellwigchristoph hellwig829.63%125.00%
adrian bunkadrian bunk27.41%125.00%
jan karajan 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 karajan kara2482.76%250.00%
christoph hellwigchristoph hellwig413.79%125.00%
mingming caomingming 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 karajan kara2255.00%375.00%
christoph hellwigchristoph 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 karajan kara2477.42%240.00%
christoph hellwigchristoph hellwig39.68%120.00%
eric sandeeneric sandeen39.68%120.00%
mingming caomingming 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 karajan kara2454.55%360.00%
christoph hellwigchristoph hellwig1943.18%120.00%
mingming caomingming 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 karajan 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 caomingming cao1875.00%150.00%
christoph hellwigchristoph 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 caomingming cao1970.37%133.33%
christoph hellwigchristoph hellwig725.93%133.33%
jan karajan 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 caomingming cao2492.31%150.00%
christoph hellwigchristoph 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 karajan kara2388.46%250.00%
christoph hellwigchristoph hellwig27.69%125.00%
mingming caomingming 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 karajan kara2382.14%240.00%
christoph hellwigchristoph hellwig310.71%120.00%
mingming caomingming cao13.57%120.00%
eric sandeeneric sandeen13.57%120.00%
Total28100.00%5100.00%

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

Overall Contributors

PersonTokensPropCommitsCommitProp
jan karajan kara80041.99%2639.39%
christoph hellwigchristoph hellwig32116.85%1015.15%
andrew mortonandrew morton1759.19%23.03%
mingming caomingming cao1266.61%34.55%
dmitriy monakhovdmitriy monakhov1075.62%34.55%
linus torvaldslinus torvalds1005.25%34.55%
eric sandeeneric sandeen874.57%23.03%
pre-gitpre-git794.15%23.03%
jiaying zhangjiaying zhang341.78%11.52%
al viroal viro191.00%11.52%
eric w. biedermaneric w. biederman170.89%34.55%
konstantin khlebnikovkonstantin khlebnikov160.84%11.52%
adrian bunkadrian bunk130.68%23.03%
joe perchesjoe perches40.21%23.03%
li shaohuali shaohua30.16%11.52%
alexey dobriyanalexey dobriyan20.10%23.03%
dave jonesdave jones10.05%11.52%
dave chinnerdave chinner10.05%11.52%
Total1905100.00%66100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}