]> www.infradead.org Git - users/hch/block.git/commitdiff
fs: remove the kill_dirty argument invalidate_inodes
authorChristoph Hellwig <hch@lst.de>
Mon, 31 May 2021 12:16:51 +0000 (15:16 +0300)
committerChristoph Hellwig <hch@lst.de>
Mon, 31 May 2021 12:16:51 +0000 (15:16 +0300)
It is always true.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/block_dev.c
fs/inode.c
fs/internal.h

index 2a9826a2680b504f458f49fabd6735abf5126134..61d280020aa08009bbaa6107de372cc8c9192895 100644 (file)
@@ -1902,7 +1902,7 @@ int __invalidate_device(struct block_device *bdev)
                 * hold).
                 */
                shrink_dcache_sb(sb);
-               res = invalidate_inodes(sb, true);
+               res = invalidate_inodes(sb);
                drop_super(sb);
        }
        invalidate_bdev(bdev);
index c93500d84264d0ca5ddd2463b703cdb6509ba0a4..e5ab6edb08da9a2a1824b0cb54a60202a6c153ad 100644 (file)
@@ -671,14 +671,11 @@ EXPORT_SYMBOL_GPL(evict_inodes);
 /**
  * invalidate_inodes   - attempt to free all inodes on a superblock
  * @sb:                superblock to operate on
- * @kill_dirty: flag to guide handling of dirty inodes
  *
- * Attempts to free all inodes for a given superblock.  If there were any
- * busy inodes return a non-zero value, else zero.
- * If @kill_dirty is set, discard dirty inodes too, otherwise treat
- * them as busy.
+ * Attempt to free all inodes (including dirty inodes) for a given superblock.
+ * If there were any busy inodes return a non-zero value, else zero.
  */
-int invalidate_inodes(struct super_block *sb, bool kill_dirty)
+int invalidate_inodes(struct super_block *sb)
 {
        int busy = 0;
        struct inode *inode, *next;
@@ -692,11 +689,6 @@ again:
                        spin_unlock(&inode->i_lock);
                        continue;
                }
-               if (inode->i_state & I_DIRTY_ALL && !kill_dirty) {
-                       spin_unlock(&inode->i_lock);
-                       busy = 1;
-                       continue;
-               }
                if (atomic_read(&inode->i_count)) {
                        spin_unlock(&inode->i_lock);
                        busy = 1;
index 6aeae7ef33803daa83572198d0f4d2de022a6477..0047d70eae6bc9d95d8da7782d013b0926244b14 100644 (file)
@@ -148,12 +148,12 @@ extern int vfs_open(const struct path *, struct file *);
 extern long prune_icache_sb(struct super_block *sb, struct shrink_control *sc);
 extern void inode_add_lru(struct inode *inode);
 extern int dentry_needs_remove_privs(struct dentry *dentry);
+int invalidate_inodes(struct super_block *sb);
 
 /*
  * fs-writeback.c
  */
 extern long get_nr_dirty_inodes(void);
-extern int invalidate_inodes(struct super_block *, bool);
 
 /*
  * dcache.c