diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/9p/vfs_addr.c | 2 | ||||
| -rw-r--r-- | fs/Kconfig | 27 | ||||
| -rw-r--r-- | fs/cifs/cifs_debug.c | 8 | ||||
| -rw-r--r-- | fs/cifs/cifsglob.h | 2 | ||||
| -rw-r--r-- | fs/cifs/cifssmb.c | 5 | ||||
| -rw-r--r-- | fs/cifs/connect.c | 1 | ||||
| -rw-r--r-- | fs/nfs/client.c | 18 | ||||
| -rw-r--r-- | fs/nfs/dir.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs4_fs.h | 6 | ||||
| -rw-r--r-- | fs/nfs/nfs4proc.c | 40 | ||||
| -rw-r--r-- | fs/nfs/nfs4state.c | 2 | ||||
| -rw-r--r-- | fs/nilfs2/Kconfig | 25 |
12 files changed, 81 insertions, 57 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index 6fcb1e7095c..92828281a30 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c | |||
| @@ -57,7 +57,7 @@ static int v9fs_vfs_readpage(struct file *filp, struct page *page) | |||
| 57 | buffer = kmap(page); | 57 | buffer = kmap(page); |
| 58 | offset = page_offset(page); | 58 | offset = page_offset(page); |
| 59 | 59 | ||
| 60 | retval = v9fs_file_readn(filp, buffer, NULL, offset, PAGE_CACHE_SIZE); | 60 | retval = v9fs_file_readn(filp, buffer, NULL, PAGE_CACHE_SIZE, offset); |
| 61 | if (retval < 0) | 61 | if (retval < 0) |
| 62 | goto done; | 62 | goto done; |
| 63 | 63 | ||
diff --git a/fs/Kconfig b/fs/Kconfig index a97263be6a9..0e7da7bb5d9 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
| @@ -186,32 +186,7 @@ source "fs/romfs/Kconfig" | |||
| 186 | source "fs/sysv/Kconfig" | 186 | source "fs/sysv/Kconfig" |
| 187 | source "fs/ufs/Kconfig" | 187 | source "fs/ufs/Kconfig" |
| 188 | source "fs/exofs/Kconfig" | 188 | source "fs/exofs/Kconfig" |
| 189 | 189 | source "fs/nilfs2/Kconfig" | |
| 190 | config NILFS2_FS | ||
| 191 | tristate "NILFS2 file system support (EXPERIMENTAL)" | ||
| 192 | depends on BLOCK && EXPERIMENTAL | ||
| 193 | select CRC32 | ||
| 194 | help | ||
| 195 | NILFS2 is a log-structured file system (LFS) supporting continuous | ||
| 196 | snapshotting. In addition to versioning capability of the entire | ||
| 197 | file system, users can even restore files mistakenly overwritten or | ||
| 198 | destroyed just a few seconds ago. Since this file system can keep | ||
| 199 | consistency like conventional LFS, it achieves quick recovery after | ||
| 200 | system crashes. | ||
| 201 | |||
| 202 | NILFS2 creates a number of checkpoints every few seconds or per | ||
| 203 | synchronous write basis (unless there is no change). Users can | ||
| 204 | select significant versions among continuously created checkpoints, | ||
| 205 | and can change them into snapshots which will be preserved for long | ||
| 206 | periods until they are changed back to checkpoints. Each | ||
| 207 | snapshot is mountable as a read-only file system concurrently with | ||
| 208 | its writable mount, and this feature is convenient for online backup. | ||
| 209 | |||
| 210 | Some features including atime, extended attributes, and POSIX ACLs, | ||
| 211 | are not supported yet. | ||
| 212 | |||
| 213 | To compile this file system support as a module, choose M here: the | ||
| 214 | module will be called nilfs2. If unsure, say N. | ||
| 215 | 190 | ||
| 216 | endif # MISC_FILESYSTEMS | 191 | endif # MISC_FILESYSTEMS |
| 217 | 192 | ||
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 7f19fefd3d4..42cec2a7c0c 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
| @@ -261,6 +261,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, | |||
| 261 | atomic_set(&tcon->num_reads, 0); | 261 | atomic_set(&tcon->num_reads, 0); |
| 262 | atomic_set(&tcon->num_oplock_brks, 0); | 262 | atomic_set(&tcon->num_oplock_brks, 0); |
| 263 | atomic_set(&tcon->num_opens, 0); | 263 | atomic_set(&tcon->num_opens, 0); |
| 264 | atomic_set(&tcon->num_posixopens, 0); | ||
| 265 | atomic_set(&tcon->num_posixmkdirs, 0); | ||
| 264 | atomic_set(&tcon->num_closes, 0); | 266 | atomic_set(&tcon->num_closes, 0); |
| 265 | atomic_set(&tcon->num_deletes, 0); | 267 | atomic_set(&tcon->num_deletes, 0); |
| 266 | atomic_set(&tcon->num_mkdirs, 0); | 268 | atomic_set(&tcon->num_mkdirs, 0); |
| @@ -347,11 +349,15 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) | |||
| 347 | atomic_read(&tcon->num_locks), | 349 | atomic_read(&tcon->num_locks), |
| 348 | atomic_read(&tcon->num_hardlinks), | 350 | atomic_read(&tcon->num_hardlinks), |
| 349 | atomic_read(&tcon->num_symlinks)); | 351 | atomic_read(&tcon->num_symlinks)); |
| 350 | seq_printf(m, "\nOpens: %d Closes: %d" | 352 | seq_printf(m, "\nOpens: %d Closes: %d " |
| 351 | "Deletes: %d", | 353 | "Deletes: %d", |
| 352 | atomic_read(&tcon->num_opens), | 354 | atomic_read(&tcon->num_opens), |
| 353 | atomic_read(&tcon->num_closes), | 355 | atomic_read(&tcon->num_closes), |
| 354 | atomic_read(&tcon->num_deletes)); | 356 | atomic_read(&tcon->num_deletes)); |
| 357 | seq_printf(m, "\nPosix Opens: %d " | ||
| 358 | "Posix Mkdirs: %d", | ||
| 359 | atomic_read(&tcon->num_posixopens), | ||
| 360 | atomic_read(&tcon->num_posixmkdirs)); | ||
| 355 | seq_printf(m, "\nMkdirs: %d Rmdirs: %d", | 361 | seq_printf(m, "\nMkdirs: %d Rmdirs: %d", |
| 356 | atomic_read(&tcon->num_mkdirs), | 362 | atomic_read(&tcon->num_mkdirs), |
| 357 | atomic_read(&tcon->num_rmdirs)); | 363 | atomic_read(&tcon->num_rmdirs)); |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 63f6cdfa563..6084d6379c0 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
| @@ -260,6 +260,8 @@ struct cifsTconInfo { | |||
| 260 | atomic_t num_closes; | 260 | atomic_t num_closes; |
| 261 | atomic_t num_deletes; | 261 | atomic_t num_deletes; |
| 262 | atomic_t num_mkdirs; | 262 | atomic_t num_mkdirs; |
| 263 | atomic_t num_posixopens; | ||
| 264 | atomic_t num_posixmkdirs; | ||
| 263 | atomic_t num_rmdirs; | 265 | atomic_t num_rmdirs; |
| 264 | atomic_t num_renames; | 266 | atomic_t num_renames; |
| 265 | atomic_t num_t2renames; | 267 | atomic_t num_t2renames; |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 922f5fe2084..1866bc2927d 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -1113,7 +1113,10 @@ PsxCreat: | |||
| 1113 | psx_create_err: | 1113 | psx_create_err: |
| 1114 | cifs_buf_release(pSMB); | 1114 | cifs_buf_release(pSMB); |
| 1115 | 1115 | ||
| 1116 | cifs_stats_inc(&tcon->num_mkdirs); | 1116 | if (posix_flags & SMB_O_DIRECTORY) |
| 1117 | cifs_stats_inc(&tcon->num_posixmkdirs); | ||
| 1118 | else | ||
| 1119 | cifs_stats_inc(&tcon->num_posixopens); | ||
| 1117 | 1120 | ||
| 1118 | if (rc == -EAGAIN) | 1121 | if (rc == -EAGAIN) |
| 1119 | goto PsxCreat; | 1122 | goto PsxCreat; |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index e16d7592116..9bb5c875073 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -2726,6 +2726,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
| 2726 | strncpy(tcon->treeName, tree, MAX_TREE_SIZE); | 2726 | strncpy(tcon->treeName, tree, MAX_TREE_SIZE); |
| 2727 | 2727 | ||
| 2728 | /* mostly informational -- no need to fail on error here */ | 2728 | /* mostly informational -- no need to fail on error here */ |
| 2729 | kfree(tcon->nativeFileSystem); | ||
| 2729 | tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, | 2730 | tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, |
| 2730 | bytes_left, is_unicode, | 2731 | bytes_left, is_unicode, |
| 2731 | nls_codepage); | 2732 | nls_codepage); |
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index c2d061675d8..8d25ccb2d51 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/dir.c b/fs/nfs/dir.c index 38d42c29fb9..32062c33c85 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
| @@ -1025,12 +1025,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
| 1025 | res = NULL; | 1025 | res = NULL; |
| 1026 | goto out; | 1026 | goto out; |
| 1027 | /* This turned out not to be a regular file */ | 1027 | /* This turned out not to be a regular file */ |
| 1028 | case -EISDIR: | ||
| 1029 | case -ENOTDIR: | 1028 | case -ENOTDIR: |
| 1030 | goto no_open; | 1029 | goto no_open; |
| 1031 | case -ELOOP: | 1030 | case -ELOOP: |
| 1032 | if (!(nd->intent.open.flags & O_NOFOLLOW)) | 1031 | if (!(nd->intent.open.flags & O_NOFOLLOW)) |
| 1033 | goto no_open; | 1032 | goto no_open; |
| 1033 | /* case -EISDIR: */ | ||
| 1034 | /* case -EINVAL: */ | 1034 | /* case -EINVAL: */ |
| 1035 | default: | 1035 | default: |
| 1036 | goto out; | 1036 | goto out; |
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 61bc3a32e1e..6ea07a3c75d 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 ff0c080db59..6917311f201 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -2040,15 +2040,9 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, | |||
| 2040 | .rpc_argp = &args, | 2040 | .rpc_argp = &args, |
| 2041 | .rpc_resp = &res, | 2041 | .rpc_resp = &res, |
| 2042 | }; | 2042 | }; |
| 2043 | int status; | ||
| 2044 | 2043 | ||
| 2045 | nfs_fattr_init(info->fattr); | 2044 | nfs_fattr_init(info->fattr); |
| 2046 | status = nfs4_recover_expired_lease(server); | 2045 | return nfs4_call_sync(server, &msg, &args, &res, 0); |
| 2047 | if (!status) | ||
| 2048 | status = nfs4_check_client_ready(server->nfs_client); | ||
| 2049 | if (!status) | ||
| 2050 | status = nfs4_call_sync(server, &msg, &args, &res, 0); | ||
| 2051 | return status; | ||
| 2052 | } | 2046 | } |
| 2053 | 2047 | ||
| 2054 | 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, |
| @@ -4099,15 +4093,23 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request) | |||
| 4099 | if (request->fl_start < 0 || request->fl_end < 0) | 4093 | if (request->fl_start < 0 || request->fl_end < 0) |
| 4100 | return -EINVAL; | 4094 | return -EINVAL; |
| 4101 | 4095 | ||
| 4102 | if (IS_GETLK(cmd)) | 4096 | if (IS_GETLK(cmd)) { |
| 4103 | 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 | } | ||
| 4104 | 4101 | ||
| 4105 | if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) | 4102 | if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) |
| 4106 | return -EINVAL; | 4103 | return -EINVAL; |
| 4107 | 4104 | ||
| 4108 | if (request->fl_type == F_UNLCK) | 4105 | if (request->fl_type == F_UNLCK) { |
| 4109 | return nfs4_proc_unlck(state, cmd, request); | 4106 | if (state != NULL) |
| 4107 | return nfs4_proc_unlck(state, cmd, request); | ||
| 4108 | return 0; | ||
| 4109 | } | ||
| 4110 | 4110 | ||
| 4111 | if (state == NULL) | ||
| 4112 | return -ENOLCK; | ||
| 4111 | do { | 4113 | do { |
| 4112 | status = nfs4_proc_setlk(state, cmd, request); | 4114 | status = nfs4_proc_setlk(state, cmd, request); |
| 4113 | if ((status != -EAGAIN) || IS_SETLK(cmd)) | 4115 | if ((status != -EAGAIN) || IS_SETLK(cmd)) |
| @@ -4793,6 +4795,22 @@ int nfs4_proc_destroy_session(struct nfs4_session *session) | |||
| 4793 | return status; | 4795 | return status; |
| 4794 | } | 4796 | } |
| 4795 | 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 | |||
| 4796 | /* | 4814 | /* |
| 4797 | * Renew the cl_session lease. | 4815 | * Renew the cl_session lease. |
| 4798 | */ | 4816 | */ |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index b73c5a72865..65ca8c18476 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/nilfs2/Kconfig b/fs/nilfs2/Kconfig new file mode 100644 index 00000000000..72da095d400 --- /dev/null +++ b/fs/nilfs2/Kconfig | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | config NILFS2_FS | ||
| 2 | tristate "NILFS2 file system support (EXPERIMENTAL)" | ||
| 3 | depends on BLOCK && EXPERIMENTAL | ||
| 4 | select CRC32 | ||
| 5 | help | ||
| 6 | NILFS2 is a log-structured file system (LFS) supporting continuous | ||
| 7 | snapshotting. In addition to versioning capability of the entire | ||
| 8 | file system, users can even restore files mistakenly overwritten or | ||
| 9 | destroyed just a few seconds ago. Since this file system can keep | ||
| 10 | consistency like conventional LFS, it achieves quick recovery after | ||
| 11 | system crashes. | ||
| 12 | |||
| 13 | NILFS2 creates a number of checkpoints every few seconds or per | ||
| 14 | synchronous write basis (unless there is no change). Users can | ||
| 15 | select significant versions among continuously created checkpoints, | ||
| 16 | and can change them into snapshots which will be preserved for long | ||
| 17 | periods until they are changed back to checkpoints. Each | ||
| 18 | snapshot is mountable as a read-only file system concurrently with | ||
| 19 | its writable mount, and this feature is convenient for online backup. | ||
| 20 | |||
| 21 | Some features including atime, extended attributes, and POSIX ACLs, | ||
| 22 | are not supported yet. | ||
| 23 | |||
| 24 | To compile this file system support as a module, choose M here: the | ||
| 25 | module will be called nilfs2. If unsure, say N. | ||
