dquot: cleanup space allocation / freeing routines
Get rid of the alloc_space, free_space, reserve_space, claim_space and release_rsv dquot operations - they are always called from the filesystem and if a filesystem really needs their own (which none currently does) it can just call into it's own routine directly. Move shared logic into the common __dquot_alloc_space, dquot_claim_space_nodirty and __dquot_free_space low-level methods, and rationalize the wrappers around it to move as much as possible code into the common block for CONFIG_QUOTA vs not. Also rename all these helpers to be named dquot_* instead of vfs_dq_*. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:

committed by
Jan Kara

parent
49792c806d
commit
5dd4056db8
@@ -425,7 +425,7 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
|
||||
|
||||
journal_mark_dirty(th, s, sbh);
|
||||
if (for_unformatted)
|
||||
vfs_dq_free_block_nodirty(inode, 1);
|
||||
dquot_free_block_nodirty(inode, 1);
|
||||
}
|
||||
|
||||
void reiserfs_free_block(struct reiserfs_transaction_handle *th,
|
||||
@@ -1049,7 +1049,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
|
||||
amount_needed, hint->inode->i_uid);
|
||||
#endif
|
||||
quota_ret =
|
||||
vfs_dq_alloc_block_nodirty(hint->inode, amount_needed);
|
||||
dquot_alloc_block_nodirty(hint->inode, amount_needed);
|
||||
if (quota_ret) /* Quota exceeded? */
|
||||
return QUOTA_EXCEEDED;
|
||||
if (hint->preallocate && hint->prealloc_size) {
|
||||
@@ -1058,7 +1058,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
|
||||
"reiserquota: allocating (prealloc) %d blocks id=%u",
|
||||
hint->prealloc_size, hint->inode->i_uid);
|
||||
#endif
|
||||
quota_ret = vfs_dq_prealloc_block_nodirty(hint->inode,
|
||||
quota_ret = dquot_prealloc_block_nodirty(hint->inode,
|
||||
hint->prealloc_size);
|
||||
if (quota_ret)
|
||||
hint->preallocate = hint->prealloc_size = 0;
|
||||
@@ -1092,7 +1092,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
|
||||
hint->inode->i_uid);
|
||||
#endif
|
||||
/* Free not allocated blocks */
|
||||
vfs_dq_free_block_nodirty(hint->inode,
|
||||
dquot_free_block_nodirty(hint->inode,
|
||||
amount_needed + hint->prealloc_size -
|
||||
nr_allocated);
|
||||
}
|
||||
@@ -1125,7 +1125,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
|
||||
REISERFS_I(hint->inode)->i_prealloc_count,
|
||||
hint->inode->i_uid);
|
||||
#endif
|
||||
vfs_dq_free_block_nodirty(hint->inode, amount_needed +
|
||||
dquot_free_block_nodirty(hint->inode, amount_needed +
|
||||
hint->prealloc_size - nr_allocated -
|
||||
REISERFS_I(hint->inode)->
|
||||
i_prealloc_count);
|
||||
|
Reference in New Issue
Block a user