Skip to contentSkip to conversation

put xfs build features into the stats file

RFC PATCH In review Eric Sandeen 3 participants 5 messages Apr 20, 2009 – Apr 21, 2009 XFS filesystem

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 put xfs build features into the stats file

Running xfstests on an xfs build w/o xattrs enabled, I realized there's no reliable way to see if the running xfs has various features other than debug (which is shown in /proc/fs/xfs/stat)

What do folks think of adding the BUILD_OPTIONS to this file as well?

# cat /proc/fs/xfs/stat
extent_alloc 0 0 0 0
...
xpc 0 0 0
debug 0
features security attributes, large block numbers, no debug 

---

fs/xfs/linux-2.6/xfs_stats.c +2 -0
Index: linux-2.6/fs/xfs/linux-2.6/xfs_stats.c
===================================================================
@@ -89,6 +89,8 @@ xfs_read_xfsstats(
 		0);
 #endif
 
+	len += sprintf(buffer + len, "features " XFS_BUILD_OPTIONS "\n");
+
 	if (offset >= len) {
 		*start = buffer;
 		*eof = 1;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

Separate file? That line uses a comma separator ... differs to every other line in that stats file, painful for parsers. And no risk of breaking anything if its a separate file.

cheers.

Quoted 35 lines · ----- "Eric Sandeen

Running xfstests on an xfs build w/o xattrs enabled, I realized there's no reliable way to see if the running xfs has various features other than debug (which is shown in /proc/fs/xfs/stat)

What do folks think of adding the BUILD_OPTIONS to this file as well?

# cat /proc/fs/xfs/stat
extent_alloc 0 0 0 0
...
xpc 0 0 0
debug 0
features security attributes, large block numbers, no debug 

---

Index: linux-2.6/fs/xfs/linux-2.6/xfs_stats.c
===================================================================

fs/xfs/linux-2.6/xfs_stats.c +2 -0
@@ -89,6 +89,8 @@ xfs_read_xfsstats(
 		0);
 #endif
 
+	len += sprintf(buffer + len, "features " XFS_BUILD_OPTIONS "\n");
+
 	if (offset >= len) {
 		*start = buffer;
 		*eof = 1;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Signature · 6 lines
Nathan

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw
Quoted 5 lines · Nathan Scott

Separate file? That line uses a comma separator ... differs to every other line in that stats file, painful for parsers. And no risk of breaking anything if its a separate file.

cheers.

Hm good point. Might do; not that big a deal, just wanted to be able to gracefully skip acl/attr xfstests if the xfs build didn't support it :)

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Eric Sandeen

Running xfstests on an xfs build w/o xattrs enabled

How did you disable xattrs?

Oh sorry, meant acls, with CONFIG_XFS_POSIX_ACL

Quoted 1 line

Should probably be a separate file, though.

Yeah, you're right, I'll go study up on sysfs. :)

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs