btrfs: make btrfs_inode_block_unlocked_dio take btrfs_inode
authorNikolay Borisov <nborisov@suse.com>
Mon, 20 Feb 2017 11:51:10 +0000 (13:51 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 28 Feb 2017 10:30:12 +0000 (11:30 +0100)
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/inode.c

index c10d21b2f0df6f8722ddb198835568c41b62cc3a..d84cf2b0c7b6bc9aeac0b3cf1ea2125226742506 100644 (file)
@@ -311,9 +311,9 @@ struct btrfs_dio_private {
  * to grab i_mutex. It is used to avoid the endless truncate due to
  * nonlocked dio read.
  */
-static inline void btrfs_inode_block_unlocked_dio(struct inode *inode)
+static inline void btrfs_inode_block_unlocked_dio(struct btrfs_inode *inode)
 {
-       set_bit(BTRFS_INODE_READDIO_NEED_LOCK, &BTRFS_I(inode)->runtime_flags);
+       set_bit(BTRFS_INODE_READDIO_NEED_LOCK, &inode->runtime_flags);
        smp_mb();
 }
 
index dafd3fdd6f2bde5624132a11e0181de5310716a8..59b93a2369aa697d00cc0534b7e32b150d8fa12c 100644 (file)
@@ -5002,7 +5002,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
                truncate_setsize(inode, newsize);
 
                /* Disable nonlocked read DIO to avoid the end less truncate */
-               btrfs_inode_block_unlocked_dio(inode);
+               btrfs_inode_block_unlocked_dio(BTRFS_I(inode));
                inode_dio_wait(inode);
                btrfs_inode_resume_unlocked_dio(inode);