mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
vfs: wrap write f_ops with file_{start,end}_write()
Before calling write f_ops, call file_start_write() instead
of sb_start_write().
Replace {sb,file}_start_write() for {copy,clone}_file_range() and
for fallocate().
Beyond correct semantics, this avoids freeze protection to sb when
operating on special inodes, such as fallocate() on a blockdev.
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Amir Goldstein <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
This commit is contained in:
parent
11cbfb1077
commit
bfe219d373
3 changed files with 17 additions and 17 deletions
|
|
@ -314,7 +314,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
|
|||
if (!file->f_op->fallocate)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
sb_start_write(inode->i_sb);
|
||||
file_start_write(file);
|
||||
ret = file->f_op->fallocate(file, mode, offset, len);
|
||||
|
||||
/*
|
||||
|
|
@ -327,7 +327,7 @@ int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
|
|||
if (ret == 0)
|
||||
fsnotify_modify(file);
|
||||
|
||||
sb_end_write(inode->i_sb);
|
||||
file_end_write(file);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vfs_fallocate);
|
||||
|
|
|
|||
Loading…
Reference in a new issue