_link_out_file_named()
{
+ test -n "$seqfull" || _fail "need to set seqfull"
+
local features=$2
local suffix=$(FEATURES="$features" perl -e '
my %feathash;
{
local features
+ test -n "$seqfull" || _fail "need to set seqfull"
+
if [ $# -eq 0 ]; then
features="$(_get_os_name),$FSTYP"
if [ -n "$MOUNT_OPTIONS" ]; then
echo "*** mount FS"
_scratch_mount
+seqfull=$0
+if _xfs_has_feature $SCRATCH_MNT parent; then
+ _link_out_file "parent"
+else
+ _link_out_file ""
+fi
+
testfile=$SCRATCH_MNT/testfile
echo "*** make test file 1"
echo "*** dump attributes (1)"
_scratch_xfs_db -r -c "inode $inum_1" -c "print a.sfattr" | \
- sed -e '/secure = /d' | sed -e '/parent = /d'
+ perl -ne '
+/\.secure/ && next;
+/\.parent/ && next;
+ print unless /^\d+:\[.*/;'
echo "*** dump attributes (2)"
/hdr.info.uuid/ && next;
/hdr.info.lsn/ && next;
/hdr.info.owner/ && next;
+/\.parent/ && next;
s/^(hdr.info.magic =) 0x3bee/\1 0xfbee/;
s/^(hdr.firstused =) (\d+)/\1 FIRSTUSED/;
s/^(hdr.freemap\[0-2] = \[base,size]).*/\1 [FREEMAP..]/;
-s/^(entries\[0-2] = \[hashval,nameidx,incomplete,root,local]).*/\1 [ENTRIES..]/;
+s/^(entries\[0-[23]] = \[hashval,nameidx,incomplete,root,local]).*/\1 [ENTRIES..]/;
print unless /^\d+:\[.*/;'
echo "*** done"
--- /dev/null
+parent: parent
+++ /dev/null
-QA output created by 021
-*** mkfs
-*** mount FS
-*** make test file 1
-# file: <TESTFILE>.1
-user.a1
-user.a2--
-
-*** make test file 2
-1+0 records in
-1+0 records out
-# file: <TESTFILE>.2
-user.a1
-user.a2-----
-user.a3
-
-Attribute "a3" had a 65535 byte value for <TESTFILE>.2:
-size of attr value = 65536
-
-*** unmount FS
-*** dump attributes (1)
-a.sfattr.hdr.totsize = 24
-a.sfattr.hdr.count = 2
-a.sfattr.list[0].namelen = 2
-a.sfattr.list[0].valuelen = 3
-a.sfattr.list[0].root = 0
-a.sfattr.list[0].name = "a1"
-a.sfattr.list[0].value = "v1\d"
-a.sfattr.list[1].namelen = 4
-a.sfattr.list[1].valuelen = 5
-a.sfattr.list[1].root = 0
-a.sfattr.list[1].name = "a2--"
-a.sfattr.list[1].value = "v2--\d"
-*** dump attributes (2)
-hdr.info.forw = 0
-hdr.info.back = 0
-hdr.info.magic = 0xfbee
-hdr.count = 3
-hdr.usedbytes = 52
-hdr.firstused = FIRSTUSED
-hdr.holes = 0
-hdr.freemap[0-2] = [base,size] [FREEMAP..]
-entries[0-2] = [hashval,nameidx,incomplete,root,local] [ENTRIES..]
-nvlist[0].valuelen = 8
-nvlist[0].namelen = 2
-nvlist[0].name = "a1"
-nvlist[0].value = "value_1\d"
-nvlist[1].valueblk = 0x1
-nvlist[1].valuelen = 65535
-nvlist[1].namelen = 2
-nvlist[1].name = "a3"
-nvlist[2].valuelen = 8
-nvlist[2].namelen = 7
-nvlist[2].name = "a2-----"
-nvlist[2].value = "value_2\d"
-*** done
-*** unmount
--- /dev/null
+QA output created by 021
+*** mkfs
+*** mount FS
+*** make test file 1
+# file: <TESTFILE>.1
+user.a1
+user.a2--
+
+*** make test file 2
+1+0 records in
+1+0 records out
+# file: <TESTFILE>.2
+user.a1
+user.a2-----
+user.a3
+
+Attribute "a3" had a 65535 byte value for <TESTFILE>.2:
+size of attr value = 65536
+
+*** unmount FS
+*** dump attributes (1)
+a.sfattr.hdr.totsize = 24
+a.sfattr.hdr.count = 2
+a.sfattr.list[0].namelen = 2
+a.sfattr.list[0].valuelen = 3
+a.sfattr.list[0].root = 0
+a.sfattr.list[0].name = "a1"
+a.sfattr.list[0].value = "v1\d"
+a.sfattr.list[1].namelen = 4
+a.sfattr.list[1].valuelen = 5
+a.sfattr.list[1].root = 0
+a.sfattr.list[1].name = "a2--"
+a.sfattr.list[1].value = "v2--\d"
+*** dump attributes (2)
+hdr.info.forw = 0
+hdr.info.back = 0
+hdr.info.magic = 0xfbee
+hdr.count = 3
+hdr.usedbytes = 52
+hdr.firstused = FIRSTUSED
+hdr.holes = 0
+hdr.freemap[0-2] = [base,size] [FREEMAP..]
+entries[0-2] = [hashval,nameidx,incomplete,root,local] [ENTRIES..]
+nvlist[0].valuelen = 8
+nvlist[0].namelen = 2
+nvlist[0].name = "a1"
+nvlist[0].value = "value_1\d"
+nvlist[1].valueblk = 0x1
+nvlist[1].valuelen = 65535
+nvlist[1].namelen = 2
+nvlist[1].name = "a3"
+nvlist[2].valuelen = 8
+nvlist[2].namelen = 7
+nvlist[2].name = "a2-----"
+nvlist[2].value = "value_2\d"
+*** done
+*** unmount
--- /dev/null
+QA output created by 021
+*** mkfs
+*** mount FS
+*** make test file 1
+# file: <TESTFILE>.1
+user.a1
+user.a2--
+
+*** make test file 2
+1+0 records in
+1+0 records out
+# file: <TESTFILE>.2
+user.a1
+user.a2-----
+user.a3
+
+Attribute "a3" had a 65535 byte value for <TESTFILE>.2:
+size of attr value = 65536
+
+*** unmount FS
+*** dump attributes (1)
+a.sfattr.hdr.totsize = 49
+a.sfattr.hdr.count = 3
+a.sfattr.list[0].namelen = 10
+a.sfattr.list[0].valuelen = 12
+a.sfattr.list[0].root = 0
+a.sfattr.list[0].name = "testfile.1"
+a.sfattr.list[1].namelen = 2
+a.sfattr.list[1].valuelen = 3
+a.sfattr.list[1].root = 0
+a.sfattr.list[1].name = "a1"
+a.sfattr.list[1].value = "v1\d"
+a.sfattr.list[2].namelen = 4
+a.sfattr.list[2].valuelen = 5
+a.sfattr.list[2].root = 0
+a.sfattr.list[2].name = "a2--"
+a.sfattr.list[2].value = "v2--\d"
+*** dump attributes (2)
+hdr.info.forw = 0
+hdr.info.back = 0
+hdr.info.magic = 0xfbee
+hdr.count = 4
+hdr.usedbytes = 80
+hdr.firstused = FIRSTUSED
+hdr.holes = 0
+hdr.freemap[0-2] = [base,size] [FREEMAP..]
+entries[0-3] = [hashval,nameidx,incomplete,root,local] [ENTRIES..]
+nvlist[0].valuelen = 8
+nvlist[0].namelen = 2
+nvlist[0].name = "a1"
+nvlist[0].value = "value_1\d"
+nvlist[1].valueblk = 0x1
+nvlist[1].valuelen = 65535
+nvlist[1].namelen = 2
+nvlist[1].name = "a3"
+nvlist[2].valuelen = 8
+nvlist[2].namelen = 7
+nvlist[2].name = "a2-----"
+nvlist[2].value = "value_2\d"
+nvlist[3].valuelen = 12
+nvlist[3].namelen = 10
+nvlist[3].name = "testfile.2"
+*** done
+*** unmount