]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[DLM] Look for "nodir" in the lockspace mount options
authorDavid Teigland <teigland@redhat.com>
Tue, 28 Mar 2006 19:20:58 +0000 (14:20 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 28 Mar 2006 19:20:58 +0000 (14:20 -0500)
Look for "nodir" in the hostdata mount option which is used to
set the NODIR flag in dlm_new_lockspace().

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/locking/dlm/mount.c

index 042f3a75c4416173a7d7b8a664e2fd96d4617e77..026f05ce168d6687d091c24f80401e0f36ce8605 100644 (file)
@@ -60,7 +60,7 @@ static struct gdlm_ls *init_gdlm(lm_callback_t cb, lm_fsdata_t *fsdata,
        return ls;
 }
 
-static int make_args(struct gdlm_ls *ls, char *data_arg)
+static int make_args(struct gdlm_ls *ls, char *data_arg, int *nodir)
 {
        char data[256];
        char *options, *x, *y;
@@ -101,6 +101,14 @@ static int make_args(struct gdlm_ls *ls, char *data_arg)
                        }
                        sscanf(y, "%u", &ls->id);
 
+               } else if (!strcmp(x, "nodir")) {
+                       if (!y) {
+                               log_error("need argument to nodir");
+                               error = -EINVAL;
+                               break;
+                       }
+                       sscanf(y, "%u", nodir);
+
                } else {
                        log_error("unkonwn option: %s", x);
                        error = -EINVAL;
@@ -118,7 +126,7 @@ static int gdlm_mount(char *table_name, char *host_data,
                        struct kobject *fskobj)
 {
        struct gdlm_ls *ls;
-       int error = -ENOMEM;
+       int error = -ENOMEM, nodir = 0;
 
        if (min_lvb_size > GDLM_LVB_SIZE)
                goto out;
@@ -127,12 +135,18 @@ static int gdlm_mount(char *table_name, char *host_data,
        if (!ls)
                goto out;
 
+       error = make_args(ls, host_data, &nodir);
+       if (error)
+               goto out;
+
        error = gdlm_init_threads(ls);
        if (error)
                goto out_free;
 
        error = dlm_new_lockspace(ls->fsname, strlen(ls->fsname),
-                                 &ls->dlm_lockspace, 0, GDLM_LVB_SIZE);
+                                 &ls->dlm_lockspace,
+                                 nodir ? DLM_LSFL_NODIR : 0,
+                                 GDLM_LVB_SIZE);
        if (error) {
                log_error("dlm_new_lockspace error %d", error);
                goto out_thread;
@@ -142,10 +156,6 @@ static int gdlm_mount(char *table_name, char *host_data,
        if (error)
                goto out_dlm;
 
-       error = make_args(ls, host_data);
-       if (error)
-               goto out_sysfs;
-
        lockstruct->ls_jid = ls->jid;
        lockstruct->ls_first = ls->first;
        lockstruct->ls_lockspace = ls;
@@ -154,8 +164,6 @@ static int gdlm_mount(char *table_name, char *host_data,
        lockstruct->ls_lvb_size = GDLM_LVB_SIZE;
        return 0;
 
- out_sysfs:
-       gdlm_kobject_release(ls);
  out_dlm:
        dlm_release_lockspace(ls->dlm_lockspace, 2);
  out_thread: