diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-01-31 11:54:04 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-02-14 10:35:18 -0500 |
commit | 6b57d9c86d0ab11c091b6db2edff8b5553fd445b (patch) | |
tree | fdd5ed018e05e068f3a96766dbea85f2cb3cc8ef /fs/nfsd | |
parent | 3aa6e0aa8ab3e64bbfba092c64d42fd1d006b124 (diff) |
nfsd4: split up nfsd_break_deleg_cb
We'll be adding some more code here soon.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d98d0213285d..ceb66170fda3 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2329,23 +2329,8 @@ nfs4_file_downgrade(struct nfs4_file *fp, unsigned int share_access) | |||
2329 | nfs4_file_put_access(fp, O_RDONLY); | 2329 | nfs4_file_put_access(fp, O_RDONLY); |
2330 | } | 2330 | } |
2331 | 2331 | ||
2332 | /* | 2332 | static void nfsd_break_one_deleg(struct nfs4_delegation *dp) |
2333 | * Spawn a thread to perform a recall on the delegation represented | ||
2334 | * by the lease (file_lock) | ||
2335 | * | ||
2336 | * Called from break_lease() with lock_flocks() held. | ||
2337 | * Note: we assume break_lease will only call this *once* for any given | ||
2338 | * lease. | ||
2339 | */ | ||
2340 | static | ||
2341 | void nfsd_break_deleg_cb(struct file_lock *fl) | ||
2342 | { | 2333 | { |
2343 | struct nfs4_delegation *dp = (struct nfs4_delegation *)fl->fl_owner; | ||
2344 | |||
2345 | dprintk("NFSD nfsd_break_deleg_cb: dp %p fl %p\n",dp,fl); | ||
2346 | if (!dp) | ||
2347 | return; | ||
2348 | |||
2349 | /* We're assuming the state code never drops its reference | 2334 | /* We're assuming the state code never drops its reference |
2350 | * without first removing the lease. Since we're in this lease | 2335 | * without first removing the lease. Since we're in this lease |
2351 | * callback (and since the lease code is serialized by the kernel | 2336 | * callback (and since the lease code is serialized by the kernel |
@@ -2360,15 +2345,28 @@ void nfsd_break_deleg_cb(struct file_lock *fl) | |||
2360 | /* only place dl_time is set. protected by lock_flocks*/ | 2345 | /* only place dl_time is set. protected by lock_flocks*/ |
2361 | dp->dl_time = get_seconds(); | 2346 | dp->dl_time = get_seconds(); |
2362 | 2347 | ||
2348 | nfsd4_cb_recall(dp); | ||
2349 | } | ||
2350 | |||
2351 | /* | ||
2352 | * Called from break_lease() with lock_flocks() held. | ||
2353 | * Note: we assume break_lease will only call this *once* for any given | ||
2354 | * lease. | ||
2355 | */ | ||
2356 | static void nfsd_break_deleg_cb(struct file_lock *fl) | ||
2357 | { | ||
2358 | struct nfs4_delegation *dp = (struct nfs4_delegation *)fl->fl_owner; | ||
2359 | |||
2360 | BUG_ON(!dp); | ||
2363 | /* | 2361 | /* |
2364 | * We don't want the locks code to timeout the lease for us; | 2362 | * We don't want the locks code to timeout the lease for us; |
2365 | * we'll remove it ourself if the delegation isn't returned | 2363 | * we'll remove it ourself if the delegation isn't returned |
2366 | * in time. | 2364 | * in time: |
2367 | */ | 2365 | */ |
2368 | fl->fl_break_time = 0; | 2366 | fl->fl_break_time = 0; |
2369 | 2367 | ||
2368 | nfsd_break_one_deleg(dp); | ||
2370 | dp->dl_file->fi_had_conflict = true; | 2369 | dp->dl_file->fi_had_conflict = true; |
2371 | nfsd4_cb_recall(dp); | ||
2372 | } | 2370 | } |
2373 | 2371 | ||
2374 | static | 2372 | static |