]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
btrfs: btrfs_inherit_iflags() can be static
authorAnand Jain <Anand.Jain@oracle.com>
Tue, 18 Jul 2017 09:37:05 +0000 (17:37 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Aug 2017 14:12:02 +0000 (16:12 +0200)
btrfs_new_inode() is the only consumer move it to inode.c,
from ioctl.c.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c

index 06033b5f16576e7a40801b88aacf7c1e25b5d7fb..6510f246f71e5826ab16b881daee7db4ab91d9a3 100644 (file)
@@ -3230,7 +3230,6 @@ long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 int btrfs_ioctl_get_supported_features(void __user *arg);
 void btrfs_update_iflags(struct inode *inode);
-void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);
 int btrfs_is_empty_uuid(u8 *uuid);
 int btrfs_defrag_file(struct inode *inode, struct file *file,
                      struct btrfs_ioctl_defrag_range_args *range,
index 3bf7bae36e56b900e445a7b58d8f98eacec459fe..3926e9cbf0d919485a7242d43c20a78d891fba18 100644 (file)
@@ -6183,6 +6183,37 @@ static int btrfs_insert_inode_locked(struct inode *inode)
                   btrfs_find_actor, &args);
 }
 
+/*
+ * Inherit flags from the parent inode.
+ *
+ * Currently only the compression flags and the cow flags are inherited.
+ */
+static void btrfs_inherit_iflags(struct inode *inode, struct inode *dir)
+{
+       unsigned int flags;
+
+       if (!dir)
+               return;
+
+       flags = BTRFS_I(dir)->flags;
+
+       if (flags & BTRFS_INODE_NOCOMPRESS) {
+               BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS;
+               BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS;
+       } else if (flags & BTRFS_INODE_COMPRESS) {
+               BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS;
+               BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS;
+       }
+
+       if (flags & BTRFS_INODE_NODATACOW) {
+               BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW;
+               if (S_ISREG(inode->i_mode))
+                       BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM;
+       }
+
+       btrfs_update_iflags(inode);
+}
+
 static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
                                     struct btrfs_root *root,
                                     struct inode *dir,
index fa1b78cf25f68083de3db86ead690a41563316ce..335e252a99f500f847387e7bf4b3eae49a24d241 100644 (file)
@@ -156,37 +156,6 @@ void btrfs_update_iflags(struct inode *inode)
                      new_fl);
 }
 
-/*
- * Inherit flags from the parent inode.
- *
- * Currently only the compression flags and the cow flags are inherited.
- */
-void btrfs_inherit_iflags(struct inode *inode, struct inode *dir)
-{
-       unsigned int flags;
-
-       if (!dir)
-               return;
-
-       flags = BTRFS_I(dir)->flags;
-
-       if (flags & BTRFS_INODE_NOCOMPRESS) {
-               BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS;
-               BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS;
-       } else if (flags & BTRFS_INODE_COMPRESS) {
-               BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS;
-               BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS;
-       }
-
-       if (flags & BTRFS_INODE_NODATACOW) {
-               BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW;
-               if (S_ISREG(inode->i_mode))
-                       BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM;
-       }
-
-       btrfs_update_iflags(inode);
-}
-
 static int btrfs_ioctl_getflags(struct file *file, void __user *arg)
 {
        struct btrfs_inode *ip = BTRFS_I(file_inode(file));