]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/file_table.c
arm: dts: tx6: add some aliases and a label for backlight@0
[karo-tx-linux.git] / fs / file_table.c
index b44e4c5597862c2e16630aa7632823be4c7de17d..abdd15ad13c9c52bf672465787e3811c06ef7224 100644 (file)
@@ -311,8 +311,7 @@ void fput(struct file *file)
                                return;
                        /*
                         * After this task has run exit_task_work(),
-                        * task_work_add() will fail.  free_ipc_ns()->
-                        * shm_destroy() can do this.  Fall through to delayed
+                        * task_work_add() will fail.  Fall through to delayed
                         * fput to avoid leaking *file.
                         */
                }
@@ -385,6 +384,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)
 {
+       if (likely(!(file->f_mode & FMODE_WRITE)))
+               return;
+       if (!S_ISREG(file_inode(file)->i_mode))
+               return;
        lg_local_lock(&files_lglock);
        __file_sb_list_add(file, sb);
        lg_local_unlock(&files_lglock);
@@ -450,8 +453,6 @@ void mark_files_ro(struct super_block *sb)
 
        lg_global_lock(&files_lglock);
        do_file_list_for_each_entry(sb, f) {
-               if (!S_ISREG(file_inode(f)->i_mode))
-                      continue;
                if (!file_count(f))
                        continue;
                if (!(f->f_mode & FMODE_WRITE))