static struct cmdinfo scrub_cmd;
static struct cmdinfo repair_cmd;
static const struct cmdinfo scrubv_cmd;
+static const struct cmdinfo addfeature_cmd;
static void
scrub_help(void)
add_command(&scrub_cmd);
add_command(&scrubv_cmd);
+ add_command(&addfeature_cmd);
}
static void
.oneline = N_("vectored metadata scrub"),
.help = scrubv_help,
};
+
+static void
+addfeature_help(void)
+{
+ printf(_(
+"\n"
+" Upgrade the feature set of the mounted filesystem.\n"
+"\n"
+"Supported features: bigtime, inobtcount, nrext64, exchange.\n"));
+}
+
+static int
+addfeature_f(
+ int argc,
+ char **argv)
+{
+ __u64 flags = 0;
+ int c;
+ int error;
+
+ while ((c = getopt(argc, argv, "")) != EOF) {
+ switch (c) {
+ default:
+ addfeature_help();
+ return 0;
+ }
+ }
+
+ for (c = optind; c < argc; c++) {
+ if (!strcmp(argv[c], "bigtime"))
+ flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
+ else if (!strcmp(argv[c], "inobtcount"))
+ flags |= XFS_FSOP_GEOM_FLAGS_INOBTCNT;
+ else if (!strcmp(argv[c], "nrext64"))
+ flags |= XFS_FSOP_GEOM_FLAGS_NREXT64;
+ else if (!strcmp(argv[c], "exchange"))
+ flags |= XFS_FSOP_GEOM_FLAGS_EXCHANGE_RANGE;
+ else {
+ addfeature_help();
+ return 1;
+ }
+ }
+
+ if (!expert) {
+ printf(_("addfeature requires expert mode.\n"));
+ return 1;
+ }
+
+ error = ioctl(file->fd, XFS_IOC_ADDFEATURE, &flags);
+ if (error)
+ perror("addfeature");
+
+ return 0;
+}
+
+static const struct cmdinfo addfeature_cmd = {
+ .name = "addfeature",
+ .cfunc = addfeature_f,
+ .argmin = -1,
+ .argmax = -1,
+ .flags = CMD_NOMAP_OK,
+ .oneline = N_("add filesystem features"),
+ .help = addfeature_help,
+};
#define XFS_IOC_GETFSREFCOUNTS _IOWR('X', 66, struct xfs_getfsrefs_head)
#define XFS_IOC_MAP_FREESP _IOW ('X', 67, struct xfs_map_freesp)
#define XFS_IOC_HEALTH_MONITOR _IOW ('X', 68, struct xfs_health_monitor)
+#define XFS_IOC_ADDFEATURE _IOW ('X', 69, __u64)
/*
* ioctl commands that replace IRIX syssgi()'s
.PD
.RE
+.TP
+.BI "addfeature [ " features " ]"
+Upgrade the mounted filesystem feature set.
+The only supported features are:
+.BR bigtime ,
+.BR inobtcount ,
+.BR nrext64 ,
+and
+.BR exchange .
+.PD
+.RE
+
.TP
.BI "bulkstat [ \-a " agno " ] [ \-d ] [ \-e " endino " ] [ \-m ] [ \-n " batchsize " ] [ \-q ] [ \-s " startino " ] [ \-v " version" ]
Display raw stat information about a bunch of inodes in an XFS filesystem.