diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/client.c | 18 | ||||
-rw-r--r-- | fs/nfs/delegation.c | 1 | ||||
-rw-r--r-- | fs/nfs/dir.c | 3 | ||||
-rw-r--r-- | fs/nfs/file.c | 1 | ||||
-rw-r--r-- | fs/nfs/inode.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4_fs.h | 6 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 41 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 2 | ||||
-rw-r--r-- | fs/nfs/read.c | 1 | ||||
-rw-r--r-- | fs/nfs/write.c | 1 |
10 files changed, 41 insertions, 34 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index c2d061675d80..8d25ccb2d51d 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1242,20 +1242,6 @@ error: | |||
1242 | return error; | 1242 | return error; |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | /* | ||
1246 | * Initialize a session. | ||
1247 | * Note: save the mount rsize and wsize for create_server negotiation. | ||
1248 | */ | ||
1249 | static void nfs4_init_session(struct nfs_client *clp, | ||
1250 | unsigned int wsize, unsigned int rsize) | ||
1251 | { | ||
1252 | #if defined(CONFIG_NFS_V4_1) | ||
1253 | if (nfs4_has_session(clp)) { | ||
1254 | clp->cl_session->fc_attrs.max_rqst_sz = wsize; | ||
1255 | clp->cl_session->fc_attrs.max_resp_sz = rsize; | ||
1256 | } | ||
1257 | #endif /* CONFIG_NFS_V4_1 */ | ||
1258 | } | ||
1259 | 1245 | ||
1260 | /* | 1246 | /* |
1261 | * Session has been established, and the client marked ready. | 1247 | * Session has been established, and the client marked ready. |
@@ -1350,7 +1336,9 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data, | |||
1350 | BUG_ON(!server->nfs_client->rpc_ops); | 1336 | BUG_ON(!server->nfs_client->rpc_ops); |
1351 | BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); | 1337 | BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); |
1352 | 1338 | ||
1353 | nfs4_init_session(server->nfs_client, server->wsize, server->rsize); | 1339 | error = nfs4_init_session(server); |
1340 | if (error < 0) | ||
1341 | goto error; | ||
1354 | 1342 | ||
1355 | /* Probe the root fh to retrieve its FSID */ | 1343 | /* Probe the root fh to retrieve its FSID */ |
1356 | error = nfs4_path_walk(server, mntfh, data->nfs_server.export_path); | 1344 | error = nfs4_path_walk(server, mntfh, data->nfs_server.export_path); |
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index af05b918cb5b..6dd48a4405b4 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/smp_lock.h> | ||
13 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
14 | 15 | ||
15 | #include <linux/nfs4.h> | 16 | #include <linux/nfs4.h> |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 89f98e9a024b..32062c33c859 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/nfs_fs.h> | 29 | #include <linux/nfs_fs.h> |
30 | #include <linux/nfs_mount.h> | 30 | #include <linux/nfs_mount.h> |
31 | #include <linux/pagemap.h> | 31 | #include <linux/pagemap.h> |
32 | #include <linux/smp_lock.h> | ||
33 | #include <linux/pagevec.h> | 32 | #include <linux/pagevec.h> |
34 | #include <linux/namei.h> | 33 | #include <linux/namei.h> |
35 | #include <linux/mount.h> | 34 | #include <linux/mount.h> |
@@ -1026,12 +1025,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
1026 | res = NULL; | 1025 | res = NULL; |
1027 | goto out; | 1026 | goto out; |
1028 | /* This turned out not to be a regular file */ | 1027 | /* This turned out not to be a regular file */ |
1029 | case -EISDIR: | ||
1030 | case -ENOTDIR: | 1028 | case -ENOTDIR: |
1031 | goto no_open; | 1029 | goto no_open; |
1032 | case -ELOOP: | 1030 | case -ELOOP: |
1033 | if (!(nd->intent.open.flags & O_NOFOLLOW)) | 1031 | if (!(nd->intent.open.flags & O_NOFOLLOW)) |
1034 | goto no_open; | 1032 | goto no_open; |
1033 | /* case -EISDIR: */ | ||
1035 | /* case -EINVAL: */ | 1034 | /* case -EINVAL: */ |
1036 | default: | 1035 | default: |
1037 | goto out; | 1036 | goto out; |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 0055b813ec2c..05062329b678 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/mm.h> | 26 | #include <linux/mm.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/pagemap.h> | 28 | #include <linux/pagemap.h> |
29 | #include <linux/smp_lock.h> | ||
30 | #include <linux/aio.h> | 29 | #include <linux/aio.h> |
31 | 30 | ||
32 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 64f87194d390..bd7938eda6a8 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/nfs_mount.h> | 30 | #include <linux/nfs_mount.h> |
31 | #include <linux/nfs4_mount.h> | 31 | #include <linux/nfs4_mount.h> |
32 | #include <linux/lockd/bind.h> | 32 | #include <linux/lockd/bind.h> |
33 | #include <linux/smp_lock.h> | ||
34 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
35 | #include <linux/mount.h> | 34 | #include <linux/mount.h> |
36 | #include <linux/nfs_idmap.h> | 35 | #include <linux/nfs_idmap.h> |
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 61bc3a32e1e2..6ea07a3c75d4 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -220,6 +220,7 @@ extern void nfs4_destroy_session(struct nfs4_session *session); | |||
220 | extern struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp); | 220 | extern struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp); |
221 | extern int nfs4_proc_create_session(struct nfs_client *, int reset); | 221 | extern int nfs4_proc_create_session(struct nfs_client *, int reset); |
222 | extern int nfs4_proc_destroy_session(struct nfs4_session *); | 222 | extern int nfs4_proc_destroy_session(struct nfs4_session *); |
223 | extern int nfs4_init_session(struct nfs_server *server); | ||
223 | #else /* CONFIG_NFS_v4_1 */ | 224 | #else /* CONFIG_NFS_v4_1 */ |
224 | static inline int nfs4_setup_sequence(struct nfs_client *clp, | 225 | static inline int nfs4_setup_sequence(struct nfs_client *clp, |
225 | struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, | 226 | struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, |
@@ -227,6 +228,11 @@ static inline int nfs4_setup_sequence(struct nfs_client *clp, | |||
227 | { | 228 | { |
228 | return 0; | 229 | return 0; |
229 | } | 230 | } |
231 | |||
232 | static inline int nfs4_init_session(struct nfs_server *server) | ||
233 | { | ||
234 | return 0; | ||
235 | } | ||
230 | #endif /* CONFIG_NFS_V4_1 */ | 236 | #endif /* CONFIG_NFS_V4_1 */ |
231 | 237 | ||
232 | extern struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[]; | 238 | extern struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[]; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 92ce43517814..6917311f201c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <linux/nfs4.h> | 45 | #include <linux/nfs4.h> |
46 | #include <linux/nfs_fs.h> | 46 | #include <linux/nfs_fs.h> |
47 | #include <linux/nfs_page.h> | 47 | #include <linux/nfs_page.h> |
48 | #include <linux/smp_lock.h> | ||
49 | #include <linux/namei.h> | 48 | #include <linux/namei.h> |
50 | #include <linux/mount.h> | 49 | #include <linux/mount.h> |
51 | #include <linux/module.h> | 50 | #include <linux/module.h> |
@@ -2041,15 +2040,9 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, | |||
2041 | .rpc_argp = &args, | 2040 | .rpc_argp = &args, |
2042 | .rpc_resp = &res, | 2041 | .rpc_resp = &res, |
2043 | }; | 2042 | }; |
2044 | int status; | ||
2045 | 2043 | ||
2046 | nfs_fattr_init(info->fattr); | 2044 | nfs_fattr_init(info->fattr); |
2047 | status = nfs4_recover_expired_lease(server); | 2045 | return nfs4_call_sync(server, &msg, &args, &res, 0); |
2048 | if (!status) | ||
2049 | status = nfs4_check_client_ready(server->nfs_client); | ||
2050 | if (!status) | ||
2051 | status = nfs4_call_sync(server, &msg, &args, &res, 0); | ||
2052 | return status; | ||
2053 | } | 2046 | } |
2054 | 2047 | ||
2055 | static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, | 2048 | static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, |
@@ -4100,15 +4093,23 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request) | |||
4100 | if (request->fl_start < 0 || request->fl_end < 0) | 4093 | if (request->fl_start < 0 || request->fl_end < 0) |
4101 | return -EINVAL; | 4094 | return -EINVAL; |
4102 | 4095 | ||
4103 | if (IS_GETLK(cmd)) | 4096 | if (IS_GETLK(cmd)) { |
4104 | return nfs4_proc_getlk(state, F_GETLK, request); | 4097 | if (state != NULL) |
4098 | return nfs4_proc_getlk(state, F_GETLK, request); | ||
4099 | return 0; | ||
4100 | } | ||
4105 | 4101 | ||
4106 | if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) | 4102 | if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) |
4107 | return -EINVAL; | 4103 | return -EINVAL; |
4108 | 4104 | ||
4109 | if (request->fl_type == F_UNLCK) | 4105 | if (request->fl_type == F_UNLCK) { |
4110 | return nfs4_proc_unlck(state, cmd, request); | 4106 | if (state != NULL) |
4107 | return nfs4_proc_unlck(state, cmd, request); | ||
4108 | return 0; | ||
4109 | } | ||
4111 | 4110 | ||
4111 | if (state == NULL) | ||
4112 | return -ENOLCK; | ||
4112 | do { | 4113 | do { |
4113 | status = nfs4_proc_setlk(state, cmd, request); | 4114 | status = nfs4_proc_setlk(state, cmd, request); |
4114 | if ((status != -EAGAIN) || IS_SETLK(cmd)) | 4115 | if ((status != -EAGAIN) || IS_SETLK(cmd)) |
@@ -4794,6 +4795,22 @@ int nfs4_proc_destroy_session(struct nfs4_session *session) | |||
4794 | return status; | 4795 | return status; |
4795 | } | 4796 | } |
4796 | 4797 | ||
4798 | int nfs4_init_session(struct nfs_server *server) | ||
4799 | { | ||
4800 | struct nfs_client *clp = server->nfs_client; | ||
4801 | int ret; | ||
4802 | |||
4803 | if (!nfs4_has_session(clp)) | ||
4804 | return 0; | ||
4805 | |||
4806 | clp->cl_session->fc_attrs.max_rqst_sz = server->wsize; | ||
4807 | clp->cl_session->fc_attrs.max_resp_sz = server->rsize; | ||
4808 | ret = nfs4_recover_expired_lease(server); | ||
4809 | if (!ret) | ||
4810 | ret = nfs4_check_client_ready(clp); | ||
4811 | return ret; | ||
4812 | } | ||
4813 | |||
4797 | /* | 4814 | /* |
4798 | * Renew the cl_session lease. | 4815 | * Renew the cl_session lease. |
4799 | */ | 4816 | */ |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index b73c5a728655..65ca8c18476f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -553,6 +553,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f | |||
553 | INIT_LIST_HEAD(&lsp->ls_sequence.list); | 553 | INIT_LIST_HEAD(&lsp->ls_sequence.list); |
554 | lsp->ls_seqid.sequence = &lsp->ls_sequence; | 554 | lsp->ls_seqid.sequence = &lsp->ls_sequence; |
555 | atomic_set(&lsp->ls_count, 1); | 555 | atomic_set(&lsp->ls_count, 1); |
556 | lsp->ls_state = state; | ||
556 | lsp->ls_owner = fl_owner; | 557 | lsp->ls_owner = fl_owner; |
557 | spin_lock(&clp->cl_lock); | 558 | spin_lock(&clp->cl_lock); |
558 | nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64); | 559 | nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64); |
@@ -587,7 +588,6 @@ static struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_ | |||
587 | if (lsp != NULL) | 588 | if (lsp != NULL) |
588 | break; | 589 | break; |
589 | if (new != NULL) { | 590 | if (new != NULL) { |
590 | new->ls_state = state; | ||
591 | list_add(&new->ls_locks, &state->lock_states); | 591 | list_add(&new->ls_locks, &state->lock_states); |
592 | set_bit(LK_STATE_IN_USE, &state->flags); | 592 | set_bit(LK_STATE_IN_USE, &state->flags); |
593 | lsp = new; | 593 | lsp = new; |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 96c4ebfa46f4..73ea5e8d66ce 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/sunrpc/clnt.h> | 18 | #include <linux/sunrpc/clnt.h> |
19 | #include <linux/nfs_fs.h> | 19 | #include <linux/nfs_fs.h> |
20 | #include <linux/nfs_page.h> | 20 | #include <linux/nfs_page.h> |
21 | #include <linux/smp_lock.h> | ||
22 | 21 | ||
23 | #include <asm/system.h> | 22 | #include <asm/system.h> |
24 | 23 | ||
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 35d81316163f..0a0a2ff767c3 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/nfs_mount.h> | 19 | #include <linux/nfs_mount.h> |
20 | #include <linux/nfs_page.h> | 20 | #include <linux/nfs_page.h> |
21 | #include <linux/backing-dev.h> | 21 | #include <linux/backing-dev.h> |
22 | #include <linux/blkdev.h> | ||
23 | 22 | ||
24 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
25 | 24 | ||