]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NFSv4.2: remove restriction of copy size for inter-server copy.
authorDai Ngo <dai.ngo@oracle.com>
Fri, 21 May 2021 19:09:38 +0000 (15:09 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 25 May 2021 21:06:51 +0000 (17:06 -0400)
Currently inter-server copy is allowed only if the copy size is larger
than (rsize*14) which is the over-head of the mount operation of the
source export. This patch, relying on the delayed unmount feature,
removes this restriction since the mount and unmount overhead is now
not applicable for every inter-server copy.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfs/nfs4file.c

index 57b3821d975a35962e6eabafc27e9e461fe02b2b..702dba86487aebd58422c636b8ca85ce173233f0 100644 (file)
@@ -158,13 +158,11 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
                sync = true;
 retry:
        if (!nfs42_files_from_same_server(file_in, file_out)) {
-               /* for inter copy, if copy size if smaller than 12 RPC
-                * payloads, fallback to traditional copy. There are
-                * 14 RPCs during an NFSv4.x mount between source/dest
-                * servers.
+               /*
+                * for inter copy, if copy size is too small
+                * then fallback to generic copy.
                 */
-               if (sync ||
-                       count <= 14 * NFS_SERVER(file_inode(file_in))->rsize)
+               if (sync)
                        return -EOPNOTSUPP;
                cn_resp = kzalloc(sizeof(struct nfs42_copy_notify_res),
                                GFP_NOFS);