aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r--fs/reiserfs/super.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 3567fb9e3fb1..2969773cfc22 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -28,6 +28,7 @@
28#include <linux/mount.h> 28#include <linux/mount.h>
29#include <linux/namei.h> 29#include <linux/namei.h>
30#include <linux/crc32.h> 30#include <linux/crc32.h>
31#include <linux/smp_lock.h>
31 32
32struct file_system_type reiserfs_fs_type; 33struct file_system_type reiserfs_fs_type;
33 34
@@ -64,18 +65,15 @@ static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf);
64 65
65static int reiserfs_sync_fs(struct super_block *s, int wait) 66static int reiserfs_sync_fs(struct super_block *s, int wait)
66{ 67{
67 if (!(s->s_flags & MS_RDONLY)) { 68 struct reiserfs_transaction_handle th;
68 struct reiserfs_transaction_handle th; 69
69 reiserfs_write_lock(s); 70 reiserfs_write_lock(s);
70 if (!journal_begin(&th, s, 1)) 71 if (!journal_begin(&th, s, 1))
71 if (!journal_end_sync(&th, s, 1)) 72 if (!journal_end_sync(&th, s, 1))
72 reiserfs_flush_old_commits(s); 73 reiserfs_flush_old_commits(s);
73 s->s_dirt = 0; /* Even if it's not true. 74 s->s_dirt = 0; /* Even if it's not true.
74 * We'll loop forever in sync_supers otherwise */ 75 * We'll loop forever in sync_supers otherwise */
75 reiserfs_write_unlock(s); 76 reiserfs_write_unlock(s);
76 } else {
77 s->s_dirt = 0;
78 }
79 return 0; 77 return 0;
80} 78}
81 79
@@ -468,6 +466,11 @@ static void reiserfs_put_super(struct super_block *s)
468 struct reiserfs_transaction_handle th; 466 struct reiserfs_transaction_handle th;
469 th.t_trans_id = 0; 467 th.t_trans_id = 0;
470 468
469 lock_kernel();
470
471 if (s->s_dirt)
472 reiserfs_write_super(s);
473
471 /* change file system state to current state if it was mounted with read-write permissions */ 474 /* change file system state to current state if it was mounted with read-write permissions */
472 if (!(s->s_flags & MS_RDONLY)) { 475 if (!(s->s_flags & MS_RDONLY)) {
473 if (!journal_begin(&th, s, 10)) { 476 if (!journal_begin(&th, s, 10)) {
@@ -500,7 +503,7 @@ static void reiserfs_put_super(struct super_block *s)
500 kfree(s->s_fs_info); 503 kfree(s->s_fs_info);
501 s->s_fs_info = NULL; 504 s->s_fs_info = NULL;
502 505
503 return; 506 unlock_kernel();
504} 507}
505 508
506static struct kmem_cache *reiserfs_inode_cachep; 509static struct kmem_cache *reiserfs_inode_cachep;
@@ -898,6 +901,7 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
898 {"conv",.setmask = 1 << REISERFS_CONVERT}, 901 {"conv",.setmask = 1 << REISERFS_CONVERT},
899 {"attrs",.setmask = 1 << REISERFS_ATTRS}, 902 {"attrs",.setmask = 1 << REISERFS_ATTRS},
900 {"noattrs",.clrmask = 1 << REISERFS_ATTRS}, 903 {"noattrs",.clrmask = 1 << REISERFS_ATTRS},
904 {"expose_privroot", .setmask = 1 << REISERFS_EXPOSE_PRIVROOT},
901#ifdef CONFIG_REISERFS_FS_XATTR 905#ifdef CONFIG_REISERFS_FS_XATTR
902 {"user_xattr",.setmask = 1 << REISERFS_XATTRS_USER}, 906 {"user_xattr",.setmask = 1 << REISERFS_XATTRS_USER},
903 {"nouser_xattr",.clrmask = 1 << REISERFS_XATTRS_USER}, 907 {"nouser_xattr",.clrmask = 1 << REISERFS_XATTRS_USER},
@@ -1193,6 +1197,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
1193 memcpy(qf_names, REISERFS_SB(s)->s_qf_names, sizeof(qf_names)); 1197 memcpy(qf_names, REISERFS_SB(s)->s_qf_names, sizeof(qf_names));
1194#endif 1198#endif
1195 1199
1200 lock_kernel();
1196 rs = SB_DISK_SUPER_BLOCK(s); 1201 rs = SB_DISK_SUPER_BLOCK(s);
1197 1202
1198 if (!reiserfs_parse_options 1203 if (!reiserfs_parse_options
@@ -1315,10 +1320,12 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
1315 1320
1316out_ok: 1321out_ok:
1317 replace_mount_options(s, new_opts); 1322 replace_mount_options(s, new_opts);
1323 unlock_kernel();
1318 return 0; 1324 return 0;
1319 1325
1320out_err: 1326out_err:
1321 kfree(new_opts); 1327 kfree(new_opts);
1328 unlock_kernel();
1322 return err; 1329 return err;
1323} 1330}
1324 1331