aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/clntproc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:39 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:39 -0500
commit5e1abf8cb713a0b94f5a400c7b9b797990cd9dec (patch)
tree717a5eb95c4615855edc5f66268154cbe4118326 /fs/lockd/clntproc.c
parent6849c0cab69f5d1a0fc7b05fa5bfb3dec53f86df (diff)
lockd: Clean up of the server-side GRANTED code
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/clntproc.c')
-rw-r--r--fs/lockd/clntproc.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index acc3eb13a02b..80ae3127699f 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -148,49 +148,6 @@ static void nlmclnt_release_lockargs(struct nlm_rqst *req)
148} 148}
149 149
150/* 150/*
151 * Initialize arguments for GRANTED call. The nlm_rqst structure
152 * has been cleared already.
153 */
154int
155nlmclnt_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock)
156{
157 locks_copy_lock(&call->a_args.lock.fl, &lock->fl);
158 memcpy(&call->a_args.lock.fh, &lock->fh, sizeof(call->a_args.lock.fh));
159 call->a_args.lock.caller = system_utsname.nodename;
160 call->a_args.lock.oh.len = lock->oh.len;
161
162 /* set default data area */
163 call->a_args.lock.oh.data = call->a_owner;
164 call->a_args.lock.svid = lock->fl.fl_pid;
165
166 if (lock->oh.len > NLMCLNT_OHSIZE) {
167 void *data = kmalloc(lock->oh.len, GFP_KERNEL);
168 if (!data) {
169 nlmclnt_freegrantargs(call);
170 return 0;
171 }
172 call->a_args.lock.oh.data = (u8 *) data;
173 }
174
175 memcpy(call->a_args.lock.oh.data, lock->oh.data, lock->oh.len);
176 return 1;
177}
178
179void
180nlmclnt_freegrantargs(struct nlm_rqst *call)
181{
182 struct file_lock *fl = &call->a_args.lock.fl;
183 /*
184 * Check whether we allocated memory for the owner.
185 */
186 if (call->a_args.lock.oh.data != (u8 *) call->a_owner) {
187 kfree(call->a_args.lock.oh.data);
188 }
189 if (fl->fl_ops && fl->fl_ops->fl_release_private)
190 fl->fl_ops->fl_release_private(fl);
191}
192
193/*
194 * This is the main entry point for the NLM client. 151 * This is the main entry point for the NLM client.
195 */ 152 */
196int 153int