diff options
| -rw-r--r-- | fs/nfsd/nfs4state.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 56347e0ac88d..b7f818b0580c 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
| @@ -2310,22 +2310,6 @@ void nfsd_release_deleg_cb(struct file_lock *fl) | |||
| 2310 | } | 2310 | } |
| 2311 | 2311 | ||
| 2312 | /* | 2312 | /* |
| 2313 | * Set the delegation file_lock back pointer. | ||
| 2314 | * | ||
| 2315 | * Called from setlease() with lock_kernel() held. | ||
| 2316 | */ | ||
| 2317 | static | ||
| 2318 | void nfsd_copy_lock_deleg_cb(struct file_lock *new, struct file_lock *fl) | ||
| 2319 | { | ||
| 2320 | struct nfs4_delegation *dp = (struct nfs4_delegation *)new->fl_owner; | ||
| 2321 | |||
| 2322 | dprintk("NFSD: nfsd_copy_lock_deleg_cb: new fl %p dp %p\n", new, dp); | ||
| 2323 | if (!dp) | ||
| 2324 | return; | ||
| 2325 | dp->dl_flock = new; | ||
| 2326 | } | ||
| 2327 | |||
| 2328 | /* | ||
| 2329 | * Called from setlease() with lock_kernel() held | 2313 | * Called from setlease() with lock_kernel() held |
| 2330 | */ | 2314 | */ |
| 2331 | static | 2315 | static |
| @@ -2355,7 +2339,6 @@ int nfsd_change_deleg_cb(struct file_lock **onlist, int arg) | |||
| 2355 | static const struct lock_manager_operations nfsd_lease_mng_ops = { | 2339 | static const struct lock_manager_operations nfsd_lease_mng_ops = { |
| 2356 | .fl_break = nfsd_break_deleg_cb, | 2340 | .fl_break = nfsd_break_deleg_cb, |
| 2357 | .fl_release_private = nfsd_release_deleg_cb, | 2341 | .fl_release_private = nfsd_release_deleg_cb, |
| 2358 | .fl_copy_lock = nfsd_copy_lock_deleg_cb, | ||
| 2359 | .fl_mylease = nfsd_same_client_deleg_cb, | 2342 | .fl_mylease = nfsd_same_client_deleg_cb, |
| 2360 | .fl_change = nfsd_change_deleg_cb, | 2343 | .fl_change = nfsd_change_deleg_cb, |
| 2361 | }; | 2344 | }; |
| @@ -2661,12 +2644,14 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta | |||
| 2661 | fl->fl_file = find_readable_file(stp->st_file); | 2644 | fl->fl_file = find_readable_file(stp->st_file); |
| 2662 | BUG_ON(!fl->fl_file); | 2645 | BUG_ON(!fl->fl_file); |
| 2663 | fl->fl_pid = current->tgid; | 2646 | fl->fl_pid = current->tgid; |
| 2647 | dp->dl_flock = fl; | ||
| 2664 | 2648 | ||
| 2665 | /* vfs_setlease checks to see if delegation should be handed out. | 2649 | /* vfs_setlease checks to see if delegation should be handed out. |
| 2666 | * the lock_manager callbacks fl_mylease and fl_change are used | 2650 | * the lock_manager callbacks fl_mylease and fl_change are used |
| 2667 | */ | 2651 | */ |
| 2668 | if ((status = vfs_setlease(fl->fl_file, fl->fl_type, &fl))) { | 2652 | if ((status = vfs_setlease(fl->fl_file, fl->fl_type, &fl))) { |
| 2669 | dprintk("NFSD: setlease failed [%d], no delegation\n", status); | 2653 | dprintk("NFSD: setlease failed [%d], no delegation\n", status); |
| 2654 | dp->dl_flock = NULL; | ||
| 2670 | unhash_delegation(dp); | 2655 | unhash_delegation(dp); |
| 2671 | flag = NFS4_OPEN_DELEGATE_NONE; | 2656 | flag = NFS4_OPEN_DELEGATE_NONE; |
| 2672 | goto out; | 2657 | goto out; |
