]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - io/swapext.c
misc: convert xfrog_bulkstat functions to have v5 semantics
[thirdparty/xfsprogs-dev.git] / io / swapext.c
index 2b4918f85a35ce9790b96130cbeb4e04dc5893e6..1139cf2195f4102f696cc957ec0fd14ea6f059ec 100644 (file)
@@ -28,6 +28,7 @@ swapext_f(
        char                    **argv)
 {
        struct xfs_fd           fxfd = XFS_FD_INIT(file->fd);
+       struct xfs_bulkstat     bulkstat;
        int                     fd;
        int                     error;
        struct xfs_swapext      sx;
@@ -48,12 +49,18 @@ swapext_f(
                goto out;
        }
 
-       error = xfrog_bulkstat_single(&fxfd, stat.st_ino, &sx.sx_stat);
+       error = xfrog_bulkstat_single(&fxfd, stat.st_ino, 0, &bulkstat);
        if (error) {
                errno = error;
                perror("bulkstat");
                goto out;
        }
+       error = xfrog_bulkstat_v5_to_v1(&fxfd, &sx.sx_stat, &bulkstat);
+       if (error) {
+               errno = error;
+               perror("bulkstat conversion");
+               goto out;
+       }
        sx.sx_version = XFS_SX_VERSION;
        sx.sx_fdtarget = file->fd;
        sx.sx_fdtmp = fd;