diff options
author | David Teigland <teigland@redhat.com> | 2006-03-28 14:20:58 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-28 14:20:58 -0500 |
commit | 7aabffcab47a0f881c7640f5c108e8d3f2e35ebf (patch) | |
tree | 42a86720c87a640a11fa6c91d23babf27330d145 /fs/gfs2/locking | |
parent | 71b86f562b5eb6f94ea00bba060caa64d0137969 (diff) |
[DLM] Look for "nodir" in the lockspace mount options
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>
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r-- | fs/gfs2/locking/dlm/mount.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c index 042f3a75c441..026f05ce168d 100644 --- a/fs/gfs2/locking/dlm/mount.c +++ b/fs/gfs2/locking/dlm/mount.c | |||
@@ -60,7 +60,7 @@ static struct gdlm_ls *init_gdlm(lm_callback_t cb, lm_fsdata_t *fsdata, | |||
60 | return ls; | 60 | return ls; |
61 | } | 61 | } |
62 | 62 | ||
63 | static int make_args(struct gdlm_ls *ls, char *data_arg) | 63 | static int make_args(struct gdlm_ls *ls, char *data_arg, int *nodir) |
64 | { | 64 | { |
65 | char data[256]; | 65 | char data[256]; |
66 | char *options, *x, *y; | 66 | char *options, *x, *y; |
@@ -101,6 +101,14 @@ static int make_args(struct gdlm_ls *ls, char *data_arg) | |||
101 | } | 101 | } |
102 | sscanf(y, "%u", &ls->id); | 102 | sscanf(y, "%u", &ls->id); |
103 | 103 | ||
104 | } else if (!strcmp(x, "nodir")) { | ||
105 | if (!y) { | ||
106 | log_error("need argument to nodir"); | ||
107 | error = -EINVAL; | ||
108 | break; | ||
109 | } | ||
110 | sscanf(y, "%u", nodir); | ||
111 | |||
104 | } else { | 112 | } else { |
105 | log_error("unkonwn option: %s", x); | 113 | log_error("unkonwn option: %s", x); |
106 | error = -EINVAL; | 114 | error = -EINVAL; |
@@ -118,7 +126,7 @@ static int gdlm_mount(char *table_name, char *host_data, | |||
118 | struct kobject *fskobj) | 126 | struct kobject *fskobj) |
119 | { | 127 | { |
120 | struct gdlm_ls *ls; | 128 | struct gdlm_ls *ls; |
121 | int error = -ENOMEM; | 129 | int error = -ENOMEM, nodir = 0; |
122 | 130 | ||
123 | if (min_lvb_size > GDLM_LVB_SIZE) | 131 | if (min_lvb_size > GDLM_LVB_SIZE) |
124 | goto out; | 132 | goto out; |
@@ -127,12 +135,18 @@ static int gdlm_mount(char *table_name, char *host_data, | |||
127 | if (!ls) | 135 | if (!ls) |
128 | goto out; | 136 | goto out; |
129 | 137 | ||
138 | error = make_args(ls, host_data, &nodir); | ||
139 | if (error) | ||
140 | goto out; | ||
141 | |||
130 | error = gdlm_init_threads(ls); | 142 | error = gdlm_init_threads(ls); |
131 | if (error) | 143 | if (error) |
132 | goto out_free; | 144 | goto out_free; |
133 | 145 | ||
134 | error = dlm_new_lockspace(ls->fsname, strlen(ls->fsname), | 146 | error = dlm_new_lockspace(ls->fsname, strlen(ls->fsname), |
135 | &ls->dlm_lockspace, 0, GDLM_LVB_SIZE); | 147 | &ls->dlm_lockspace, |
148 | nodir ? DLM_LSFL_NODIR : 0, | ||
149 | GDLM_LVB_SIZE); | ||
136 | if (error) { | 150 | if (error) { |
137 | log_error("dlm_new_lockspace error %d", error); | 151 | log_error("dlm_new_lockspace error %d", error); |
138 | goto out_thread; | 152 | goto out_thread; |
@@ -142,10 +156,6 @@ static int gdlm_mount(char *table_name, char *host_data, | |||
142 | if (error) | 156 | if (error) |
143 | goto out_dlm; | 157 | goto out_dlm; |
144 | 158 | ||
145 | error = make_args(ls, host_data); | ||
146 | if (error) | ||
147 | goto out_sysfs; | ||
148 | |||
149 | lockstruct->ls_jid = ls->jid; | 159 | lockstruct->ls_jid = ls->jid; |
150 | lockstruct->ls_first = ls->first; | 160 | lockstruct->ls_first = ls->first; |
151 | lockstruct->ls_lockspace = ls; | 161 | lockstruct->ls_lockspace = ls; |
@@ -154,8 +164,6 @@ static int gdlm_mount(char *table_name, char *host_data, | |||
154 | lockstruct->ls_lvb_size = GDLM_LVB_SIZE; | 164 | lockstruct->ls_lvb_size = GDLM_LVB_SIZE; |
155 | return 0; | 165 | return 0; |
156 | 166 | ||
157 | out_sysfs: | ||
158 | gdlm_kobject_release(ls); | ||
159 | out_dlm: | 167 | out_dlm: |
160 | dlm_release_lockspace(ls->dlm_lockspace, 2); | 168 | dlm_release_lockspace(ls->dlm_lockspace, 2); |
161 | out_thread: | 169 | out_thread: |