History

vfs: introduce file_modified() helper

The combination of file_remove_privs() and file_update_mtime() is quite common in filesystem ->write_iter() methods. Modelled after the helper file_accessed(), introduce file_modified() and use it from generic_remap_file_range_prep(). Note that the order of calling file_remove_privs() before file_update_mtime() in the helper was matched to the more common order by filesystems and not the current order in generic_remap_file_range_prep().

Amir Goldstein committed 7 years ago

Commit e38f7f51 parent 96e6e8f3 files · +25 −18Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/fs.h+2−0
@@ -2177,6 +2177,8 @@ static inline void file_accessed(struct file *file) · 2176 unmodified lines
2177 touch_atime(&file->f_path);2177 touch_atime(&file->f_path);
2178}2178}
2179 2179
2180extern int file_modified(struct file *file);
2181
2180int sync_inode(struct inode *inode, struct writeback_control *wbc);2182int sync_inode(struct inode *inode, struct writeback_control *wbc);
2181int sync_inode_metadata(struct inode *inode, int wait);2183int sync_inode_metadata(struct inode *inode, int wait);
2182 2184

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t