Commit d1c37103 authored by Chao Yu's avatar Chao Yu Committed by Jan Kara

quota: convert dquot_claim_space_nodirty() to return void

dquot_claim_space_nodirty() always return zero, let's convert it
to return void, then, its caller can get rid of handling failure
case.
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20231210025028.3262900-1-chao@kernel.org>
parent a39b6ac3
...@@ -1787,7 +1787,7 @@ EXPORT_SYMBOL(dquot_alloc_inode); ...@@ -1787,7 +1787,7 @@ EXPORT_SYMBOL(dquot_alloc_inode);
/* /*
* Convert in-memory reserved quotas to real consumed quotas * Convert in-memory reserved quotas to real consumed quotas
*/ */
int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) void dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
{ {
struct dquot **dquots; struct dquot **dquots;
int cnt, index; int cnt, index;
...@@ -1797,7 +1797,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) ...@@ -1797,7 +1797,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
*inode_reserved_space(inode) -= number; *inode_reserved_space(inode) -= number;
__inode_add_bytes(inode, number); __inode_add_bytes(inode, number);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
return 0; return;
} }
dquots = i_dquot(inode); dquots = i_dquot(inode);
...@@ -1822,7 +1822,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) ...@@ -1822,7 +1822,7 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
mark_all_dquot_dirty(dquots); mark_all_dquot_dirty(dquots);
srcu_read_unlock(&dquot_srcu, index); srcu_read_unlock(&dquot_srcu, index);
return 0; return;
} }
EXPORT_SYMBOL(dquot_claim_space_nodirty); EXPORT_SYMBOL(dquot_claim_space_nodirty);
......
...@@ -74,7 +74,7 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags); ...@@ -74,7 +74,7 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags);
int dquot_alloc_inode(struct inode *inode); int dquot_alloc_inode(struct inode *inode);
int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); void dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
void dquot_free_inode(struct inode *inode); void dquot_free_inode(struct inode *inode);
void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number); void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number);
...@@ -257,10 +257,9 @@ static inline void __dquot_free_space(struct inode *inode, qsize_t number, ...@@ -257,10 +257,9 @@ static inline void __dquot_free_space(struct inode *inode, qsize_t number,
inode_sub_bytes(inode, number); inode_sub_bytes(inode, number);
} }
static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) static inline void dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
{ {
inode_add_bytes(inode, number); inode_add_bytes(inode, number);
return 0;
} }
static inline int dquot_reclaim_space_nodirty(struct inode *inode, static inline int dquot_reclaim_space_nodirty(struct inode *inode,
...@@ -358,14 +357,10 @@ static inline int dquot_reserve_block(struct inode *inode, qsize_t nr) ...@@ -358,14 +357,10 @@ static inline int dquot_reserve_block(struct inode *inode, qsize_t nr)
DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE); DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE);
} }
static inline int dquot_claim_block(struct inode *inode, qsize_t nr) static inline void dquot_claim_block(struct inode *inode, qsize_t nr)
{ {
int ret; dquot_claim_space_nodirty(inode, nr << inode->i_blkbits);
ret = dquot_claim_space_nodirty(inode, nr << inode->i_blkbits);
if (!ret)
mark_inode_dirty_sync(inode); mark_inode_dirty_sync(inode);
return ret;
} }
static inline void dquot_reclaim_block(struct inode *inode, qsize_t nr) static inline void dquot_reclaim_block(struct inode *inode, qsize_t nr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment