Skip to contentSkip to conversation

xfsprogs/io: set argmax to 1 for imap command

PATCH In review Brian Foster 2 participants 2 messages Jan 6, 2014 – Jan 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsprogs/io: set argmax to 1 for imap command

The imap command supports an optional argument to specify the number of inode records to capture per ioctl(), but argmax is currently set to 0. This leads to an error if an argument is provided on the command line. Set argmax to 1 to support the optional argument.

---
 io/imap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io/imap.c +1 -1
index 0a4f14e..4f3f883 100644
@@ -67,7 +67,7 @@ imap_init(void)
 	imap_cmd.name = "imap";
 	imap_cmd.cfunc = imap_f;
 	imap_cmd.argmin = 0;
-	imap_cmd.argmax = 0;
+	imap_cmd.argmax = 1;
 	imap_cmd.args = _("[nentries]");
 	imap_cmd.flags = CMD_NOMAP_OK;
 	imap_cmd.oneline = _("inode map for filesystem of current file");
Signature · 6 lines
1.8.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Brian Foster

The imap command supports an optional argument to specify the number of inode records to capture per ioctl(), but argmax is currently set to 0. This leads to an error if an argument is provided on the command line. Set argmax to 1 to support the optional argument.

---
 io/imap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io/imap.c +0 -0
index 0a4f14e..4f3f883 100644

io/imap.c imap_init(void) · line 73

Quoted 8 lines
io/imap.c +1 -1
@@ -67,7 +67,7 @@ imap_init(void)
 	imap_cmd.name = "imap";
 	imap_cmd.cfunc = imap_f;
 	imap_cmd.argmin = 0;
-	imap_cmd.argmax = 0;
+	imap_cmd.argmax = 1;
 	imap_cmd.args = _("[nentries]");
 	imap_cmd.flags = CMD_NOMAP_OK;
 	imap_cmd.oneline = _("inode map for filesystem of current file");

With this fix, the command behaviour is consistent with the help menu, and the optional argument is useful to extend our test coverage. Hence if no other objections, this patch looks good to me.

Thanks,
-Jeff

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