|
@@ -46,6 +46,14 @@ void inode_reclaim_rsv_space(struct inode *inode, qsize_t number);
|
|
|
void 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;
|
|
|
+}
|
|
|
void dqput(struct dquot *dquot);
|
|
|
int dquot_scan_active(struct super_block *sb,
|
|
|
int (*fn)(struct dquot *dquot, unsigned long priv),
|