ceph: new mount option to disable usage of copy-from op
[sfrench/cifs-2.6.git] / fs / ceph / file.c
index 5557ec6760ea5dddfb8a62083d873c06fce21551..f788496fafcc9eeab5907cdcd7c68b16e0aecf8a 100644 (file)
@@ -1917,6 +1917,9 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off,
         * efficient).
         */
 
         * efficient).
         */
 
+       if (ceph_test_mount_opt(ceph_inode_to_client(src_inode), NOCOPYFROM))
+               return -EOPNOTSUPP;
+
        if ((src_ci->i_layout.stripe_unit != dst_ci->i_layout.stripe_unit) ||
            (src_ci->i_layout.stripe_count != dst_ci->i_layout.stripe_count) ||
            (src_ci->i_layout.object_size != dst_ci->i_layout.object_size))
        if ((src_ci->i_layout.stripe_unit != dst_ci->i_layout.stripe_unit) ||
            (src_ci->i_layout.stripe_count != dst_ci->i_layout.stripe_count) ||
            (src_ci->i_layout.object_size != dst_ci->i_layout.object_size))