aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking/nolock/main.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-08 10:17:58 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-08 10:17:58 -0400
commit9b47c11d1cbedcba685c9bd90c73fd41acdfab0e (patch)
tree799f05877bd8973262da54852b7b8bf9a9916998 /fs/gfs2/locking/nolock/main.c
parenta2c4580797f62b0dd9a48f1e0ce3fe8b8fd76262 (diff)
[GFS2] Use void * instead of typedef for locking module interface
As requested by Jan Engelhardt, this removes the typedefs in the locking module interface and replaces them with void *. Also since we are changing the interface, I've added a few consts as well. Cc: Jan Engelhardt <jengelh@linux01.gwdg.de> Cc: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/locking/nolock/main.c')
-rw-r--r--fs/gfs2/locking/nolock/main.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c
index ba7399787f62..7b263fc6c273 100644
--- a/fs/gfs2/locking/nolock/main.c
+++ b/fs/gfs2/locking/nolock/main.c
@@ -21,10 +21,10 @@ struct nolock_lockspace {
21 unsigned int nl_lvb_size; 21 unsigned int nl_lvb_size;
22}; 22};
23 23
24static struct lm_lockops nolock_ops; 24static const struct lm_lockops nolock_ops;
25 25
26static int nolock_mount(char *table_name, char *host_data, 26static int nolock_mount(char *table_name, char *host_data,
27 lm_callback_t cb, struct gfs2_sbd *sdp, 27 lm_callback_t cb, void *cb_data,
28 unsigned int min_lvb_size, int flags, 28 unsigned int min_lvb_size, int flags,
29 struct lm_lockstruct *lockstruct, 29 struct lm_lockstruct *lockstruct,
30 struct kobject *fskobj) 30 struct kobject *fskobj)
@@ -50,24 +50,24 @@ static int nolock_mount(char *table_name, char *host_data,
50 lockstruct->ls_jid = jid; 50 lockstruct->ls_jid = jid;
51 lockstruct->ls_first = 1; 51 lockstruct->ls_first = 1;
52 lockstruct->ls_lvb_size = min_lvb_size; 52 lockstruct->ls_lvb_size = min_lvb_size;
53 lockstruct->ls_lockspace = (lm_lockspace_t *)nl; 53 lockstruct->ls_lockspace = nl;
54 lockstruct->ls_ops = &nolock_ops; 54 lockstruct->ls_ops = &nolock_ops;
55 lockstruct->ls_flags = LM_LSFLAG_LOCAL; 55 lockstruct->ls_flags = LM_LSFLAG_LOCAL;
56 56
57 return 0; 57 return 0;
58} 58}
59 59
60static void nolock_others_may_mount(lm_lockspace_t *lockspace) 60static void nolock_others_may_mount(void *lockspace)
61{ 61{
62} 62}
63 63
64static void nolock_unmount(lm_lockspace_t *lockspace) 64static void nolock_unmount(void *lockspace)
65{ 65{
66 struct nolock_lockspace *nl = (struct nolock_lockspace *)lockspace; 66 struct nolock_lockspace *nl = lockspace;
67 kfree(nl); 67 kfree(nl);
68} 68}
69 69
70static void nolock_withdraw(lm_lockspace_t *lockspace) 70static void nolock_withdraw(void *lockspace)
71{ 71{
72} 72}
73 73
@@ -80,10 +80,10 @@ static void nolock_withdraw(lm_lockspace_t *lockspace)
80 * Returns: 0 on success, -EXXX on failure 80 * Returns: 0 on success, -EXXX on failure
81 */ 81 */
82 82
83static int nolock_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name, 83static int nolock_get_lock(void *lockspace, struct lm_lockname *name,
84 lm_lock_t **lockp) 84 void **lockp)
85{ 85{
86 *lockp = (lm_lock_t *)lockspace; 86 *lockp = lockspace;
87 return 0; 87 return 0;
88} 88}
89 89
@@ -93,7 +93,7 @@ static int nolock_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name,
93 * 93 *
94 */ 94 */
95 95
96static void nolock_put_lock(lm_lock_t *lock) 96static void nolock_put_lock(void *lock)
97{ 97{
98} 98}
99 99
@@ -107,7 +107,7 @@ static void nolock_put_lock(lm_lock_t *lock)
107 * Returns: A bitmap of LM_OUT_* 107 * Returns: A bitmap of LM_OUT_*
108 */ 108 */
109 109
110static unsigned int nolock_lock(lm_lock_t *lock, unsigned int cur_state, 110static unsigned int nolock_lock(void *lock, unsigned int cur_state,
111 unsigned int req_state, unsigned int flags) 111 unsigned int req_state, unsigned int flags)
112{ 112{
113 return req_state | LM_OUT_CACHEABLE; 113 return req_state | LM_OUT_CACHEABLE;
@@ -121,12 +121,12 @@ static unsigned int nolock_lock(lm_lock_t *lock, unsigned int cur_state,
121 * Returns: 0 121 * Returns: 0
122 */ 122 */
123 123
124static unsigned int nolock_unlock(lm_lock_t *lock, unsigned int cur_state) 124static unsigned int nolock_unlock(void *lock, unsigned int cur_state)
125{ 125{
126 return 0; 126 return 0;
127} 127}
128 128
129static void nolock_cancel(lm_lock_t *lock) 129static void nolock_cancel(void *lock)
130{ 130{
131} 131}
132 132
@@ -138,9 +138,9 @@ static void nolock_cancel(lm_lock_t *lock)
138 * Returns: 0 on success, -EXXX on failure 138 * Returns: 0 on success, -EXXX on failure
139 */ 139 */
140 140
141static int nolock_hold_lvb(lm_lock_t *lock, char **lvbp) 141static int nolock_hold_lvb(void *lock, char **lvbp)
142{ 142{
143 struct nolock_lockspace *nl = (struct nolock_lockspace *)lock; 143 struct nolock_lockspace *nl = lock;
144 int error = 0; 144 int error = 0;
145 145
146 *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL); 146 *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL);
@@ -157,12 +157,12 @@ static int nolock_hold_lvb(lm_lock_t *lock, char **lvbp)
157 * 157 *
158 */ 158 */
159 159
160static void nolock_unhold_lvb(lm_lock_t *lock, char *lvb) 160static void nolock_unhold_lvb(void *lock, char *lvb)
161{ 161{
162 kfree(lvb); 162 kfree(lvb);
163} 163}
164 164
165static int nolock_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name, 165static int nolock_plock_get(void *lockspace, struct lm_lockname *name,
166 struct file *file, struct file_lock *fl) 166 struct file *file, struct file_lock *fl)
167{ 167{
168 struct file_lock tmp; 168 struct file_lock tmp;
@@ -176,7 +176,7 @@ static int nolock_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name,
176 return 0; 176 return 0;
177} 177}
178 178
179static int nolock_plock(lm_lockspace_t *lockspace, struct lm_lockname *name, 179static int nolock_plock(void *lockspace, struct lm_lockname *name,
180 struct file *file, int cmd, struct file_lock *fl) 180 struct file *file, int cmd, struct file_lock *fl)
181{ 181{
182 int error; 182 int error;
@@ -184,7 +184,7 @@ static int nolock_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
184 return error; 184 return error;
185} 185}
186 186
187static int nolock_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name, 187static int nolock_punlock(void *lockspace, struct lm_lockname *name,
188 struct file *file, struct file_lock *fl) 188 struct file *file, struct file_lock *fl)
189{ 189{
190 int error; 190 int error;
@@ -192,12 +192,12 @@ static int nolock_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name,
192 return error; 192 return error;
193} 193}
194 194
195static void nolock_recovery_done(lm_lockspace_t *lockspace, unsigned int jid, 195static void nolock_recovery_done(void *lockspace, unsigned int jid,
196 unsigned int message) 196 unsigned int message)
197{ 197{
198} 198}
199 199
200static struct lm_lockops nolock_ops = { 200static const struct lm_lockops nolock_ops = {
201 .lm_proto_name = "lock_nolock", 201 .lm_proto_name = "lock_nolock",
202 .lm_mount = nolock_mount, 202 .lm_mount = nolock_mount,
203 .lm_others_may_mount = nolock_others_may_mount, 203 .lm_others_may_mount = nolock_others_may_mount,