Thread (46 messages) 46 messages, 3 authors, 2021-04-17
STALE1919d
Revisions (4)
  1. v3 [diff vs current]
  2. v4 [diff vs current]
  3. v5 [diff vs current]
  4. v6 current

[PATCH V6 03/13] common/xfs: Add helper to obtain fsxattr field value

From: Chandan Babu R <hidden>
Date: 2021-03-09 05:02:30
Also in: fstests
Subsystem: the rest · Maintainer: Linus Torvalds

This commit adds a helper function to obtain the value of a particular field
of an inode's fsxattr fields.

Signed-off-by: Chandan Babu R <redacted>
---
 common/xfs | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/common/xfs b/common/xfs
index 26ae21b9..130b3232 100644
--- a/common/xfs
+++ b/common/xfs
@@ -194,6 +194,15 @@ _xfs_get_file_block_size()
 	$XFS_INFO_PROG "$path" | grep realtime | sed -e 's/^.*extsz=\([0-9]*\).*$/\1/g'
 }
 
+_xfs_get_fsxattr()
+{
+	local field="$1"
+	local path="$2"
+
+	local value=$($XFS_IO_PROG -c "stat" "$path" | grep "$field")
+	echo ${value##fsxattr.${field} = }
+}
+
 # xfs_check script is planned to be deprecated. But, we want to
 # be able to invoke "xfs_check" behavior in xfstests in order to
 # maintain the current verification levels.
-- 
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help