mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
quota: use flags interface for dquot alloc/free space
Switch __dquot_alloc_space and __dquot_free_space to take flags to indicate whether to warn and/or to reserve (or free reserve). This is slightly more readable at the callpoints, and makes it cleaner to add a "nofail" option in the next patch. Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
This commit is contained in:
parent
84061e07c5
commit
56246f9ae4
2 changed files with 19 additions and 14 deletions
|
|
@ -1488,11 +1488,12 @@ static void inode_decr_space(struct inode *inode, qsize_t number, int reserve)
|
|||
/*
|
||||
* This operation can block, but only after everything is updated
|
||||
*/
|
||||
int __dquot_alloc_space(struct inode *inode, qsize_t number,
|
||||
int warn, int reserve)
|
||||
int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
|
||||
{
|
||||
int cnt, ret = 0;
|
||||
char warntype[MAXQUOTAS];
|
||||
int warn = flags & DQUOT_SPACE_WARN;
|
||||
int reserve = flags & DQUOT_SPACE_RESERVE;
|
||||
|
||||
/*
|
||||
* First test before acquiring mutex - solves deadlocks when we
|
||||
|
|
@ -1612,10 +1613,11 @@ EXPORT_SYMBOL(dquot_claim_space_nodirty);
|
|||
/*
|
||||
* This operation can block, but only after everything is updated
|
||||
*/
|
||||
void __dquot_free_space(struct inode *inode, qsize_t number, int reserve)
|
||||
void __dquot_free_space(struct inode *inode, qsize_t number, int flags)
|
||||
{
|
||||
unsigned int cnt;
|
||||
char warntype[MAXQUOTAS];
|
||||
int reserve = flags & DQUOT_SPACE_RESERVE;
|
||||
|
||||
/* First test before acquiring mutex - solves deadlocks when we
|
||||
* re-enter the quota code and are already holding the mutex */
|
||||
|
|
|
|||
Loading…
Reference in a new issue