7 #ifndef _LINUX_QUOTAOPS_
8 #define _LINUX_QUOTAOPS_
12 #define DQUOT_SPACE_WARN 0x1
13 #define DQUOT_SPACE_RESERVE 0x2
14 #define DQUOT_SPACE_NOFAIL 0x4
22 static inline bool is_quota_modification(
struct inode *
inode,
struct iattr *ia)
29 #if defined(CONFIG_QUOTA)
31 #define quota_error(sb, fmt, args...) \
32 __quota_error((sb), __func__, fmt , ## args)
100 return sb_dqopt(sb)->info +
type;
109 return sb_dqopt(sb)->flags &
115 return sb_dqopt(sb)->flags &
121 return sb_dqopt(sb)->flags &
125 static inline unsigned sb_any_quota_suspended(
struct super_block *
sb)
127 unsigned type, tmsk = 0;
129 tmsk |= sb_has_quota_suspended(sb, type) <<
type;
134 static inline bool sb_has_quota_loaded(
struct super_block *sb,
int type)
137 return sb_has_quota_usage_enabled(sb, type);
140 static inline unsigned sb_any_quota_loaded(
struct super_block *sb)
142 unsigned type, tmsk = 0;
144 tmsk |= sb_has_quota_loaded(sb, type) <<
type;
148 static inline bool sb_has_quota_active(
struct super_block *sb,
int type)
150 return sb_has_quota_loaded(sb, type) &&
151 !sb_has_quota_suspended(sb, type);
162 static inline int sb_has_quota_usage_enabled(
struct super_block *sb,
int type)
167 static inline int sb_has_quota_limits_enabled(
struct super_block *sb,
int type)
172 static inline int sb_has_quota_suspended(
struct super_block *sb,
int type)
177 static inline int sb_any_quota_suspended(
struct super_block *sb)
183 static inline int sb_has_quota_loaded(
struct super_block *sb,
int type)
188 static inline int sb_any_quota_loaded(
struct super_block *sb)
193 static inline int sb_has_quota_active(
struct super_block *sb,
int type)
202 static inline void dquot_drop(
struct inode *inode)
247 static inline int dquot_suspend(
struct super_block *sb,
int type)
257 #define dquot_file_open generic_file_open
266 static inline int dquot_alloc_space_nodirty(
struct inode *inode,
qsize_t nr)
271 static inline void dquot_alloc_space_nofail(
struct inode *inode,
qsize_t nr)
274 mark_inode_dirty_sync(inode);
277 static inline int dquot_alloc_space(
struct inode *inode,
qsize_t nr)
281 ret = dquot_alloc_space_nodirty(inode, nr);
288 mark_inode_dirty(inode);
293 static inline int dquot_alloc_block_nodirty(
struct inode *inode,
qsize_t nr)
295 return dquot_alloc_space_nodirty(inode, nr << inode->
i_blkbits);
298 static inline void dquot_alloc_block_nofail(
struct inode *inode,
qsize_t nr)
300 dquot_alloc_space_nofail(inode, nr << inode->
i_blkbits);
303 static inline int dquot_alloc_block(
struct inode *inode,
qsize_t nr)
305 return dquot_alloc_space(inode, nr << inode->
i_blkbits);
308 static inline int dquot_prealloc_block_nodirty(
struct inode *inode,
qsize_t nr)
313 static inline int dquot_prealloc_block(
struct inode *inode,
qsize_t nr)
317 ret = dquot_prealloc_block_nodirty(inode, nr);
319 mark_inode_dirty_sync(inode);
323 static inline int dquot_reserve_block(
struct inode *inode,
qsize_t nr)
329 static inline int dquot_claim_block(
struct inode *inode,
qsize_t nr)
335 mark_inode_dirty_sync(inode);
339 static inline void dquot_free_space_nodirty(
struct inode *inode,
qsize_t nr)
344 static inline void dquot_free_space(
struct inode *inode,
qsize_t nr)
346 dquot_free_space_nodirty(inode, nr);
347 mark_inode_dirty_sync(inode);
350 static inline void dquot_free_block_nodirty(
struct inode *inode,
qsize_t nr)
352 dquot_free_space_nodirty(inode, nr << inode->
i_blkbits);
355 static inline void dquot_free_block(
struct inode *inode,
qsize_t nr)
357 dquot_free_space(inode, nr << inode->
i_blkbits);
360 static inline void dquot_release_reservation_block(
struct inode *inode,