summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2010-05-05 15:17:09 +0000
committerjkar8572 <jkar8572>2010-05-05 15:17:09 +0000
commit7f17e02d34e8157009d2603bfcea3bc619709eee (patch)
tree28e5466177962db25ebebf5e3371b37495932fc0
parent940aecfcffe12b565ff0e06d1b6c838a86dfbdd0 (diff)
downloadlinuxquota-7f17e02d34e8157009d2603bfcea3bc619709eee.tar.gz
GFS2 implements the XFS interface for setting and reporting the quota
information, and only allows state changes via remount. (Christoph Hellwig)
-rw-r--r--Changelog1
-rw-r--r--mntopt.h1
-rw-r--r--quotacheck.c4
-rw-r--r--quotaio.c3
-rw-r--r--quotaon.c8
-rw-r--r--quotasys.c12
6 files changed, 22 insertions, 7 deletions
diff --git a/Changelog b/Changelog
index 7249e93..23ff6ba 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
Changes in quota-tools from 3.17 to 4.00-pre2
+* support of GFS2 filesystem (Christoph Hellwig)
* avoid memory corruption of NULL address (Petr Pisar)
* fixup typos in manpages (Michael Meskes)
* added german translation (Michael Bunk)
diff --git a/mntopt.h b/mntopt.h
index 90673fc..5117033 100644
--- a/mntopt.h
+++ b/mntopt.h
@@ -18,6 +18,7 @@
#define MNTTYPE_NFS4 "nfs4" /* NFSv4 filesystem */
#define MNTTYPE_MPFS "mpfs" /* EMC Celerra MPFS filesystem */
#define MNTTYPE_OCFS2 "ocfs2" /* Oracle Cluster filesystem */
+#define MNTTYPE_GFS2 "gfs2" /* Red Hat Global filesystem 2 */
/* mount options */
#define MNTOPT_NOQUOTA "noquota" /* don't enforce quota */
diff --git a/quotacheck.c b/quotacheck.c
index 41901f1..0e9bac9 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -1049,7 +1049,9 @@ static void check_all(void)
while ((mnt = get_next_mount())) {
if (flags & FL_ALL && flags & FL_NOROOT && !strcmp(mnt->mnt_dir, "/"))
continue;
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || nfs_fstype(mnt->mnt_type) ||
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) ||
+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2) ||
+ nfs_fstype(mnt->mnt_type) ||
meta_qf_fstype(mnt->mnt_type)) {
debug(FL_DEBUG | FL_VERBOSE, _("Skipping %s [%s]\n"), mnt->mnt_fsname, mnt->mnt_dir);
continue;
diff --git a/quotaio.c b/quotaio.c
index e857328..533b631 100644
--- a/quotaio.c
+++ b/quotaio.c
@@ -78,7 +78,8 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt, int flags)
goto out_handle;
}
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem? */
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || /* XFS filesystem? */
+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { /* XFS filesystem? */
if (fmt != -1 && fmt != QF_XFS) { /* User wanted some other format? */
errstr(_("Only XFS quota format is allowed on XFS filesystem.\n"));
goto out_handle;
diff --git a/quotaon.c b/quotaon.c
index 813c021..1d1187b 100644
--- a/quotaon.c
+++ b/quotaon.c
@@ -273,7 +273,10 @@ static int newstate(struct mntent *mnt, int type, char *extra)
if (flags & FL_ALL)
sflags |= STATEFLAG_ALL;
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */
+ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2)) {
+ errstr(_("Cannot change state of GFS2 quota.\n"));
+ return 1;
+ } else if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */
if (!kern_qfmt_supp(QF_XFS)) {
errstr(_("Cannot change state of XFS quota. It's not compiled in kernel.\n"));
return 1;
@@ -329,7 +332,8 @@ static int print_state(struct mntent *mnt, int type)
{
int on = 0;
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) {
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) ||
+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) {
if (kern_qfmt_supp(QF_XFS))
on = kern_quota_on(mnt->mnt_fsname, type, QF_XFS) != -1;
}
diff --git a/quotasys.c b/quotasys.c
index cce5787..0cc008c 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -91,7 +91,8 @@ static int correct_fstype(char *type)
!strcmp(type, MNTTYPE_NFS) ||
!strcmp(type, MNTTYPE_NFS4) ||
!strcmp(type, MNTTYPE_OCFS2) ||
- !strcmp(type, MNTTYPE_MPFS)) {
+ !strcmp(type, MNTTYPE_MPFS) ||
+ !strcmp(type, MNTTYPE_GFS2)) {
free(mtype);
return 1;
}
@@ -495,6 +496,8 @@ int hasquota(struct mntent *mnt, int type, int flags)
if (!correct_fstype(mnt->mnt_type) || hasmntopt(mnt, MNTOPT_NOQUOTA))
return 0;
+ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2))
+ return 1;
if (!strcmp(mnt->mnt_type, MNTTYPE_XFS))
return hasxfsquota(mnt, type, flags);
if (nfs_fstype(mnt->mnt_type)) /* NFS always has quota or better there is no good way how to detect it */
@@ -652,11 +655,14 @@ add_entry:
goto add_entry;
break;
case QF_XFS:
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS))
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) ||
+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2))
goto add_entry;
break;
default:
- if (strcmp(mnt->mnt_type, MNTTYPE_XFS) && !nfs_fstype(mnt->mnt_type))
+ if (strcmp(mnt->mnt_type, MNTTYPE_XFS) &&
+ strcmp(mnt->mnt_type, MNTTYPE_GFS2) &&
+ !nfs_fstype(mnt->mnt_type))
goto add_entry;
break;
}