summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6783aa5)
raw | patch | inline | side by side (parent: 6783aa5)
author | niki <niki> | |
Thu, 8 Dec 2005 22:14:24 +0000 (22:14 +0000) | ||
committer | niki <niki> | |
Thu, 8 Dec 2005 22:14:24 +0000 (22:14 +0000) |
src/quota_mnt.c | patch | blob | history | |
src/quota_mnt.h | patch | blob | history |
diff --git a/src/quota_mnt.c b/src/quota_mnt.c
index a0efab15155e94329cea537901e87a157c0ab140..921c589862a631658899482744e2854485d04c08 100644 (file)
--- a/src/quota_mnt.c
+++ b/src/quota_mnt.c
-/* *** *** *** prototypes *** *** *** */
-
-static char *getmountopt(char *line, char *keyword);
-static char *checkmountopt(char *line, char *keyword, int full);
-
-
-
/* *** *** *** local functions *** *** *** */
}
#endif /* HAVE_GETVFSENT */
-static char *
-checkmountopt(char *line, char *keyword, int full)
+char *
+quota_mnt_checkmountopt(char *line, char *keyword, int full)
{
char *line2, *l2;
int l = strlen(keyword);
free(line2);
return NULL;
-} /* static char *checkmountopt(char *line, char *keyword, int full) */
+} /* char *quota_mnt_checkmountopt(char *line, char *keyword, int full) */
-static char *
-getmountopt(char *line, char *keyword)
+char *
+quota_mnt_getmountopt(char *line, char *keyword)
{
char *r;
- r = checkmountopt(line, keyword, 0);
+ r = quota_mnt_checkmountopt(line, keyword, 0);
if(r != NULL) {
char *p;
r += strlen(keyword);
}
}
return r;
-} /* static char *getmountopt(char *line, char *keyword) */
+} /* char *quota_mnt_getmountopt(char *line, char *keyword) */
#if HAVE_GETMNTENT
static void
continue;
}
- if(checkmountopt(mnt->mnt_opts, MNTOPT_NOQUOTA, 1) != NULL) {
+ if(quota_mnt_checkmountopt(mnt->mnt_opts, MNTOPT_NOQUOTA, 1) != NULL) {
DBG("noquota option on fs (%s) %s (%s): ignored",
mnt->mnt_type, mnt->mnt_dir, mnt->mnt_fsname);
continue;
}
- if(checkmountopt(mnt->mnt_opts, "bind", 1) != NULL) {
+ if(quota_mnt_checkmountopt(mnt->mnt_opts, "bind", 1) != NULL) {
DBG("bind mount on fs (%s) %s (%s): ignored",
mnt->mnt_type, mnt->mnt_dir, mnt->mnt_fsname);
continue;
}
- loop = getmountopt(mnt->mnt_opts, "loop=");
+ loop = quota_mnt_getmountopt(mnt->mnt_opts, "loop=");
if(loop == NULL) { /* no loop= mount */
device = get_device_name(mnt->mnt_fsname);
if(device == NULL) {
device = loop;
}
- usrjquota = getmountopt(mnt->mnt_opts, "usrjquota=");
- grpjquota = getmountopt(mnt->mnt_opts, "grpjquota=");
- jqfmt = getmountopt(mnt->mnt_opts, "jqfmt=");
+ usrjquota = quota_mnt_getmountopt(mnt->mnt_opts, "usrjquota=");
+ grpjquota = quota_mnt_getmountopt(mnt->mnt_opts, "grpjquota=");
+ jqfmt = quota_mnt_getmountopt(mnt->mnt_opts, "jqfmt=");
#if HAVE_XFS_XQM_H
if(!strcmp(mnt->mnt_type, MNTTYPE_XFS)) {
}
} else {
#endif /* HAVE_XFS_XQM_H */
- if(checkmountopt(mnt->mnt_opts, MNTOPT_QUOTA, 1)
+ if(quota_mnt_checkmountopt(mnt->mnt_opts, MNTOPT_QUOTA, 1)
== NULL
- && checkmountopt(mnt->mnt_opts, MNTOPT_USRQUOTA, 1)
+ && quota_mnt_checkmountopt(mnt->mnt_opts, MNTOPT_USRQUOTA, 1)
== NULL
- && checkmountopt(mnt->mnt_opts, MNTOPT_GRPQUOTA, 1)
+ && quota_mnt_checkmountopt(mnt->mnt_opts, MNTOPT_GRPQUOTA, 1)
== NULL
&& quota_fs_isnfs(mnt->mnt_type) == EXIT_FAILURE)
{
/* TODO: this is not sufficient for XFS! */
/* TODO: maybe we should anyway NOT rely on the option in the mountfile...
... maybe the fs should be asked direktly all time! */
- if(checkmountopt(mnt->mnt_opts, MNTOPT_QUOTA, 1) != NULL
- || checkmountopt(mnt->mnt_opts, MNTOPT_USRQUOTA, 1) != NULL) {
+ if(quota_mnt_checkmountopt(mnt->mnt_opts, MNTOPT_QUOTA, 1) != NULL
+ || quota_mnt_checkmountopt(mnt->mnt_opts, MNTOPT_USRQUOTA, 1) != NULL) {
(*list)->opts |= QMO_USRQUOTA;
}
- if(checkmountopt(mnt->mnt_opts, MNTOPT_GRPQUOTA, 1) != NULL) {
+ if(quota_mnt_checkmountopt(mnt->mnt_opts, MNTOPT_GRPQUOTA, 1) != NULL) {
(*list)->opts |= QMO_GRPQUOTA;
}
(*list)->next = NULL;
diff --git a/src/quota_mnt.h b/src/quota_mnt.h
index cbe0a09487774bd0ad0e2d6dfef5ef7bb5d21ace..7b56bf1cae34ed8bb02b64e6ac5a977fbdcb126d 100644 (file)
--- a/src/quota_mnt.h
+++ b/src/quota_mnt.h
typedef struct _quota_mnt_t quota_mnt_t;
struct _quota_mnt_t {
- char *dir;
- char *device;
- char *type;
+ char *dir; /* "/sys" or "/" */
+ char *device; /* "none" or "/dev/hda1" */
+ char *type; /* "sysfs" or "ext3"*/
char *usrjquota;
char *grpjquota;
char *jqfmt;
int quota_mnt_type(const char *type);
+char *quota_mnt_getmountopt(char *line, char *keyword);
+char *quota_mnt_checkmountopt(char *line, char *keyword, int full);
+
quota_mnt_t *quota_mnt_getlist(quota_mnt_t **list);
void quota_mnt_freelist(quota_mnt_t *list);