aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5879b23e0c9..e99d674149a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1154,7 +1154,7 @@ static int nfs4_open_recover_helper(struct nfs4_opendata *opendata, fmode_t fmod
1154 newstate = nfs4_opendata_to_nfs4_state(opendata); 1154 newstate = nfs4_opendata_to_nfs4_state(opendata);
1155 if (IS_ERR(newstate)) 1155 if (IS_ERR(newstate))
1156 return PTR_ERR(newstate); 1156 return PTR_ERR(newstate);
1157 nfs4_close_state(&opendata->path, newstate, fmode); 1157 nfs4_close_state(newstate, fmode);
1158 *res = newstate; 1158 *res = newstate;
1159 return 0; 1159 return 0;
1160} 1160}
@@ -1352,7 +1352,7 @@ static void nfs4_open_confirm_release(void *calldata)
1352 goto out_free; 1352 goto out_free;
1353 state = nfs4_opendata_to_nfs4_state(data); 1353 state = nfs4_opendata_to_nfs4_state(data);
1354 if (!IS_ERR(state)) 1354 if (!IS_ERR(state))
1355 nfs4_close_state(&data->path, state, data->o_arg.fmode); 1355 nfs4_close_state(state, data->o_arg.fmode);
1356out_free: 1356out_free:
1357 nfs4_opendata_put(data); 1357 nfs4_opendata_put(data);
1358} 1358}
@@ -1497,7 +1497,7 @@ static void nfs4_open_release(void *calldata)
1497 goto out_free; 1497 goto out_free;
1498 state = nfs4_opendata_to_nfs4_state(data); 1498 state = nfs4_opendata_to_nfs4_state(data);
1499 if (!IS_ERR(state)) 1499 if (!IS_ERR(state))
1500 nfs4_close_state(&data->path, state, data->o_arg.fmode); 1500 nfs4_close_state(state, data->o_arg.fmode);
1501out_free: 1501out_free:
1502 nfs4_opendata_put(data); 1502 nfs4_opendata_put(data);
1503} 1503}
@@ -1873,7 +1873,6 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
1873} 1873}
1874 1874
1875struct nfs4_closedata { 1875struct nfs4_closedata {
1876 struct path path;
1877 struct inode *inode; 1876 struct inode *inode;
1878 struct nfs4_state *state; 1877 struct nfs4_state *state;
1879 struct nfs_closeargs arg; 1878 struct nfs_closeargs arg;
@@ -1888,13 +1887,14 @@ static void nfs4_free_closedata(void *data)
1888{ 1887{
1889 struct nfs4_closedata *calldata = data; 1888 struct nfs4_closedata *calldata = data;
1890 struct nfs4_state_owner *sp = calldata->state->owner; 1889 struct nfs4_state_owner *sp = calldata->state->owner;
1890 struct super_block *sb = calldata->state->inode->i_sb;
1891 1891
1892 if (calldata->roc) 1892 if (calldata->roc)
1893 pnfs_roc_release(calldata->state->inode); 1893 pnfs_roc_release(calldata->state->inode);
1894 nfs4_put_open_state(calldata->state); 1894 nfs4_put_open_state(calldata->state);
1895 nfs_free_seqid(calldata->arg.seqid); 1895 nfs_free_seqid(calldata->arg.seqid);
1896 nfs4_put_state_owner(sp); 1896 nfs4_put_state_owner(sp);
1897 path_put(&calldata->path); 1897 nfs_sb_deactive(sb);
1898 kfree(calldata); 1898 kfree(calldata);
1899} 1899}
1900 1900
@@ -2014,7 +2014,7 @@ static const struct rpc_call_ops nfs4_close_ops = {
2014 * 2014 *
2015 * NOTE: Caller must be holding the sp->so_owner semaphore! 2015 * NOTE: Caller must be holding the sp->so_owner semaphore!
2016 */ 2016 */
2017int nfs4_do_close(struct path *path, struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc) 2017int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait, bool roc)
2018{ 2018{
2019 struct nfs_server *server = NFS_SERVER(state->inode); 2019 struct nfs_server *server = NFS_SERVER(state->inode);
2020 struct nfs4_closedata *calldata; 2020 struct nfs4_closedata *calldata;
@@ -2050,8 +2050,7 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, gfp_t gfp_mask, i
2050 calldata->res.seqid = calldata->arg.seqid; 2050 calldata->res.seqid = calldata->arg.seqid;
2051 calldata->res.server = server; 2051 calldata->res.server = server;
2052 calldata->roc = roc; 2052 calldata->roc = roc;
2053 path_get(path); 2053 nfs_sb_active(calldata->inode->i_sb);
2054 calldata->path = *path;
2055 2054
2056 msg.rpc_argp = &calldata->arg; 2055 msg.rpc_argp = &calldata->arg;
2057 msg.rpc_resp = &calldata->res; 2056 msg.rpc_resp = &calldata->res;
@@ -2092,9 +2091,9 @@ static void nfs4_close_context(struct nfs_open_context *ctx, int is_sync)
2092 if (ctx->state == NULL) 2091 if (ctx->state == NULL)
2093 return; 2092 return;
2094 if (is_sync) 2093 if (is_sync)
2095 nfs4_close_sync(&ctx->path, ctx->state, ctx->mode); 2094 nfs4_close_sync(ctx->state, ctx->mode);
2096 else 2095 else
2097 nfs4_close_state(&ctx->path, ctx->state, ctx->mode); 2096 nfs4_close_state(ctx->state, ctx->mode);
2098} 2097}
2099 2098
2100static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle) 2099static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle)
@@ -2642,7 +2641,7 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
2642 if (ctx != NULL) 2641 if (ctx != NULL)
2643 ctx->state = state; 2642 ctx->state = state;
2644 else 2643 else
2645 nfs4_close_sync(path, state, fmode); 2644 nfs4_close_sync(state, fmode);
2646out: 2645out:
2647 return status; 2646 return status;
2648} 2647}