aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:38 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:38 -0500
commit0996905f9301c2ff4c021982c42a15b35e74bf1c (patch)
tree29bffccbd76c2fc0659f6d94a95f95b2d940f7a5 /fs/locks.c
parent3feb2d49394b7874348a6e43c076b780c1d222c5 (diff)
lockd: posix_test_lock() should not call locks_copy_lock()
The caller of posix_test_lock() should never need to look at the lock private data, so do not copy that information. This also means that there is no need to call the fl_release_private methods. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 231b23c12c3d..c83b5dbe0ed9 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -239,17 +239,25 @@ static void locks_copy_private(struct file_lock *new, struct file_lock *fl)
239/* 239/*
240 * Initialize a new lock from an existing file_lock structure. 240 * Initialize a new lock from an existing file_lock structure.
241 */ 241 */
242void locks_copy_lock(struct file_lock *new, struct file_lock *fl) 242static void __locks_copy_lock(struct file_lock *new, const struct file_lock *fl)
243{ 243{
244 locks_release_private(new);
245
246 new->fl_owner = fl->fl_owner; 244 new->fl_owner = fl->fl_owner;
247 new->fl_pid = fl->fl_pid; 245 new->fl_pid = fl->fl_pid;
248 new->fl_file = fl->fl_file; 246 new->fl_file = NULL;
249 new->fl_flags = fl->fl_flags; 247 new->fl_flags = fl->fl_flags;
250 new->fl_type = fl->fl_type; 248 new->fl_type = fl->fl_type;
251 new->fl_start = fl->fl_start; 249 new->fl_start = fl->fl_start;
252 new->fl_end = fl->fl_end; 250 new->fl_end = fl->fl_end;
251 new->fl_ops = NULL;
252 new->fl_lmops = NULL;
253}
254
255void locks_copy_lock(struct file_lock *new, struct file_lock *fl)
256{
257 locks_release_private(new);
258
259 __locks_copy_lock(new, fl);
260 new->fl_file = fl->fl_file;
253 new->fl_ops = fl->fl_ops; 261 new->fl_ops = fl->fl_ops;
254 new->fl_lmops = fl->fl_lmops; 262 new->fl_lmops = fl->fl_lmops;
255 263
@@ -686,7 +694,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl,
686 break; 694 break;
687 } 695 }
688 if (cfl) { 696 if (cfl) {
689 locks_copy_lock(conflock, cfl); 697 __locks_copy_lock(conflock, cfl);
690 unlock_kernel(); 698 unlock_kernel();
691 return 1; 699 return 1;
692 } 700 }