diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index eae83bf96c6d..655237fc46df 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -6129,11 +6129,13 @@ static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags) | |||
6129 | static void nfs4_layoutget_release(void *calldata) | 6129 | static void nfs4_layoutget_release(void *calldata) |
6130 | { | 6130 | { |
6131 | struct nfs4_layoutget *lgp = calldata; | 6131 | struct nfs4_layoutget *lgp = calldata; |
6132 | struct nfs_server *server = NFS_SERVER(lgp->args.inode); | 6132 | struct inode *inode = lgp->args.inode; |
6133 | struct nfs_server *server = NFS_SERVER(inode); | ||
6133 | size_t max_pages = max_response_pages(server); | 6134 | size_t max_pages = max_response_pages(server); |
6134 | 6135 | ||
6135 | dprintk("--> %s\n", __func__); | 6136 | dprintk("--> %s\n", __func__); |
6136 | nfs4_free_pages(lgp->args.layout.pages, max_pages); | 6137 | nfs4_free_pages(lgp->args.layout.pages, max_pages); |
6138 | pnfs_put_layout_hdr(NFS_I(inode)->layout); | ||
6137 | put_nfs_open_context(lgp->args.ctx); | 6139 | put_nfs_open_context(lgp->args.ctx); |
6138 | kfree(calldata); | 6140 | kfree(calldata); |
6139 | dprintk("<-- %s\n", __func__); | 6141 | dprintk("<-- %s\n", __func__); |
@@ -6148,7 +6150,8 @@ static const struct rpc_call_ops nfs4_layoutget_call_ops = { | |||
6148 | struct pnfs_layout_segment * | 6150 | struct pnfs_layout_segment * |
6149 | nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags) | 6151 | nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags) |
6150 | { | 6152 | { |
6151 | struct nfs_server *server = NFS_SERVER(lgp->args.inode); | 6153 | struct inode *inode = lgp->args.inode; |
6154 | struct nfs_server *server = NFS_SERVER(inode); | ||
6152 | size_t max_pages = max_response_pages(server); | 6155 | size_t max_pages = max_response_pages(server); |
6153 | struct rpc_task *task; | 6156 | struct rpc_task *task; |
6154 | struct rpc_message msg = { | 6157 | struct rpc_message msg = { |
@@ -6178,6 +6181,10 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags) | |||
6178 | lgp->res.layoutp = &lgp->args.layout; | 6181 | lgp->res.layoutp = &lgp->args.layout; |
6179 | lgp->res.seq_res.sr_slot = NULL; | 6182 | lgp->res.seq_res.sr_slot = NULL; |
6180 | nfs41_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0); | 6183 | nfs41_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0); |
6184 | |||
6185 | /* nfs4_layoutget_release calls pnfs_put_layout_hdr */ | ||
6186 | pnfs_get_layout_hdr(NFS_I(inode)->layout); | ||
6187 | |||
6181 | task = rpc_run_task(&task_setup_data); | 6188 | task = rpc_run_task(&task_setup_data); |
6182 | if (IS_ERR(task)) | 6189 | if (IS_ERR(task)) |
6183 | return ERR_CAST(task); | 6190 | return ERR_CAST(task); |