mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
quota: provide interface for readding allocated space into reserved space
ext4 needs to convert allocated (metadata) blocks back into blocks reserved for delayed allocation. Add functions into quota code for supporting such operation. Signed-off-by: Jan Kara <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
This commit is contained in:
parent
19883bd965
commit
1c8924eb10
4 changed files with 71 additions and 2 deletions
11
fs/stat.c
11
fs/stat.c
|
|
@ -447,9 +447,8 @@ void inode_add_bytes(struct inode *inode, loff_t bytes)
|
|||
|
||||
EXPORT_SYMBOL(inode_add_bytes);
|
||||
|
||||
void inode_sub_bytes(struct inode *inode, loff_t bytes)
|
||||
void __inode_sub_bytes(struct inode *inode, loff_t bytes)
|
||||
{
|
||||
spin_lock(&inode->i_lock);
|
||||
inode->i_blocks -= bytes >> 9;
|
||||
bytes &= 511;
|
||||
if (inode->i_bytes < bytes) {
|
||||
|
|
@ -457,6 +456,14 @@ void inode_sub_bytes(struct inode *inode, loff_t bytes)
|
|||
inode->i_bytes += 512;
|
||||
}
|
||||
inode->i_bytes -= bytes;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(__inode_sub_bytes);
|
||||
|
||||
void inode_sub_bytes(struct inode *inode, loff_t bytes)
|
||||
{
|
||||
spin_lock(&inode->i_lock);
|
||||
__inode_sub_bytes(inode, bytes);
|
||||
spin_unlock(&inode->i_lock);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue