diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-23 12:12:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-23 12:12:20 -0500 |
commit | 94e5165aa72826b05ffd492f334a1465187e255a (patch) | |
tree | 55397aeada3e91d99e13d4c9c34933521e9b40a1 /fs/stat.c | |
parent | f42ecb2808db5386f983d593a7c08d3ea3b94a27 (diff) | |
parent | 869835dfad3eb6f7d90c3255a24b084fea82f30d (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
quota: Improve checking of quota file header
jbd: jbd-debug and jbd2-debug should be writable
ext4: fix sleep inside spinlock issue with quota and dealloc (#14739)
ext4: Fix potential quota deadlock
quota: Fix 64-bit limits setting on 32-bit archs
ext3: Replace lock/unlock_super() with an explicit lock for resizing
ext3: Replace lock/unlock_super() with an explicit lock for the orphan list
ext3: ext3_mark_recovery_complete() doesn't need to use lock_super
ext3: Remove outdated comment about lock_super()
quota: Move duplicated code to separate functions
ext4: Convert to generic reserved quota's space management.
quota: decouple fs reserved space from quota reservation
Add unlocked version of inode_add_bytes() function
ext3: quota macros cleanup [V2]
Diffstat (limited to 'fs/stat.c')
-rw-r--r-- | fs/stat.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -401,9 +401,9 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, | |||
401 | } | 401 | } |
402 | #endif /* __ARCH_WANT_STAT64 */ | 402 | #endif /* __ARCH_WANT_STAT64 */ |
403 | 403 | ||
404 | void inode_add_bytes(struct inode *inode, loff_t bytes) | 404 | /* Caller is here responsible for sufficient locking (ie. inode->i_lock) */ |
405 | void __inode_add_bytes(struct inode *inode, loff_t bytes) | ||
405 | { | 406 | { |
406 | spin_lock(&inode->i_lock); | ||
407 | inode->i_blocks += bytes >> 9; | 407 | inode->i_blocks += bytes >> 9; |
408 | bytes &= 511; | 408 | bytes &= 511; |
409 | inode->i_bytes += bytes; | 409 | inode->i_bytes += bytes; |
@@ -411,6 +411,12 @@ void inode_add_bytes(struct inode *inode, loff_t bytes) | |||
411 | inode->i_blocks++; | 411 | inode->i_blocks++; |
412 | inode->i_bytes -= 512; | 412 | inode->i_bytes -= 512; |
413 | } | 413 | } |
414 | } | ||
415 | |||
416 | void inode_add_bytes(struct inode *inode, loff_t bytes) | ||
417 | { | ||
418 | spin_lock(&inode->i_lock); | ||
419 | __inode_add_bytes(inode, bytes); | ||
414 | spin_unlock(&inode->i_lock); | 420 | spin_unlock(&inode->i_lock); |
415 | } | 421 | } |
416 | 422 | ||