Modify log/v2-log qa tests to run on IRIX as well as Linux.

Cater for IRIX without unmount record at start of log and for
IRIX' hopeless mount option handling.
This commit is contained in:
Tim Shimmin
2004-06-21 04:53:35 +00:00
parent 81f3c307df
commit e00912e469
19 changed files with 10631 additions and 101 deletions
+20 -11
View File
@@ -67,29 +67,38 @@ _supported_os IRIX Linux
rm -f $seq.full $tmp.*
_require_scratch
# link correct .out file
_link_out_file $seq.op
echo "*** init FS"
umount $SCRATCH_DEV >/dev/null 2>&1
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt
-lversion=1 -ologbsize=32k
-lversion=2 -ologbsize=32k
-lversion=2 -ologbsize=64k
-lversion=2 -ologbsize=128k
-lversion=2 -ologbsize=256k
version=1 logbsize=32k
version=2 logbsize=32k
version=2 logbsize=64k
version=2 logbsize=128k
version=2 logbsize=256k
EOF
if [ "$HOSTOS" = "IRIX" ]; then
start_blk=0
else
start_blk=2
fi
# do the work for various log params which
# should not effect the data content of the log
cat $tmp.seq.params \
| while read mkfs mnt restofline
| while read mkfs mnt
do
if [ "$mkfs" = "#" ]; then
continue
fi
export MKFS_OPTIONS=$mkfs
export MOUNT_OPTIONS=$mnt
export MKFS_OPTIONS="-l $mkfs"
export MOUNT_OPTIONS="-o $mnt"
_mkfs_log
_create_log
_check_log
@@ -97,10 +106,10 @@ do
_print_operation
_cmp_op_output $seq.op $filtered
_print_transaction_inode 2
_print_transaction_inode $start_blk
_cmp_output $seq.trans_inode $filtered
_print_transaction_buf 2
_print_transaction_buf $start_blk
_cmp_output $seq.trans_buf $filtered
done
+5228
View File
File diff suppressed because it is too large Load Diff
View File
+11 -3
View File
@@ -70,13 +70,21 @@ _require_scratch
echo "*** init FS"
umount $SCRATCH_DEV >/dev/null 2>&1
# do a simple quota test to ensure DQUOT data is happening
export MKFS_OPTIONS="-lversion=1"
export MOUNT_OPTIONS="-ousrquota,grpquota"
export MKFS_OPTIONS="-l version=1"
export MOUNT_OPTIONS="-o quota,gquota"
if [ "$HOSTOS" = "IRIX" ]; then
start=0
else
start=2
fi
_mkfs_log
_create_log
_check_log
_print_transaction_inode 2
_print_transaction_inode $start
_cmp_output $seq.ugquota.trans_inode $filtered
# got thru it all so we may have success
+1 -1
View File
@@ -1,4 +1,4 @@
QA output created by 081
*** init FS
*** compare logprint: 081.ugquota.trans_inode with 081.fulldir/trans_inode.mnt-ousrquota,grpquota.mkfs-lversion=1.filtered
*** compare logprint: 081.ugquota.trans_inode with 081.fulldir/trans_inode.mnt-oquota,gquota.mkfs-lversion=1.filtered
*** unmount
+20 -8
View File
@@ -61,26 +61,32 @@ _cleanup()
trap "_cleanup; exit \$status" 0 1 2 3 15
# real QA test starts here
_supported_fs xfs
_supported_os IRIX Linux
# prelim
rm -f $seq.full $tmp.*
_require_scratch
# link correct .out file
_link_out_file $seq.op
echo "*** init FS"
umount $SCRATCH_DEV >/dev/null 2>&1
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt start-blk
-lversion=2 -ologbsize=32k 2
-lversion=2,su=4096 -ologbsize=32k 8
-lversion=2,su=32768 -ologbsize=32k 64
version=2 logbsize=32k 2
version=2,su=4096 logbsize=32k 8
version=2,su=32768 logbsize=32k 64
#
# expect following line to fail
#
-lversion=2,su=36864 -ologbsize=32k 72
version=2,su=36864 logbsize=32k 72
#
# following is not a power of 2 BBs
#
-lversion=2,su=5120 -ologbsize=32k 10
version=2,su=5120 logbsize=32k 10
EOF
# Do the work for various log params which
@@ -96,9 +102,15 @@ for s in sync nosync ; do
if [ "$mkfs" = "#" ]; then
continue
fi
echo "--- mkfs=$mkfs, mnt=$mnt, start=$start, sync=$s ---"
export MOUNT_OPTIONS=$mnt
export MKFS_OPTIONS=$mkfs
if [ "$HOSTOS" = "IRIX" ]; then
# don't have umount rec at start on IRIX
# so we won't have to skip over it and get to
# another stripe boundary
start=0
fi
echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
export MKFS_OPTIONS="-l $mkfs"
export MOUNT_OPTIONS="-o $mnt"
if ! _mkfs_log; then
continue
fi
+5228
View File
File diff suppressed because it is too large Load Diff
View File
+14 -14
View File
@@ -1,40 +1,40 @@
QA output created by 082
*** init FS
--- mkfs=-lversion=2, mnt=-ologbsize=32k, start=2, sync=sync ---
--- mkfs=version=2, mnt=logbsize=32k, sync=sync ---
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2.sync.filtered
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2.sync.filtered
--- mkfs=-lversion=2,su=4096, mnt=-ologbsize=32k, start=8, sync=sync ---
--- mkfs=version=2,su=4096, mnt=logbsize=32k, sync=sync ---
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.sync.filtered
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.sync.filtered
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=32k, start=64, sync=sync ---
--- mkfs=version=2,su=32768, mnt=logbsize=32k, sync=sync ---
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.sync.filtered
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.sync.filtered
--- mkfs=-lversion=2,su=36864, mnt=-ologbsize=32k, start=72, sync=sync ---
--- mkfs=version=2,su=36864, mnt=logbsize=32k, sync=sync ---
*** Cannot mkfs for this test using option specified: -lversion=2,su=36864 -l size=2000b ***
*** Cannot mkfs for this test using option specified: -l version=2,su=36864 -l size=2000b ***
--- mkfs=-lversion=2,su=5120, mnt=-ologbsize=32k, start=10, sync=sync ---
--- mkfs=version=2,su=5120, mnt=logbsize=32k, sync=sync ---
*** Cannot mkfs for this test using option specified: -lversion=2,su=5120 -l size=2000b ***
*** Cannot mkfs for this test using option specified: -l version=2,su=5120 -l size=2000b ***
--- mkfs=-lversion=2, mnt=-ologbsize=32k, start=2, sync=nosync ---
--- mkfs=version=2, mnt=logbsize=32k, sync=nosync ---
*** compare logprint: 082.op with 082.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=2.nosync.filtered
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2.nosync.filtered
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2.nosync.filtered
--- mkfs=-lversion=2,su=4096, mnt=-ologbsize=32k, start=8, sync=nosync ---
--- mkfs=version=2,su=4096, mnt=logbsize=32k, sync=nosync ---
*** compare logprint: 082.op with 082.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.nosync.filtered
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.nosync.filtered
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=4096.nosync.filtered
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=32k, start=64, sync=nosync ---
--- mkfs=version=2,su=32768, mnt=logbsize=32k, sync=nosync ---
*** compare logprint: 082.op with 082.fulldir/op.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.nosync.filtered
*** compare logprint: 082.trans_inode with 082.fulldir/trans_inode.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.nosync.filtered
*** compare logprint: 082.trans_buf with 082.fulldir/trans_buf.mnt-ologbsize=32k.mkfs-lversion=2,su=32768.nosync.filtered
--- mkfs=-lversion=2,su=36864, mnt=-ologbsize=32k, start=72, sync=nosync ---
--- mkfs=version=2,su=36864, mnt=logbsize=32k, sync=nosync ---
*** Cannot mkfs for this test using option specified: -lversion=2,su=36864 -l size=2000b ***
*** Cannot mkfs for this test using option specified: -l version=2,su=36864 -l size=2000b ***
--- mkfs=-lversion=2,su=5120, mnt=-ologbsize=32k, start=10, sync=nosync ---
--- mkfs=version=2,su=5120, mnt=logbsize=32k, sync=nosync ---
*** Cannot mkfs for this test using option specified: -lversion=2,su=5120 -l size=2000b ***
*** Cannot mkfs for this test using option specified: -l version=2,su=5120 -l size=2000b ***
*** unmount
+10 -9
View File
@@ -65,13 +65,14 @@ umount $SCRATCH_DEV >/dev/null 2>&1
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt
-lversion=2 -ologbsize=32k
-lversion=2,su=4096 -ologbsize=32k
-lversion=2,su=32768 -ologbsize=32k
-lversion=2,su=32768 -ologbsize=64k
-lversion=2 -ologbsize=64k
-lversion=2 -ologbsize=128k
-lversion=2 -ologbsize=256k
# ------------------------------
version=2 logbsize=32k
version=2,su=4096 logbsize=32k
version=2,su=32768 logbsize=32k
version=2,su=32768 logbsize=64k
version=2 logbsize=64k
version=2 logbsize=128k
version=2 logbsize=256k
EOF
# Do the work for various log params which
@@ -89,8 +90,8 @@ for s in sync nosync ; do
fi
echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
export MOUNT_OPTIONS=$mnt
export MKFS_OPTIONS=$mkfs
export MKFS_OPTIONS="-l $mkfs"
export MOUNT_OPTIONS="-o $mnt"
# mkfs the FS
_echofull "mkfs"
+14 -14
View File
@@ -1,6 +1,6 @@
QA output created by 086
*** init FS
--- mkfs=-lversion=2, mnt=-ologbsize=32k, sync=sync ---
--- mkfs=version=2, mnt=logbsize=32k, sync=sync ---
*** mkfs ***
@@ -236,7 +236,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=4096, mnt=-ologbsize=32k, sync=sync ---
--- mkfs=version=2,su=4096, mnt=logbsize=32k, sync=sync ---
*** mkfs ***
@@ -472,7 +472,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=32k, sync=sync ---
--- mkfs=version=2,su=32768, mnt=logbsize=32k, sync=sync ---
*** mkfs ***
@@ -708,7 +708,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=64k, sync=sync ---
--- mkfs=version=2,su=32768, mnt=logbsize=64k, sync=sync ---
*** mkfs ***
@@ -944,7 +944,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=64k, sync=sync ---
--- mkfs=version=2, mnt=logbsize=64k, sync=sync ---
*** mkfs ***
@@ -1180,7 +1180,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=128k, sync=sync ---
--- mkfs=version=2, mnt=logbsize=128k, sync=sync ---
*** mkfs ***
@@ -1416,7 +1416,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=256k, sync=sync ---
--- mkfs=version=2, mnt=logbsize=256k, sync=sync ---
*** mkfs ***
@@ -1652,7 +1652,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=32k, sync=nosync ---
--- mkfs=version=2, mnt=logbsize=32k, sync=nosync ---
*** mkfs ***
@@ -1888,7 +1888,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=4096, mnt=-ologbsize=32k, sync=nosync ---
--- mkfs=version=2,su=4096, mnt=logbsize=32k, sync=nosync ---
*** mkfs ***
@@ -2124,7 +2124,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=32k, sync=nosync ---
--- mkfs=version=2,su=32768, mnt=logbsize=32k, sync=nosync ---
*** mkfs ***
@@ -2360,7 +2360,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=64k, sync=nosync ---
--- mkfs=version=2,su=32768, mnt=logbsize=64k, sync=nosync ---
*** mkfs ***
@@ -2596,7 +2596,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=64k, sync=nosync ---
--- mkfs=version=2, mnt=logbsize=64k, sync=nosync ---
*** mkfs ***
@@ -2832,7 +2832,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=128k, sync=nosync ---
--- mkfs=version=2, mnt=logbsize=128k, sync=nosync ---
*** mkfs ***
@@ -3068,7 +3068,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=256k, sync=nosync ---
--- mkfs=version=2, mnt=logbsize=256k, sync=nosync ---
*** mkfs ***
+10 -9
View File
@@ -60,7 +60,7 @@ _do_meta()
param="-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \
-f rename=30 -f stat=30 -f unlink=30 -f truncate=20"
_echofull "calling fsstress $param -m8 -n $count"
if ! time $here/ltp/fsstress $param $FSSTRESS_AVOID -m 8 -n $count -d $out >>$seq.full 2>&1
if ! $here/ltp/fsstress $param $FSSTRESS_AVOID -m 8 -n $count -d $out >>$seq.full 2>&1
then
_echofull "fsstress failed"
fi
@@ -78,12 +78,13 @@ umount $SCRATCH_DEV >/dev/null 2>&1
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt
-lversion=2 -ologbsize=32k
-lversion=2,su=4096 -ologbsize=32k
-lversion=2,su=32768 -ologbsize=32k
-lversion=2 -ologbsize=64k
-lversion=2 -ologbsize=128k
-lversion=2 -ologbsize=256k
# ------------------------------
version=2 logbsize=32k
version=2,su=4096 logbsize=32k
version=2,su=32768 logbsize=32k
version=2 logbsize=64k
version=2 logbsize=128k
version=2 logbsize=256k
EOF
cat $tmp.seq.params \
@@ -94,8 +95,8 @@ do
fi
echo "--- mkfs=$mkfs, mnt=$mnt ---"
export MOUNT_OPTIONS=$mnt
export MKFS_OPTIONS=$mkfs
export MKFS_OPTIONS="-l $mkfs"
export MOUNT_OPTIONS="-o $mnt"
# mkfs the FS
_echofull "mkfs"
+6 -6
View File
@@ -1,6 +1,6 @@
QA output created by 087
*** init FS
--- mkfs=-lversion=2, mnt=-ologbsize=32k ---
--- mkfs=version=2, mnt=logbsize=32k ---
*** mkfs ***
@@ -43,7 +43,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=4096, mnt=-ologbsize=32k ---
--- mkfs=version=2,su=4096, mnt=logbsize=32k ---
*** mkfs ***
@@ -86,7 +86,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2,su=32768, mnt=-ologbsize=32k ---
--- mkfs=version=2,su=32768, mnt=logbsize=32k ---
*** mkfs ***
@@ -129,7 +129,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=64k ---
--- mkfs=version=2, mnt=logbsize=64k ---
*** mkfs ***
@@ -172,7 +172,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=128k ---
--- mkfs=version=2, mnt=logbsize=128k ---
*** mkfs ***
@@ -215,7 +215,7 @@ clean log
*** filesystem is checked ok ***
--- mkfs=-lversion=2, mnt=-ologbsize=256k ---
--- mkfs=version=2, mnt=logbsize=256k ---
*** mkfs ***
+20 -9
View File
@@ -193,7 +193,19 @@ _filter_logprint()
oper = $0
next
}
/^TRANS/ && dummy_rec == 1 {
# start printing again - dummy transaction over
dummy_rec = 0
}
/DUMMY1/ {
# filter out dummy transactions
dummy_rec = 1
next
}
{
if (dummy_rec) {
next
}
buf_data = 0
if (oper) { # now we can print out oper
print oper
@@ -225,8 +237,8 @@ _print_logstate()
_print_operation()
{
mkdir $fulldir >/dev/null 2>&1
mntopt=`echo $MOUNT_OPTIONS | sed 's/ /_/g'`
mkfsopt=`echo $MKFS_OPTIONS | sed 's/ /_/g'`
mntopt=`echo $MOUNT_OPTIONS | sed 's/ //g'`
mkfsopt=`echo $MKFS_OPTIONS | sed 's/ //g'`
raw=$fulldir/op.mnt$mntopt.mkfs$mkfsopt$sync_suffix.raw
filtered=$fulldir/op.mnt$mntopt.mkfs$mkfsopt$sync_suffix.filtered
@@ -249,8 +261,8 @@ _print_transaction_inode()
{
_start=$1
mkdir $fulldir >/dev/null 2>&1
mntopt=`echo $MOUNT_OPTIONS | sed 's/ /_/g'`
mkfsopt=`echo $MKFS_OPTIONS | sed 's/ /_/g'`
mntopt=`echo $MOUNT_OPTIONS | sed 's/ //g'`
mkfsopt=`echo $MKFS_OPTIONS | sed 's/ //g'`
raw=$fulldir/trans_inode.mnt$mntopt.mkfs$mkfsopt$sync_suffix.raw
filtered=$fulldir/trans_inode.mnt$mntopt.mkfs$mkfsopt$sync_suffix.filtered
@@ -265,8 +277,8 @@ _print_transaction_buf()
{
_start=$1
mkdir $fulldir >/dev/null 2>&1
mntopt=`echo $MOUNT_OPTIONS | sed 's/ /_/g'`
mkfsopt=`echo $MKFS_OPTIONS | sed 's/ /_/g'`
mntopt=`echo $MOUNT_OPTIONS | sed 's/ //g'`
mkfsopt=`echo $MKFS_OPTIONS | sed 's/ //g'`
raw=$fulldir/trans_buf.mnt$mntopt.mkfs$mkfsopt$sync_suffix.raw
filtered=$fulldir/trans_buf.mnt$mntopt.mkfs$mkfsopt$sync_suffix.filtered
@@ -298,7 +310,7 @@ _mkfs_log()
_create_log()
{
# mount the FS
_full " mount"
_full "mount"
_scratch_mount >>$seq.full 2>&1
if [ $? -ne 0 ] ; then
_echofull "mount failed: $MOUNT_OPTIONS"
@@ -340,7 +352,7 @@ _create_log_sync()
touch $file
sync
done
# unmount the FS
_full "umount"
umount $SCRATCH_DEV >>$seq.full 2>&1
@@ -348,7 +360,6 @@ _create_log_sync()
_echofull "umount failed"
return 1
fi
}
_cmp_output()
+7 -3
View File
@@ -42,10 +42,14 @@ _require_quota()
src/feature -q $TEST_DEV
[ $? -ne 0 ] && _notrun "Installed kernel does not support XFS quota"
[ ! -x /sbin/quotaon ] && _notrun "Quota user tools not installed"
if [ "$HOSTOS" = "IRIX" ]; then
[ ! -x /usr/etc/quotaon ] && _notrun "Quota user tools not installed"
else
[ ! -x /sbin/quotaon ] && _notrun "Quota user tools not installed"
/sbin/quotaon -x 2>&1 | grep "option requires an argument -- x" >/dev/null
[ $? -ne 0 ] && _notrun "Installed quota tools do not support XFS"
/sbin/quotaon -x 2>&1 | grep "option requires an argument -- x" >/dev/null
[ $? -ne 0 ] && _notrun "Installed quota tools do not support XFS"
fi
}
# create a file as a specific user (uid)
+5 -5
View File
@@ -681,14 +681,14 @@ _check_xfs_filesystem()
fi
$XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
| tee $tmp.fs_check | grep -q "<CLEAN>"
| tee $tmp.logprint | grep -q "<CLEAN>"
if [ $? -ne 0 -a "$HOSTOS" = "Linux" ]
then
echo "_check_fs: filesystem on $device has dirty log (see $seq.full)"
echo "_check_fs: filesystem on $device has dirty log" >>$here/$seq.full
echo "*** xfs_logprint -t output ***" >>$here/$seq.full
cat $tmp.fs_check >>$here/$seq.full
cat $tmp.logprint >>$here/$seq.full
echo "*** end xfs_logprint output" >>$here/$seq.full
ok=0
@@ -709,19 +709,19 @@ _check_xfs_filesystem()
fi
# repair doesn't scale massively at this stage, optionally skip it for now
[ "$USE_BIG_LOOPFS" = yes ] || \
$XFS_REPAIR_PROG -n $extra_log_options $device >$tmp.fs_check 2>&1
$XFS_REPAIR_PROG -n $extra_log_options $device >$tmp.repair 2>&1
if [ $? -ne 0 ]
then
echo "_check_fs: filesystem on $device is inconsistent (r) (see $seq.full)"
echo "_check_fs: filesystem on $device is inconsistent" >>$here/$seq.full
echo "*** xfs_repair -n output ***" >>$here/$seq.full
cat $tmp.fs_check | _fix_malloc >>$here/$seq.full
cat $tmp.repair | _fix_malloc >>$here/$seq.full
echo "*** end xfs_repair output" >>$here/$seq.full
ok=0
fi
rm -f $tmp.fs_check
rm -f $tmp.fs_check $tmp.logprint $tmp.repair
if [ $ok -eq 0 ]
then
+4 -3
View File
@@ -36,9 +36,10 @@ include $(TOPDIR)/include/builddefs
TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
nametest permname randholes runas truncfile usemem \
mmapcat append_reader append_writer dirperf metaperf \
devzero feature alloc fault fstest t_access_root
devzero feature alloc fault fstest t_access_root \
godown
LINUX_TARGETS = loggen xfsctl resvtest godown bstat t_mtab
LINUX_TARGETS = loggen xfsctl resvtest bstat t_mtab
ifeq ($(PKG_PLATFORM),linux)
TARGETS += $(LINUX_TARGETS)
@@ -100,4 +101,4 @@ fill2: fill2.o
runas: runas.o
$(LINKTEST) -lgen
endif
endif
+18 -3
View File
@@ -156,14 +156,29 @@ hasxfsquota(int type, int q, char *device)
fs_quota_stat_t qstat;
int qcmd;
if (q == 0)
return (access("/proc/fs/xfs/xqm", F_OK) < 0);
memset(&qstat, 0, sizeof(fs_quota_stat_t));
#ifdef QCMD
if (q == 0) {
if (access("/proc/fs/xfs/xqm", F_OK) < 0) {
if (verbose) {
fprintf(stderr, "can't access /proc/fs/xfs/xqm\n");
}
return 1;
}
return 0;
}
qcmd = QCMD(Q_XGETQSTAT, type);
#else
if (q == 0) {
if (quotactl(Q_SYNC, device, 0, (caddr_t)&qstat) == ENOPKG) {
if (verbose) {
fprintf(stderr, "Q_SYNC not supported\n");
}
return 1;
}
return 0;
}
qcmd = Q_GETQSTAT;
#endif
+15 -3
View File
@@ -221,9 +221,21 @@ typedef struct xfs_fsop_bulkreq {
static __inline__ int
xfsctl(char* path, int fd, int cmd, void* arg) {
if (cmd >= 0 && cmd < XFS_FSOPS_COUNT)
return syssgi(SGI_XFS_FSOPERATIONS, fd, cmd, (void*)0, arg);
else if (cmd == SGI_FS_BULKSTAT)
if (cmd >= 0 && cmd < XFS_FSOPS_COUNT) {
/*
* We have a problem in that xfsctl takes 1 arg but
* some sgi xfs ops take an input arg and/or an output arg
* So have to special case the ops to decide if xfsctl arg
* is an input or an output argument.
*/
if (cmd == XFS_FS_GOINGDOWN) {
/* in arg */
return syssgi(SGI_XFS_FSOPERATIONS, fd, cmd, arg, 0);
} else {
/* out arg */
return syssgi(SGI_XFS_FSOPERATIONS, fd, cmd, 0, arg);
}
} else if (cmd == SGI_FS_BULKSTAT)
return syssgi(SGI_FS_BULKSTAT, fd,
((xfs_fsop_bulkreq_t*)arg)->lastip,
((xfs_fsop_bulkreq_t*)arg)->icount,