From: Nathan Scott Date: Sun, 3 Aug 2003 23:46:38 +0000 (+0000) Subject: Tweak xfs_copy so that it works with non-XFS target filesystems also; minor. X-Git-Tag: v2.6.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3422261dc37e1e281a37e98648134d7b15ac0c38;p=thirdparty%2Fxfsprogs-dev.git Tweak xfs_copy so that it works with non-XFS target filesystems also; minor. --- diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 782552057..1e3937f5b 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -786,16 +786,20 @@ main(int argc, char **argv) progname); die_perror(); } - if (xfsctl(target[i].name, target[i].fd, + if (platform_test_xfs_fd(target[i].fd)) { + if (xfsctl(target[i].name, target[i].fd, XFS_IOC_DIOINFO, &d) < 0) { - do_log(_("%s: xfsctl on \"%s\" failed.\n"), - progname, target[i].name); - die_perror(); + do_log( + _("%s: xfsctl on \"%s\" failed.\n"), + progname, target[i].name); + die_perror(); + } else { + wbuf_align = MAX(wbuf_align, d.d_mem); + wbuf_size = MIN(d.d_maxiosz, wbuf_size); + wbuf_miniosize = MAX(d.d_miniosz, + wbuf_miniosize); + } } - wbuf_align = MAX(wbuf_align, d.d_mem); - wbuf_size = MIN(d.d_maxiosz, wbuf_size); - wbuf_miniosize = MAX(d.d_miniosz, wbuf_miniosize); - } else { char *lb[XFS_MAX_SECTORSIZE] = { 0 }; off64_t off;