diff options
author | NeilBrown <neilb@suse.com> | 2018-12-02 19:30:30 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2018-12-19 13:52:45 -0500 |
commit | ddf529eeed59184c49dcad1633c11831f822bf6b (patch) | |
tree | c648594f18928ae2897f01ade6ca8ef337cec46f /fs/nfs/inode.c | |
parent | 1de7eea92946d7b581a8cd26084410913c80e594 (diff) |
NFS: move credential expiry tracking out of SUNRPC into NFS.
NFS needs to know when a credential is about to expire so that
it can modify write-back behaviour to finish the write inside the
expiry time.
It currently uses functions in SUNRPC code which make use of a
fairly complex callback scheme and flags in the generic credientials.
As I am working to discard the generic credentials, this has to change.
This patch moves the logic into NFS, in part by finding and caching
the low-level credential in the open_context. We then make direct
cred-api calls on that.
This makes the code much simpler and removes a dependency on generic
rpc credentials.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 5b1eee4952b7..aea015743172 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -962,6 +962,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, | |||
962 | nfs_sb_active(dentry->d_sb); | 962 | nfs_sb_active(dentry->d_sb); |
963 | ctx->dentry = dget(dentry); | 963 | ctx->dentry = dget(dentry); |
964 | ctx->cred = cred; | 964 | ctx->cred = cred; |
965 | ctx->ll_cred = NULL; | ||
965 | ctx->state = NULL; | 966 | ctx->state = NULL; |
966 | ctx->mode = f_mode; | 967 | ctx->mode = f_mode; |
967 | ctx->flags = 0; | 968 | ctx->flags = 0; |
@@ -1001,6 +1002,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) | |||
1001 | put_rpccred(ctx->cred); | 1002 | put_rpccred(ctx->cred); |
1002 | dput(ctx->dentry); | 1003 | dput(ctx->dentry); |
1003 | nfs_sb_deactive(sb); | 1004 | nfs_sb_deactive(sb); |
1005 | put_rpccred(ctx->ll_cred); | ||
1004 | kfree(ctx->mdsthreshold); | 1006 | kfree(ctx->mdsthreshold); |
1005 | kfree_rcu(ctx, rcu_head); | 1007 | kfree_rcu(ctx, rcu_head); |
1006 | } | 1008 | } |