diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:38 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:38 -0500 |
commit | 0996905f9301c2ff4c021982c42a15b35e74bf1c (patch) | |
tree | 29bffccbd76c2fc0659f6d94a95f95b2d940f7a5 /fs/locks.c | |
parent | 3feb2d49394b7874348a6e43c076b780c1d222c5 (diff) | |
download | kernel_samsung_espresso10-0996905f9301c2ff4c021982c42a15b35e74bf1c.zip kernel_samsung_espresso10-0996905f9301c2ff4c021982c42a15b35e74bf1c.tar.gz kernel_samsung_espresso10-0996905f9301c2ff4c021982c42a15b35e74bf1c.tar.bz2 |
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.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -239,17 +239,25 @@ static void locks_copy_private(struct file_lock *new, struct file_lock *fl) /* * Initialize a new lock from an existing file_lock structure. */ -void locks_copy_lock(struct file_lock *new, struct file_lock *fl) +static void __locks_copy_lock(struct file_lock *new, const struct file_lock *fl) { - locks_release_private(new); - new->fl_owner = fl->fl_owner; new->fl_pid = fl->fl_pid; - new->fl_file = fl->fl_file; + new->fl_file = NULL; new->fl_flags = fl->fl_flags; new->fl_type = fl->fl_type; new->fl_start = fl->fl_start; new->fl_end = fl->fl_end; + new->fl_ops = NULL; + new->fl_lmops = NULL; +} + +void locks_copy_lock(struct file_lock *new, struct file_lock *fl) +{ + locks_release_private(new); + + __locks_copy_lock(new, fl); + new->fl_file = fl->fl_file; new->fl_ops = fl->fl_ops; new->fl_lmops = fl->fl_lmops; @@ -686,7 +694,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl, break; } if (cfl) { - locks_copy_lock(conflock, cfl); + __locks_copy_lock(conflock, cfl); unlock_kernel(); return 1; } |