diff options
-rw-r--r-- | fs/locks.c | 18 |
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 | */ |
242 | void locks_copy_lock(struct file_lock *new, struct file_lock *fl) | 242 | static 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 | |||
255 | void 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 | } |