ceph: new mount option to disable usage of copy-from op
[sfrench/cifs-2.6.git] / fs / ceph / super.c
index eab1359d05532afb6960c7acfb5c4fee2891eac9..b5ecd6f50360d53e0fe24c4ea79416722e93fc6c 100644 (file)
@@ -165,6 +165,8 @@ enum {
        Opt_noacl,
        Opt_quotadf,
        Opt_noquotadf,
        Opt_noacl,
        Opt_quotadf,
        Opt_noquotadf,
+       Opt_copyfrom,
+       Opt_nocopyfrom,
 };
 
 static match_table_t fsopt_tokens = {
 };
 
 static match_table_t fsopt_tokens = {
@@ -203,6 +205,8 @@ static match_table_t fsopt_tokens = {
        {Opt_noacl, "noacl"},
        {Opt_quotadf, "quotadf"},
        {Opt_noquotadf, "noquotadf"},
        {Opt_noacl, "noacl"},
        {Opt_quotadf, "quotadf"},
        {Opt_noquotadf, "noquotadf"},
+       {Opt_copyfrom, "copyfrom"},
+       {Opt_nocopyfrom, "nocopyfrom"},
        {-1, NULL}
 };
 
        {-1, NULL}
 };
 
@@ -355,6 +359,12 @@ static int parse_fsopt_token(char *c, void *private)
        case Opt_noquotadf:
                fsopt->flags |= CEPH_MOUNT_OPT_NOQUOTADF;
                break;
        case Opt_noquotadf:
                fsopt->flags |= CEPH_MOUNT_OPT_NOQUOTADF;
                break;
+       case Opt_copyfrom:
+               fsopt->flags &= ~CEPH_MOUNT_OPT_NOCOPYFROM;
+               break;
+       case Opt_nocopyfrom:
+               fsopt->flags |= CEPH_MOUNT_OPT_NOCOPYFROM;
+               break;
 #ifdef CONFIG_CEPH_FS_POSIX_ACL
        case Opt_acl:
                fsopt->sb_flags |= SB_POSIXACL;
 #ifdef CONFIG_CEPH_FS_POSIX_ACL
        case Opt_acl:
                fsopt->sb_flags |= SB_POSIXACL;
@@ -553,6 +563,9 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
                seq_puts(m, ",noacl");
 #endif
 
                seq_puts(m, ",noacl");
 #endif
 
+       if (fsopt->flags & CEPH_MOUNT_OPT_NOCOPYFROM)
+               seq_puts(m, ",nocopyfrom");
+
        if (fsopt->mds_namespace)
                seq_show_option(m, "mds_namespace", fsopt->mds_namespace);
        if (fsopt->wsize != CEPH_MAX_WRITE_SIZE)
        if (fsopt->mds_namespace)
                seq_show_option(m, "mds_namespace", fsopt->mds_namespace);
        if (fsopt->wsize != CEPH_MAX_WRITE_SIZE)