mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
QA source updates and some associated test changes
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# XFS QA Test No. 034
|
# XFS QA Test No. 034
|
||||||
# $Id: 1.1 $
|
# $Id: 1.1 $
|
||||||
#
|
#
|
||||||
# pv 801241 - check for reference leaks from the *handle ioctls
|
# pv 801241 - check for reference leaks from the *handle xfsctls
|
||||||
#
|
#
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
|
# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
@@ -82,9 +82,9 @@ then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! src/ioctl $SCRATCH_MNT $SCRATCH_MNT/fish >/dev/null 2>&1
|
if ! src/xfsctl $SCRATCH_MNT $SCRATCH_MNT/fish >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo "!!! failed to run ioctl test program"
|
echo "!!! failed to run xfsctl test program"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# XFS QA Test No. 048
|
# XFS QA Test No. 048
|
||||||
# $Id: 1.1 $
|
# $Id: 1.1 $
|
||||||
#
|
#
|
||||||
# test return codes from ioctl on bad userspace address
|
# test return codes from xfsctl on bad userspace address
|
||||||
#
|
#
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
QA output created by 048
|
QA output created by 048
|
||||||
--- ioctl with bad output address
|
--- xfsctl with bad output address
|
||||||
--- got error 14 as expected
|
--- got error 14 as expected
|
||||||
--- ioctl with bad input address
|
--- xfsctl with bad input address
|
||||||
--- got error 14 as expected
|
--- got error 14 as expected
|
||||||
|
|||||||
+31
-24
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -78,8 +78,9 @@ void usage(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int fd;
|
int fd = -1;
|
||||||
int blocksize = 0;
|
int blocksize;
|
||||||
|
char *filename;
|
||||||
|
|
||||||
/* params are in bytes */
|
/* params are in bytes */
|
||||||
void map(off64_t off, off64_t len)
|
void map(off64_t off, off64_t len)
|
||||||
@@ -103,7 +104,7 @@ void map(off64_t off, off64_t len)
|
|||||||
|
|
||||||
printf(" [ofs,count]: start..end\n");
|
printf(" [ofs,count]: start..end\n");
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (ioctl(fd, XFS_IOC_GETBMAP, bm) < 0) {
|
if (xfsctl(filename, fd, XFS_IOC_GETBMAP, bm) < 0) {
|
||||||
perror("getbmap");
|
perror("getbmap");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -129,8 +130,8 @@ main(int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
char *dirname = NULL;
|
char *dirname = NULL;
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
int status = 0;
|
||||||
struct flock64 f;
|
struct flock64 f;
|
||||||
char *filename = NULL;
|
|
||||||
off64_t len;
|
off64_t len;
|
||||||
char line[1024];
|
char line[1024];
|
||||||
off64_t off;
|
off64_t off;
|
||||||
@@ -201,31 +202,33 @@ main(int argc, char **argv)
|
|||||||
perror(filename);
|
perror(filename);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (unlinkit)
|
|
||||||
unlink(filename);
|
|
||||||
if (!blocksize) {
|
if (!blocksize) {
|
||||||
if (fstatvfs64(fd, &svfs) < 0) {
|
if (fstatvfs64(fd, &svfs) < 0) {
|
||||||
perror(filename);
|
perror(filename);
|
||||||
exit(1);
|
status = 1;
|
||||||
}
|
goto done;
|
||||||
|
}
|
||||||
blocksize = (int)svfs.f_bsize;
|
blocksize = (int)svfs.f_bsize;
|
||||||
}
|
}
|
||||||
if (blocksize<0) {
|
if (blocksize<0) {
|
||||||
fprintf(stderr,"illegal blocksize %d\n", blocksize);
|
fprintf(stderr,"illegal blocksize %d\n", blocksize);
|
||||||
exit(1);
|
status = 1;
|
||||||
}
|
goto done;
|
||||||
|
}
|
||||||
printf(" blocksize %d\n", blocksize);
|
printf(" blocksize %d\n", blocksize);
|
||||||
if (rflag) {
|
if (rflag) {
|
||||||
struct fsxattr a;
|
struct fsxattr a;
|
||||||
|
|
||||||
if (ioctl(fd, XFS_IOC_FSGETXATTR, &a) < 0) {
|
if (xfsctl(filename, fd, XFS_IOC_FSGETXATTR, &a) < 0) {
|
||||||
perror("XFS_IOC_FSGETXATTR");
|
perror("XFS_IOC_FSGETXATTR");
|
||||||
exit(1);
|
status = 1;
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
a.fsx_xflags |= XFS_XFLAG_REALTIME;
|
a.fsx_xflags |= XFS_XFLAG_REALTIME;
|
||||||
if (ioctl(fd, XFS_IOC_FSSETXATTR, &a) < 0) {
|
if (xfsctl(filename, fd, XFS_IOC_FSSETXATTR, &a) < 0) {
|
||||||
perror("XFS_IOC_FSSETXATTR");
|
perror("XFS_IOC_FSSETXATTR");
|
||||||
exit(1);
|
status = 1;
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (!done) {
|
while (!done) {
|
||||||
@@ -269,7 +272,7 @@ main(int argc, char **argv)
|
|||||||
opnames[opno], (__s64)off, (__s64)len);
|
opnames[opno], (__s64)off, (__s64)len);
|
||||||
|
|
||||||
f.l_len = len;
|
f.l_len = len;
|
||||||
c = ioctl(fd, optab[opno], &f);
|
c = xfsctl(filename, fd, optab[opno], &f);
|
||||||
if (c < 0) {
|
if (c < 0) {
|
||||||
perror(opnames[opno]);
|
perror(opnames[opno]);
|
||||||
break;
|
break;
|
||||||
@@ -327,8 +330,12 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!nflag) printf("\n");
|
if (!nflag) printf("\n");
|
||||||
close(fd);
|
done:
|
||||||
exit(0);
|
if (fd != -1)
|
||||||
|
close(fd);
|
||||||
|
if (unlinkit)
|
||||||
|
unlink(filename);
|
||||||
|
exit(status);
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-7
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -30,10 +30,8 @@
|
|||||||
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libxfs.h>
|
#include <xfs/libxfs.h>
|
||||||
#include <jdm.h>
|
#include <xfs/jdm.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
|
|
||||||
void
|
void
|
||||||
dotime(void *ti, char *s)
|
dotime(void *ti, char *s)
|
||||||
@@ -171,7 +169,7 @@ main(int argc, char **argv)
|
|||||||
bulkreq.ubuffer = t;
|
bulkreq.ubuffer = t;
|
||||||
bulkreq.ocount = &count;
|
bulkreq.ocount = &count;
|
||||||
|
|
||||||
while ((ret = ioctl(fsfd, XFS_IOC_FSBULKSTAT, &bulkreq)) == 0) {
|
while ((ret = xfsctl(name, fsfd, XFS_IOC_FSBULKSTAT, &bulkreq)) == 0) {
|
||||||
total += count;
|
total += count;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
@@ -269,7 +267,7 @@ main(int argc, char **argv)
|
|||||||
close(fsfd);
|
close(fsfd);
|
||||||
|
|
||||||
if (ret < 0 )
|
if (ret < 0 )
|
||||||
perror("ioctl(XFS_IOC_FSBULKSTAT)");
|
perror("xfsctl(XFS_IOC_FSBULKSTAT)");
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf(
|
printf(
|
||||||
|
|||||||
+2
-3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -30,8 +30,7 @@
|
|||||||
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libxfs.h>
|
#include <xfs/libxfs.h>
|
||||||
#include <malloc.h>
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
|
|||||||
+6
-7
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -30,8 +30,7 @@
|
|||||||
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libxfs.h>
|
#include <xfs/libxfs.h>
|
||||||
#include <sys/ioctl.h>
|
|
||||||
|
|
||||||
void expect_error(int r, int err)
|
void expect_error(int r, int err)
|
||||||
{
|
{
|
||||||
@@ -63,10 +62,10 @@ main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("--- ioctl with bad output address\n");
|
printf("--- xfsctl with bad output address\n");
|
||||||
expect_error(ioctl(fsfd, XFS_IOC_FSCOUNTS, NULL), EFAULT);
|
expect_error(xfsctl(argv[1], fsfd, XFS_IOC_FSCOUNTS, NULL), EFAULT);
|
||||||
printf("--- ioctl with bad input address\n");
|
printf("--- xfsctl with bad input address\n");
|
||||||
expect_error(ioctl(fsfd, XFS_IOC_SET_RESBLKS, NULL), EFAULT);
|
expect_error(xfsctl(argv[1], fsfd, XFS_IOC_SET_RESBLKS, NULL), EFAULT);
|
||||||
|
|
||||||
close(fsfd);
|
close(fsfd);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -42,11 +42,11 @@
|
|||||||
* Return code: 0 is true, anything else is error/not supported
|
* Return code: 0 is true, anything else is error/not supported
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libxfs.h>
|
#include <xfs/libxfs.h>
|
||||||
#include <sys/quota.h>
|
#include <sys/quota.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <xqm.h>
|
#include <xfs/xqm.h>
|
||||||
|
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
|
|
||||||
|
|||||||
+2
-18
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -42,25 +42,9 @@
|
|||||||
* and is more careful about checking when write operations fail - this is
|
* and is more careful about checking when write operations fail - this is
|
||||||
* needed by fill2fs to ensure that the number of bytes written is accurately
|
* needed by fill2fs to ensure that the number of bytes written is accurately
|
||||||
* determined.
|
* determined.
|
||||||
*
|
|
||||||
* To compile standalone on IRIX: cc -DTOOL_ONLY -o fill2 fill2.c -lgen
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <xfs/libxfs.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <libgen.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#ifndef TOOL_ONLY
|
|
||||||
#include <platform_defs.h>
|
|
||||||
#else
|
|
||||||
#define constpp char * const *
|
|
||||||
#endif /* TOOL_ONLY */
|
|
||||||
|
|
||||||
#define N(x) (sizeof(x)/sizeof(x[0]))
|
#define N(x) (sizeof(x)/sizeof(x[0]))
|
||||||
|
|
||||||
|
|||||||
+3
-6
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -35,17 +35,14 @@
|
|||||||
|
|
||||||
/* xfs-specific includes */
|
/* xfs-specific includes */
|
||||||
|
|
||||||
#include <libxfs.h>
|
#include <xfs/libxfs.h>
|
||||||
#include <attributes.h>
|
#include <attr/attributes.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <malloc.h>
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+4
-5
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -39,10 +39,9 @@
|
|||||||
* - dxm 29/09/00
|
* - dxm 29/09/00
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libxfs.h>
|
#include <xfs/libxfs.h>
|
||||||
#include <malloc.h>
|
#include <xfs/xfs_log.h>
|
||||||
#include <xfs_log.h>
|
#include <xfs/xfs_log_priv.h>
|
||||||
#include <xfs_log_priv.h>
|
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage()
|
||||||
|
|||||||
+3
-2
@@ -1,10 +1,11 @@
|
|||||||
/* mmapcat.c - derived from source by misiek@pld.ORG.PL */
|
/* mmapcat.c - derived from source by misiek@pld.ORG.PL */
|
||||||
|
|
||||||
#include<fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
+12
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
|
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of version 2 of the GNU General Public License as
|
* under the terms of version 2 of the GNU General Public License as
|
||||||
@@ -56,7 +56,7 @@ struct fsxattr rtattr;
|
|||||||
|
|
||||||
void usage(char *progname);
|
void usage(char *progname);
|
||||||
int findblock(void);
|
int findblock(void);
|
||||||
void writeblks(int fd);
|
void writeblks(char *fname, int fd);
|
||||||
int readblks(int fd);
|
int readblks(int fd);
|
||||||
void dumpblock(int *buffer, __uint64_t offset, int blocksize);
|
void dumpblock(int *buffer, __uint64_t offset, int blocksize);
|
||||||
|
|
||||||
@@ -154,8 +154,8 @@ main(int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (rt) {
|
if (rt) {
|
||||||
if (ioctl(fd, XFS_IOC_FSGETXATTR, &rtattr) < 0) {
|
if (xfsctl(filename, fd, XFS_IOC_FSGETXATTR, &rtattr) < 0) {
|
||||||
perror("ioctl(XFS_IOC_FSGETXATTR)");
|
perror("xfsctl(XFS_IOC_FSGETXATTR)");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if ((rtattr.fsx_xflags & XFS_XFLAG_REALTIME) == 0 ||
|
if ((rtattr.fsx_xflags & XFS_XFLAG_REALTIME) == 0 ||
|
||||||
@@ -163,15 +163,15 @@ main(int argc, char *argv[])
|
|||||||
rtattr.fsx_xflags |= XFS_XFLAG_REALTIME;
|
rtattr.fsx_xflags |= XFS_XFLAG_REALTIME;
|
||||||
if (extsize)
|
if (extsize)
|
||||||
rtattr.fsx_extsize = extsize * blocksize;
|
rtattr.fsx_extsize = extsize * blocksize;
|
||||||
if (ioctl(fd, XFS_IOC_FSSETXATTR, &rtattr) < 0) {
|
if (xfsctl(filename, fd, XFS_IOC_FSSETXATTR, &rtattr) < 0) {
|
||||||
perror("ioctl(XFS_IOC_FSSETXATTR)");
|
perror("xfsctl(XFS_IOC_FSSETXATTR)");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (direct) {
|
if (direct) {
|
||||||
if (ioctl(fd, XFS_IOC_DIOINFO, &diob) < 0) {
|
if (xfsctl(filename, fd, XFS_IOC_DIOINFO, &diob) < 0) {
|
||||||
perror("ioctl(XFS_IOC_FIOINFO)");
|
perror("xfsctl(XFS_IOC_FIOINFO)");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (blocksize % diob.d_miniosz) {
|
if (blocksize % diob.d_miniosz) {
|
||||||
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf(test?"write (skipped)\n":"write\n");
|
printf(test?"write (skipped)\n":"write\n");
|
||||||
writeblks(fd);
|
writeblks(filename, fd);
|
||||||
printf("readback\n");
|
printf("readback\n");
|
||||||
r=readblks(fd);
|
r=readblks(fd);
|
||||||
if (close(fd) < 0) {
|
if (close(fd) < 0) {
|
||||||
@@ -199,7 +199,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
writeblks(int fd)
|
writeblks(char *fname, int fd)
|
||||||
{
|
{
|
||||||
__uint64_t offset;
|
__uint64_t offset;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
@@ -229,8 +229,8 @@ writeblks(int fd)
|
|||||||
fl.l_start = offset;
|
fl.l_start = offset;
|
||||||
fl.l_len = blocksize;
|
fl.l_len = blocksize;
|
||||||
fl.l_whence = 0;
|
fl.l_whence = 0;
|
||||||
if (ioctl(fd, XFS_IOC_RESVSP64, &fl) < 0) {
|
if (xfsctl(fname, fd, XFS_IOC_RESVSP64, &fl) < 0) {
|
||||||
perror("ioctl(XFS_IOC_RESVSP64)");
|
perror("xfsctl(XFS_IOC_RESVSP64)");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user