aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quotaops.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/quotaops.h')
-rw-r--r--include/linux/quotaops.h397
1 files changed, 149 insertions, 248 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 3ebb23153640..d1a9193960f1 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -9,25 +9,40 @@
9 9
10#include <linux/fs.h> 10#include <linux/fs.h>
11 11
12#define DQUOT_SPACE_WARN 0x1
13#define DQUOT_SPACE_RESERVE 0x2
14#define DQUOT_SPACE_NOFAIL 0x4
15
12static inline struct quota_info *sb_dqopt(struct super_block *sb) 16static inline struct quota_info *sb_dqopt(struct super_block *sb)
13{ 17{
14 return &sb->s_dquot; 18 return &sb->s_dquot;
15} 19}
16 20
21/* i_mutex must being held */
22static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
23{
24 return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) ||
25 (ia->ia_valid & ATTR_UID && ia->ia_uid != inode->i_uid) ||
26 (ia->ia_valid & ATTR_GID && ia->ia_gid != inode->i_gid);
27}
28
17#if defined(CONFIG_QUOTA) 29#if defined(CONFIG_QUOTA)
18 30
31#define quota_error(sb, fmt, args...) \
32 __quota_error((sb), __func__, fmt , ## args)
33
34extern void __quota_error(struct super_block *sb, const char *func,
35 const char *fmt, ...);
36
19/* 37/*
20 * declaration of quota_function calls in kernel. 38 * declaration of quota_function calls in kernel.
21 */ 39 */
22void sync_quota_sb(struct super_block *sb, int type); 40void inode_add_rsv_space(struct inode *inode, qsize_t number);
23static inline void writeout_quota_sb(struct super_block *sb, int type) 41void inode_claim_rsv_space(struct inode *inode, qsize_t number);
24{ 42void inode_sub_rsv_space(struct inode *inode, qsize_t number);
25 if (sb->s_qcop->quota_sync)
26 sb->s_qcop->quota_sync(sb, type);
27}
28 43
29int dquot_initialize(struct inode *inode, int type); 44void dquot_initialize(struct inode *inode);
30int dquot_drop(struct inode *inode); 45void dquot_drop(struct inode *inode);
31struct dquot *dqget(struct super_block *sb, unsigned int id, int type); 46struct dquot *dqget(struct super_block *sb, unsigned int id, int type);
32void dqput(struct dquot *dquot); 47void dqput(struct dquot *dquot);
33int dquot_scan_active(struct super_block *sb, 48int dquot_scan_active(struct super_block *sb,
@@ -36,43 +51,49 @@ int dquot_scan_active(struct super_block *sb,
36struct dquot *dquot_alloc(struct super_block *sb, int type); 51struct dquot *dquot_alloc(struct super_block *sb, int type);
37void dquot_destroy(struct dquot *dquot); 52void dquot_destroy(struct dquot *dquot);
38 53
39int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); 54int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags);
40int dquot_alloc_inode(const struct inode *inode, qsize_t number); 55void __dquot_free_space(struct inode *inode, qsize_t number, int flags);
41 56
42int dquot_reserve_space(struct inode *inode, qsize_t number, int prealloc); 57int dquot_alloc_inode(const struct inode *inode);
43int dquot_claim_space(struct inode *inode, qsize_t number);
44void dquot_release_reserved_space(struct inode *inode, qsize_t number);
45qsize_t dquot_get_reserved_space(struct inode *inode);
46 58
47int dquot_free_space(struct inode *inode, qsize_t number); 59int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
48int dquot_free_inode(const struct inode *inode, qsize_t number); 60void dquot_free_inode(const struct inode *inode);
61
62int dquot_disable(struct super_block *sb, int type, unsigned int flags);
63/* Suspend quotas on remount RO */
64static inline int dquot_suspend(struct super_block *sb, int type)
65{
66 return dquot_disable(sb, type, DQUOT_SUSPENDED);
67}
68int dquot_resume(struct super_block *sb, int type);
49 69
50int dquot_transfer(struct inode *inode, struct iattr *iattr);
51int dquot_commit(struct dquot *dquot); 70int dquot_commit(struct dquot *dquot);
52int dquot_acquire(struct dquot *dquot); 71int dquot_acquire(struct dquot *dquot);
53int dquot_release(struct dquot *dquot); 72int dquot_release(struct dquot *dquot);
54int dquot_commit_info(struct super_block *sb, int type); 73int dquot_commit_info(struct super_block *sb, int type);
55int dquot_mark_dquot_dirty(struct dquot *dquot); 74int dquot_mark_dquot_dirty(struct dquot *dquot);
56 75
57int vfs_quota_on(struct super_block *sb, int type, int format_id, 76int dquot_file_open(struct inode *inode, struct file *file);
58 char *path, int remount); 77
59int vfs_quota_enable(struct inode *inode, int type, int format_id, 78int dquot_quota_on(struct super_block *sb, int type, int format_id,
79 char *path);
80int dquot_enable(struct inode *inode, int type, int format_id,
60 unsigned int flags); 81 unsigned int flags);
61int vfs_quota_on_path(struct super_block *sb, int type, int format_id, 82int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
62 struct path *path); 83 struct path *path);
63int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 84int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
64 int format_id, int type); 85 int format_id, int type);
65int vfs_quota_off(struct super_block *sb, int type, int remount); 86int dquot_quota_off(struct super_block *sb, int type);
66int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); 87int dquot_quota_sync(struct super_block *sb, int type, int wait);
67int vfs_quota_sync(struct super_block *sb, int type); 88int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
68int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 89int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
69int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 90int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
70int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); 91 struct fs_disk_quota *di);
71int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); 92int dquot_set_dqblk(struct super_block *sb, int type, qid_t id,
72 93 struct fs_disk_quota *di);
73void vfs_dq_drop(struct inode *inode); 94
74int vfs_dq_transfer(struct inode *inode, struct iattr *iattr); 95int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
75int vfs_dq_quota_on_remount(struct super_block *sb); 96int dquot_transfer(struct inode *inode, struct iattr *iattr);
76 97
77static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) 98static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
78{ 99{
@@ -83,189 +104,58 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
83 * Functions for checking status of quota 104 * Functions for checking status of quota
84 */ 105 */
85 106
86static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) 107static inline bool sb_has_quota_usage_enabled(struct super_block *sb, int type)
87{ 108{
88 return sb_dqopt(sb)->flags & 109 return sb_dqopt(sb)->flags &
89 dquot_state_flag(DQUOT_USAGE_ENABLED, type); 110 dquot_state_flag(DQUOT_USAGE_ENABLED, type);
90} 111}
91 112
92static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) 113static inline bool sb_has_quota_limits_enabled(struct super_block *sb, int type)
93{ 114{
94 return sb_dqopt(sb)->flags & 115 return sb_dqopt(sb)->flags &
95 dquot_state_flag(DQUOT_LIMITS_ENABLED, type); 116 dquot_state_flag(DQUOT_LIMITS_ENABLED, type);
96} 117}
97 118
98static inline int sb_has_quota_suspended(struct super_block *sb, int type) 119static inline bool sb_has_quota_suspended(struct super_block *sb, int type)
99{ 120{
100 return sb_dqopt(sb)->flags & 121 return sb_dqopt(sb)->flags &
101 dquot_state_flag(DQUOT_SUSPENDED, type); 122 dquot_state_flag(DQUOT_SUSPENDED, type);
102} 123}
103 124
104static inline int sb_any_quota_suspended(struct super_block *sb) 125static inline unsigned sb_any_quota_suspended(struct super_block *sb)
105{ 126{
106 return sb_has_quota_suspended(sb, USRQUOTA) || 127 unsigned type, tmsk = 0;
107 sb_has_quota_suspended(sb, GRPQUOTA); 128 for (type = 0; type < MAXQUOTAS; type++)
129 tmsk |= sb_has_quota_suspended(sb, type) << type;
130 return tmsk;
108} 131}
109 132
110/* Does kernel know about any quota information for given sb + type? */ 133/* Does kernel know about any quota information for given sb + type? */
111static inline int sb_has_quota_loaded(struct super_block *sb, int type) 134static inline bool sb_has_quota_loaded(struct super_block *sb, int type)
112{ 135{
113 /* Currently if anything is on, then quota usage is on as well */ 136 /* Currently if anything is on, then quota usage is on as well */
114 return sb_has_quota_usage_enabled(sb, type); 137 return sb_has_quota_usage_enabled(sb, type);
115} 138}
116 139
117static inline int sb_any_quota_loaded(struct super_block *sb) 140static inline unsigned sb_any_quota_loaded(struct super_block *sb)
118{ 141{
119 return sb_has_quota_loaded(sb, USRQUOTA) || 142 unsigned type, tmsk = 0;
120 sb_has_quota_loaded(sb, GRPQUOTA); 143 for (type = 0; type < MAXQUOTAS; type++)
144 tmsk |= sb_has_quota_loaded(sb, type) << type;
145 return tmsk;
121} 146}
122 147
123static inline int sb_has_quota_active(struct super_block *sb, int type) 148static inline bool sb_has_quota_active(struct super_block *sb, int type)
124{ 149{
125 return sb_has_quota_loaded(sb, type) && 150 return sb_has_quota_loaded(sb, type) &&
126 !sb_has_quota_suspended(sb, type); 151 !sb_has_quota_suspended(sb, type);
127} 152}
128 153
129static inline int sb_any_quota_active(struct super_block *sb)
130{
131 return sb_has_quota_active(sb, USRQUOTA) ||
132 sb_has_quota_active(sb, GRPQUOTA);
133}
134
135/* 154/*
136 * Operations supported for diskquotas. 155 * Operations supported for diskquotas.
137 */ 156 */
138extern const struct dquot_operations dquot_operations; 157extern const struct dquot_operations dquot_operations;
139extern const struct quotactl_ops vfs_quotactl_ops; 158extern const struct quotactl_ops dquot_quotactl_ops;
140
141#define sb_dquot_ops (&dquot_operations)
142#define sb_quotactl_ops (&vfs_quotactl_ops)
143
144/* It is better to call this function outside of any transaction as it might
145 * need a lot of space in journal for dquot structure allocation. */
146static inline void vfs_dq_init(struct inode *inode)
147{
148 BUG_ON(!inode->i_sb);
149 if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode))
150 inode->i_sb->dq_op->initialize(inode, -1);
151}
152
153/* The following allocation/freeing/transfer functions *must* be called inside
154 * a transaction (deadlocks possible otherwise) */
155static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr)
156{
157 if (sb_any_quota_active(inode->i_sb)) {
158 /* Used space is updated in alloc_space() */
159 if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA)
160 return 1;
161 }
162 else
163 inode_add_bytes(inode, nr);
164 return 0;
165}
166
167static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr)
168{
169 int ret;
170 if (!(ret = vfs_dq_prealloc_space_nodirty(inode, nr)))
171 mark_inode_dirty(inode);
172 return ret;
173}
174
175static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr)
176{
177 if (sb_any_quota_active(inode->i_sb)) {
178 /* Used space is updated in alloc_space() */
179 if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA)
180 return 1;
181 }
182 else
183 inode_add_bytes(inode, nr);
184 return 0;
185}
186
187static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr)
188{
189 int ret;
190 if (!(ret = vfs_dq_alloc_space_nodirty(inode, nr)))
191 mark_inode_dirty(inode);
192 return ret;
193}
194
195static inline int vfs_dq_reserve_space(struct inode *inode, qsize_t nr)
196{
197 if (sb_any_quota_active(inode->i_sb)) {
198 /* Used space is updated in alloc_space() */
199 if (inode->i_sb->dq_op->reserve_space(inode, nr, 0) == NO_QUOTA)
200 return 1;
201 }
202 return 0;
203}
204
205static inline int vfs_dq_alloc_inode(struct inode *inode)
206{
207 if (sb_any_quota_active(inode->i_sb)) {
208 vfs_dq_init(inode);
209 if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA)
210 return 1;
211 }
212 return 0;
213}
214
215/*
216 * Convert in-memory reserved quotas to real consumed quotas
217 */
218static inline int vfs_dq_claim_space(struct inode *inode, qsize_t nr)
219{
220 if (sb_any_quota_active(inode->i_sb)) {
221 if (inode->i_sb->dq_op->claim_space(inode, nr) == NO_QUOTA)
222 return 1;
223 } else
224 inode_add_bytes(inode, nr);
225
226 mark_inode_dirty(inode);
227 return 0;
228}
229
230/*
231 * Release reserved (in-memory) quotas
232 */
233static inline
234void vfs_dq_release_reservation_space(struct inode *inode, qsize_t nr)
235{
236 if (sb_any_quota_active(inode->i_sb))
237 inode->i_sb->dq_op->release_rsv(inode, nr);
238}
239
240static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr)
241{
242 if (sb_any_quota_active(inode->i_sb))
243 inode->i_sb->dq_op->free_space(inode, nr);
244 else
245 inode_sub_bytes(inode, nr);
246}
247
248static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr)
249{
250 vfs_dq_free_space_nodirty(inode, nr);
251 mark_inode_dirty(inode);
252}
253
254static inline void vfs_dq_free_inode(struct inode *inode)
255{
256 if (sb_any_quota_active(inode->i_sb))
257 inode->i_sb->dq_op->free_inode(inode, 1);
258}
259
260/* Cannot be called inside a transaction */
261static inline int vfs_dq_off(struct super_block *sb, int remount)
262{
263 int ret = -ENOSYS;
264
265 if (sb->s_qcop && sb->s_qcop->quota_off)
266 ret = sb->s_qcop->quota_off(sb, -1, remount);
267 return ret;
268}
269 159
270#else 160#else
271 161
@@ -305,156 +195,167 @@ static inline int sb_has_quota_active(struct super_block *sb, int type)
305 return 0; 195 return 0;
306} 196}
307 197
308static inline int sb_any_quota_active(struct super_block *sb) 198static inline void dquot_initialize(struct inode *inode)
309{ 199{
310 return 0;
311} 200}
312 201
313/* 202static inline void dquot_drop(struct inode *inode)
314 * NO-OP when quota not configured.
315 */
316#define sb_dquot_ops (NULL)
317#define sb_quotactl_ops (NULL)
318
319static inline void vfs_dq_init(struct inode *inode)
320{ 203{
321} 204}
322 205
323static inline void vfs_dq_drop(struct inode *inode) 206static inline int dquot_alloc_inode(const struct inode *inode)
324{ 207{
208 return 0;
325} 209}
326 210
327static inline int vfs_dq_alloc_inode(struct inode *inode) 211static inline void dquot_free_inode(const struct inode *inode)
328{ 212{
329 return 0;
330} 213}
331 214
332static inline void vfs_dq_free_inode(struct inode *inode) 215static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
333{ 216{
217 return 0;
334} 218}
335 219
336static inline void sync_quota_sb(struct super_block *sb, int type) 220static inline int __dquot_alloc_space(struct inode *inode, qsize_t number,
221 int flags)
337{ 222{
223 if (!(flags & DQUOT_SPACE_RESERVE))
224 inode_add_bytes(inode, number);
225 return 0;
338} 226}
339 227
340static inline void writeout_quota_sb(struct super_block *sb, int type) 228static inline void __dquot_free_space(struct inode *inode, qsize_t number,
229 int flags)
341{ 230{
231 if (!(flags & DQUOT_SPACE_RESERVE))
232 inode_sub_bytes(inode, number);
342} 233}
343 234
344static inline int vfs_dq_off(struct super_block *sb, int remount) 235static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
345{ 236{
237 inode_add_bytes(inode, number);
346 return 0; 238 return 0;
347} 239}
348 240
349static inline int vfs_dq_quota_on_remount(struct super_block *sb) 241static inline int dquot_disable(struct super_block *sb, int type,
242 unsigned int flags)
350{ 243{
351 return 0; 244 return 0;
352} 245}
353 246
354static inline int vfs_dq_transfer(struct inode *inode, struct iattr *iattr) 247static inline int dquot_suspend(struct super_block *sb, int type)
355{ 248{
356 return 0; 249 return 0;
357} 250}
358 251
359static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) 252static inline int dquot_resume(struct super_block *sb, int type)
360{ 253{
361 inode_add_bytes(inode, nr);
362 return 0; 254 return 0;
363} 255}
364 256
365static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr) 257#define dquot_file_open generic_file_open
258
259#endif /* CONFIG_QUOTA */
260
261static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
366{ 262{
367 vfs_dq_prealloc_space_nodirty(inode, nr); 263 return __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN);
368 mark_inode_dirty(inode);
369 return 0;
370} 264}
371 265
372static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) 266static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr)
373{ 267{
374 inode_add_bytes(inode, nr); 268 __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL);
375 return 0; 269 mark_inode_dirty_sync(inode);
376} 270}
377 271
378static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr) 272static inline int dquot_alloc_space(struct inode *inode, qsize_t nr)
379{ 273{
380 vfs_dq_alloc_space_nodirty(inode, nr); 274 int ret;
381 mark_inode_dirty(inode); 275
382 return 0; 276 ret = dquot_alloc_space_nodirty(inode, nr);
277 if (!ret) {
278 /*
279 * Mark inode fully dirty. Since we are allocating blocks, inode
280 * would become fully dirty soon anyway and it reportedly
281 * reduces inode_lock contention.
282 */
283 mark_inode_dirty(inode);
284 }
285 return ret;
383} 286}
384 287
385static inline int vfs_dq_reserve_space(struct inode *inode, qsize_t nr) 288static inline int dquot_alloc_block_nodirty(struct inode *inode, qsize_t nr)
386{ 289{
387 return 0; 290 return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits);
388} 291}
389 292
390static inline int vfs_dq_claim_space(struct inode *inode, qsize_t nr) 293static inline void dquot_alloc_block_nofail(struct inode *inode, qsize_t nr)
391{ 294{
392 return vfs_dq_alloc_space(inode, nr); 295 dquot_alloc_space_nofail(inode, nr << inode->i_blkbits);
393} 296}
394 297
395static inline 298static inline int dquot_alloc_block(struct inode *inode, qsize_t nr)
396int vfs_dq_release_reservation_space(struct inode *inode, qsize_t nr)
397{ 299{
398 return 0; 300 return dquot_alloc_space(inode, nr << inode->i_blkbits);
399} 301}
400 302
401static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) 303static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr)
402{ 304{
403 inode_sub_bytes(inode, nr); 305 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0);
404} 306}
405 307
406static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) 308static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr)
407{ 309{
408 vfs_dq_free_space_nodirty(inode, nr); 310 int ret;
409 mark_inode_dirty(inode);
410}
411
412#endif /* CONFIG_QUOTA */
413 311
414static inline int vfs_dq_prealloc_block_nodirty(struct inode *inode, qsize_t nr) 312 ret = dquot_prealloc_block_nodirty(inode, nr);
415{ 313 if (!ret)
416 return vfs_dq_prealloc_space_nodirty(inode, nr << inode->i_blkbits); 314 mark_inode_dirty_sync(inode);
315 return ret;
417} 316}
418 317
419static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr) 318static inline int dquot_reserve_block(struct inode *inode, qsize_t nr)
420{ 319{
421 return vfs_dq_prealloc_space(inode, nr << inode->i_blkbits); 320 return __dquot_alloc_space(inode, nr << inode->i_blkbits,
321 DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE);
422} 322}
423 323
424static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr) 324static inline int dquot_claim_block(struct inode *inode, qsize_t nr)
425{ 325{
426 return vfs_dq_alloc_space_nodirty(inode, nr << inode->i_blkbits); 326 int ret;
427}
428 327
429static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr) 328 ret = dquot_claim_space_nodirty(inode, nr << inode->i_blkbits);
430{ 329 if (!ret)
431 return vfs_dq_alloc_space(inode, nr << inode->i_blkbits); 330 mark_inode_dirty_sync(inode);
331 return ret;
432} 332}
433 333
434static inline int vfs_dq_reserve_block(struct inode *inode, qsize_t nr) 334static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr)
435{ 335{
436 return vfs_dq_reserve_space(inode, nr << inode->i_blkbits); 336 __dquot_free_space(inode, nr, 0);
437} 337}
438 338
439static inline int vfs_dq_claim_block(struct inode *inode, qsize_t nr) 339static inline void dquot_free_space(struct inode *inode, qsize_t nr)
440{ 340{
441 return vfs_dq_claim_space(inode, nr << inode->i_blkbits); 341 dquot_free_space_nodirty(inode, nr);
342 mark_inode_dirty_sync(inode);
442} 343}
443 344
444static inline 345static inline void dquot_free_block_nodirty(struct inode *inode, qsize_t nr)
445void vfs_dq_release_reservation_block(struct inode *inode, qsize_t nr)
446{ 346{
447 vfs_dq_release_reservation_space(inode, nr << inode->i_blkbits); 347 dquot_free_space_nodirty(inode, nr << inode->i_blkbits);
448} 348}
449 349
450static inline void vfs_dq_free_block_nodirty(struct inode *inode, qsize_t nr) 350static inline void dquot_free_block(struct inode *inode, qsize_t nr)
451{ 351{
452 vfs_dq_free_space_nodirty(inode, nr << inode->i_blkbits); 352 dquot_free_space(inode, nr << inode->i_blkbits);
453} 353}
454 354
455static inline void vfs_dq_free_block(struct inode *inode, qsize_t nr) 355static inline void dquot_release_reservation_block(struct inode *inode,
356 qsize_t nr)
456{ 357{
457 vfs_dq_free_space(inode, nr << inode->i_blkbits); 358 __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE);
458} 359}
459 360
460#endif /* _LINUX_QUOTAOPS_ */ 361#endif /* _LINUX_QUOTAOPS_ */