public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bill O'Donnell" <billodo@redhat.com>
To: xfs@oss.sgi.com
Subject: [PATCH 3/3] xfs_quota: additional changes to allow use on ext4
Date: Mon, 15 Aug 2016 13:38:31 -0500	[thread overview]
Message-ID: <1471286311-2730-4-git-send-email-billodo@redhat.com> (raw)
In-Reply-To: <1471286311-2730-1-git-send-email-billodo@redhat.com>

Further changes to allow xfs_quota to be used on foreign filesystem(s)
(e.g. ext4) for project quota testing in xfstests.

Add CMD_FLAG_GENERIC to enable generic xfs_quota commands (help and
quit) when xfs_quota is run on foreign filesystems.

Use CMD_FLAG_FOREIGN_OK on commands suitable for foreign filesystems.

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
---
 include/command.h | 1 +
 libxcmd/help.c    | 3 ++-
 libxcmd/quit.c    | 3 ++-
 quota/init.c      | 3 ++-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/command.h b/include/command.h
index 81d5a4d..1c2898a 100644
--- a/include/command.h
+++ b/include/command.h
@@ -22,6 +22,7 @@
 
 #define CMD_FLAG_GLOBAL		(1<<31)	/* don't iterate "args" */
 #define CMD_FLAG_FOREIGN_OK	(1<<30)	/* command not restricted to XFS */
+#define CMD_FLAG_GENERIC	(1<<29) /* command is generic (help, quit) */
 
 typedef int (*cfunc_t)(int argc, char **argv);
 typedef void (*helpfunc_t)(void);
diff --git a/libxcmd/help.c b/libxcmd/help.c
index fad0ab9..be26765 100644
--- a/libxcmd/help.c
+++ b/libxcmd/help.c
@@ -88,7 +88,8 @@ help_init(void)
 	help_cmd.cfunc = help_f;
 	help_cmd.argmin = 0;
 	help_cmd.argmax = 1;
-	help_cmd.flags = CMD_FLAG_GLOBAL;
+	help_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK |
+		CMD_FLAG_GENERIC;
 	help_cmd.args = _("[command]");
 	help_cmd.oneline = _("help for one or all commands");
 
diff --git a/libxcmd/quit.c b/libxcmd/quit.c
index 0183b8f..2a27c89 100644
--- a/libxcmd/quit.c
+++ b/libxcmd/quit.c
@@ -38,7 +38,8 @@ quit_init(void)
 	quit_cmd.cfunc = quit_f;
 	quit_cmd.argmin = -1;
 	quit_cmd.argmax = -1;
-	quit_cmd.flags = CMD_FLAG_GLOBAL;
+	quit_cmd.flags = CMD_FLAG_GLOBAL | CMD_FLAG_FOREIGN_OK |
+		CMD_FLAG_GENERIC;
 	quit_cmd.oneline = _("exit the program");
 
 	add_command(&quit_cmd);
diff --git a/quota/init.c b/quota/init.c
index c46ce0f..3b2fd61 100644
--- a/quota/init.c
+++ b/quota/init.c
@@ -104,7 +104,8 @@ init_check_command(
 	const cmdinfo_t	*ct)
 {
 	if (fs_path &&
-	    !(ct->flags & CMD_FLAG_FOREIGN_OK) &&
+	    !((ct->flags & CMD_FLAG_FOREIGN_OK) && foreign_allowed) &&
+	    !(ct->flags & CMD_FLAG_GENERIC) &&
 	     (fs_path->fs_flags & FS_FOREIGN)) {
 		fprintf(stderr,
 	_("foreign mount active, %s command is for XFS filesystems only\n"),
-- 
2.7.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      parent reply	other threads:[~2016-08-15 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 18:38 [PATCH 0/3] xfs_quota: allow operation on ext4 for project quotas Bill O'Donnell
2016-08-15 18:38 ` [PATCH 1/3] xfs_quota: add capabilities for use on ext4 Bill O'Donnell
2016-08-15 18:38 ` [PATCH 2/3] xfs_quota: changes to accomodate hoisted ioctl defs Bill O'Donnell
2016-08-15 18:38 ` Bill O'Donnell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471286311-2730-4-git-send-email-billodo@redhat.com \
    --to=billodo@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox