From ab6dc6037ebdeb455ba62129c4ce8d2137c3cb90 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 20 Mar 2006 13:44:38 -0500 Subject: [PATCH] --- yaml --- r: 23919 b: refs/heads/master c: 0996905f9301c2ff4c021982c42a15b35e74bf1c h: refs/heads/master i: 23917: 3140aedabe65cd59f1190bd2ea72032b0556d79a 23915: 15a0cfe1d15200c1bea00fb732a22253f67c7ecb 23911: 21b5927ec322ff2e17adf7386dcd7807a5603790 23903: 16f545cf129b2bee899d35c85405002c319e47ef v: v3 --- [refs] | 2 +- trunk/fs/locks.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 859c625acfb1..ac830b57ec7a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3feb2d49394b7874348a6e43c076b780c1d222c5 +refs/heads/master: 0996905f9301c2ff4c021982c42a15b35e74bf1c diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index 231b23c12c3d..c83b5dbe0ed9 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -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; }