Btrfs: fix FS_IOC_GETFLAGS ioctl
authorLi Zefan <lizf@cn.fujitsu.com>
Fri, 15 Apr 2011 03:03:06 +0000 (03:03 +0000)
committerChris Mason <chris.mason@oracle.com>
Sat, 14 May 2011 20:10:27 +0000 (16:10 -0400)
As we've added per file compression/cow support.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c

index 3240dd90da42899675d4378a6bd22e9589917811..aeabf6b6ccc8122f6831601698277bc02231cedf 100644 (file)
@@ -81,6 +81,13 @@ static unsigned int btrfs_flags_to_ioctl(unsigned int flags)
                iflags |= FS_NOATIME_FL;
        if (flags & BTRFS_INODE_DIRSYNC)
                iflags |= FS_DIRSYNC_FL;
+       if (flags & BTRFS_INODE_NODATACOW)
+               iflags |= FS_NOCOW_FL;
+
+       if ((flags & BTRFS_INODE_COMPRESS) && !(flags & BTRFS_INODE_NOCOMPRESS))
+               iflags |= FS_COMPR_FL;
+       else if (flags & BTRFS_INODE_NOCOMPRESS)
+               iflags |= FS_NOCOMP_FL;
 
        return iflags;
 }