mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 23:52:40 +00:00
only regular files with FMODE_WRITE need to be on s_files
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
301f0268b6
commit
184cacabe2
1 changed files with 4 additions and 2 deletions
|
@ -385,6 +385,10 @@ static inline void __file_sb_list_add(struct file *file, struct super_block *sb)
|
||||||
*/
|
*/
|
||||||
void file_sb_list_add(struct file *file, struct super_block *sb)
|
void file_sb_list_add(struct file *file, struct super_block *sb)
|
||||||
{
|
{
|
||||||
|
if (likely(!(file->f_mode & FMODE_WRITE)))
|
||||||
|
return;
|
||||||
|
if (!S_ISREG(file_inode(file)->i_mode))
|
||||||
|
return;
|
||||||
lg_local_lock(&files_lglock);
|
lg_local_lock(&files_lglock);
|
||||||
__file_sb_list_add(file, sb);
|
__file_sb_list_add(file, sb);
|
||||||
lg_local_unlock(&files_lglock);
|
lg_local_unlock(&files_lglock);
|
||||||
|
@ -450,8 +454,6 @@ void mark_files_ro(struct super_block *sb)
|
||||||
|
|
||||||
lg_global_lock(&files_lglock);
|
lg_global_lock(&files_lglock);
|
||||||
do_file_list_for_each_entry(sb, f) {
|
do_file_list_for_each_entry(sb, f) {
|
||||||
if (!S_ISREG(file_inode(f)->i_mode))
|
|
||||||
continue;
|
|
||||||
if (!file_count(f))
|
if (!file_count(f))
|
||||||
continue;
|
continue;
|
||||||
if (!(f->f_mode & FMODE_WRITE))
|
if (!(f->f_mode & FMODE_WRITE))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue