diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index cc04b6e409ed..5375862075de 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3336,12 +3336,12 @@ static int nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle, | |||
3336 | 3336 | ||
3337 | void __nfs4_read_done_cb(struct nfs_read_data *data) | 3337 | void __nfs4_read_done_cb(struct nfs_read_data *data) |
3338 | { | 3338 | { |
3339 | nfs_invalidate_atime(data->inode); | 3339 | nfs_invalidate_atime(data->header->inode); |
3340 | } | 3340 | } |
3341 | 3341 | ||
3342 | static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_read_data *data) | 3342 | static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_read_data *data) |
3343 | { | 3343 | { |
3344 | struct nfs_server *server = NFS_SERVER(data->inode); | 3344 | struct nfs_server *server = NFS_SERVER(data->header->inode); |
3345 | 3345 | ||
3346 | if (nfs4_async_handle_error(task, server, data->args.context->state) == -EAGAIN) { | 3346 | if (nfs4_async_handle_error(task, server, data->args.context->state) == -EAGAIN) { |
3347 | rpc_restart_call_prepare(task); | 3347 | rpc_restart_call_prepare(task); |
@@ -3376,7 +3376,7 @@ static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message | |||
3376 | 3376 | ||
3377 | static void nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) | 3377 | static void nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) |
3378 | { | 3378 | { |
3379 | if (nfs4_setup_sequence(NFS_SERVER(data->inode), | 3379 | if (nfs4_setup_sequence(NFS_SERVER(data->header->inode), |
3380 | &data->args.seq_args, | 3380 | &data->args.seq_args, |
3381 | &data->res.seq_res, | 3381 | &data->res.seq_res, |
3382 | task)) | 3382 | task)) |
@@ -3387,22 +3387,25 @@ static void nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_da | |||
3387 | /* Reset the the nfs_read_data to send the read to the MDS. */ | 3387 | /* Reset the the nfs_read_data to send the read to the MDS. */ |
3388 | void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data) | 3388 | void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data) |
3389 | { | 3389 | { |
3390 | struct nfs_pgio_header *hdr = data->header; | ||
3391 | struct inode *inode = hdr->inode; | ||
3392 | |||
3390 | dprintk("%s Reset task for i/o through\n", __func__); | 3393 | dprintk("%s Reset task for i/o through\n", __func__); |
3391 | put_lseg(data->lseg); | 3394 | put_lseg(hdr->lseg); |
3392 | data->lseg = NULL; | 3395 | hdr->lseg = NULL; |
3396 | data->ds_clp = NULL; | ||
3393 | /* offsets will differ in the dense stripe case */ | 3397 | /* offsets will differ in the dense stripe case */ |
3394 | data->args.offset = data->mds_offset; | 3398 | data->args.offset = data->mds_offset; |
3395 | data->ds_clp = NULL; | 3399 | data->args.fh = NFS_FH(inode); |
3396 | data->args.fh = NFS_FH(data->inode); | ||
3397 | data->read_done_cb = nfs4_read_done_cb; | 3400 | data->read_done_cb = nfs4_read_done_cb; |
3398 | task->tk_ops = data->mds_ops; | 3401 | task->tk_ops = hdr->mds_ops; |
3399 | rpc_task_reset_client(task, NFS_CLIENT(data->inode)); | 3402 | rpc_task_reset_client(task, NFS_CLIENT(inode)); |
3400 | } | 3403 | } |
3401 | EXPORT_SYMBOL_GPL(nfs4_reset_read); | 3404 | EXPORT_SYMBOL_GPL(nfs4_reset_read); |
3402 | 3405 | ||
3403 | static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data) | 3406 | static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data) |
3404 | { | 3407 | { |
3405 | struct inode *inode = data->inode; | 3408 | struct inode *inode = data->header->inode; |
3406 | 3409 | ||
3407 | if (nfs4_async_handle_error(task, NFS_SERVER(inode), data->args.context->state) == -EAGAIN) { | 3410 | if (nfs4_async_handle_error(task, NFS_SERVER(inode), data->args.context->state) == -EAGAIN) { |
3408 | rpc_restart_call_prepare(task); | 3411 | rpc_restart_call_prepare(task); |
@@ -3426,25 +3429,28 @@ static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data) | |||
3426 | /* Reset the the nfs_write_data to send the write to the MDS. */ | 3429 | /* Reset the the nfs_write_data to send the write to the MDS. */ |
3427 | void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data) | 3430 | void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data) |
3428 | { | 3431 | { |
3432 | struct nfs_pgio_header *hdr = data->header; | ||
3433 | struct inode *inode = hdr->inode; | ||
3434 | |||
3429 | dprintk("%s Reset task for i/o through\n", __func__); | 3435 | dprintk("%s Reset task for i/o through\n", __func__); |
3430 | put_lseg(data->lseg); | 3436 | put_lseg(hdr->lseg); |
3431 | data->lseg = NULL; | 3437 | hdr->lseg = NULL; |
3432 | data->ds_clp = NULL; | 3438 | data->ds_clp = NULL; |
3433 | data->write_done_cb = nfs4_write_done_cb; | 3439 | data->write_done_cb = nfs4_write_done_cb; |
3434 | data->args.fh = NFS_FH(data->inode); | 3440 | data->args.fh = NFS_FH(inode); |
3435 | data->args.bitmask = data->res.server->cache_consistency_bitmask; | 3441 | data->args.bitmask = data->res.server->cache_consistency_bitmask; |
3436 | data->args.offset = data->mds_offset; | 3442 | data->args.offset = data->mds_offset; |
3437 | data->res.fattr = &data->fattr; | 3443 | data->res.fattr = &data->fattr; |
3438 | task->tk_ops = data->mds_ops; | 3444 | task->tk_ops = hdr->mds_ops; |
3439 | rpc_task_reset_client(task, NFS_CLIENT(data->inode)); | 3445 | rpc_task_reset_client(task, NFS_CLIENT(inode)); |
3440 | } | 3446 | } |
3441 | EXPORT_SYMBOL_GPL(nfs4_reset_write); | 3447 | EXPORT_SYMBOL_GPL(nfs4_reset_write); |
3442 | 3448 | ||
3443 | static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg) | 3449 | static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg) |
3444 | { | 3450 | { |
3445 | struct nfs_server *server = NFS_SERVER(data->inode); | 3451 | struct nfs_server *server = NFS_SERVER(data->header->inode); |
3446 | 3452 | ||
3447 | if (data->lseg) { | 3453 | if (data->header->lseg) { |
3448 | data->args.bitmask = NULL; | 3454 | data->args.bitmask = NULL; |
3449 | data->res.fattr = NULL; | 3455 | data->res.fattr = NULL; |
3450 | } else | 3456 | } else |
@@ -3460,7 +3466,7 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag | |||
3460 | 3466 | ||
3461 | static void nfs4_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data) | 3467 | static void nfs4_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data) |
3462 | { | 3468 | { |
3463 | if (nfs4_setup_sequence(NFS_SERVER(data->inode), | 3469 | if (nfs4_setup_sequence(NFS_SERVER(data->header->inode), |
3464 | &data->args.seq_args, | 3470 | &data->args.seq_args, |
3465 | &data->res.seq_res, | 3471 | &data->res.seq_res, |
3466 | task)) | 3472 | task)) |