mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Add unlocked version of inode_add_bytes() function
Quota code requires unlocked version of this function. Off course we can just copy-paste the code, but copy-pasting is always an evil. Signed-off-by: Dmitry Monakhov <[email protected]> Signed-off-by: Jan Kara <[email protected]>
This commit is contained in:
parent
c459001fa4
commit
b462707e7c
2 changed files with 9 additions and 2 deletions
10
fs/stat.c
10
fs/stat.c
|
|
@ -401,9 +401,9 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename,
|
|||
}
|
||||
#endif /* __ARCH_WANT_STAT64 */
|
||||
|
||||
void inode_add_bytes(struct inode *inode, loff_t bytes)
|
||||
/* Caller is here responsible for sufficient locking (ie. inode->i_lock) */
|
||||
void __inode_add_bytes(struct inode *inode, loff_t bytes)
|
||||
{
|
||||
spin_lock(&inode->i_lock);
|
||||
inode->i_blocks += bytes >> 9;
|
||||
bytes &= 511;
|
||||
inode->i_bytes += bytes;
|
||||
|
|
@ -411,6 +411,12 @@ void inode_add_bytes(struct inode *inode, loff_t bytes)
|
|||
inode->i_blocks++;
|
||||
inode->i_bytes -= 512;
|
||||
}
|
||||
}
|
||||
|
||||
void inode_add_bytes(struct inode *inode, loff_t bytes)
|
||||
{
|
||||
spin_lock(&inode->i_lock);
|
||||
__inode_add_bytes(inode, bytes);
|
||||
spin_unlock(&inode->i_lock);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue