diff options
author | Jan Kara <jack@suse.cz> | 2013-08-17 09:32:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-29 17:40:57 -0800 |
commit | 4e9eb2afbc494a56e35bf6c1a621f579eb1199b2 (patch) | |
tree | 413860f6240839d2ede37eefc43a8a3bc3e4a3af /fs/stat.c | |
parent | a659ea97f77630a07aa9d6a64d4d2b56e6949371 (diff) | |
download | lwn-4e9eb2afbc494a56e35bf6c1a621f579eb1199b2.tar.gz lwn-4e9eb2afbc494a56e35bf6c1a621f579eb1199b2.zip |
quota: provide interface for readding allocated space into reserved space
commit 1c8924eb106c1ac755d5d35ce9b3ff42e89e2511 upstream.
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 <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Josh Hunt <johunt@akamai.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/stat.c')
-rw-r--r-- | fs/stat.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/stat.c b/fs/stat.c index 04ce1ac20d20..d0ea7ef75e26 100644 --- a/fs/stat.c +++ b/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); } |