aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 23:05:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 23:05:37 -0400
commit4b4f1d017815f96737ca4a62f90e5a1f0b9f02d6 (patch)
treec95ae92ec01cabf6c2a40d31a31da6a4d9256816 /fs/ocfs2/super.c
parent875287caa067492779670f5fb3b98ec8dcfe2cb0 (diff)
parentaa7dfb8954ccf49e026ba13d12991a4eb7defb96 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (87 commits) nilfs2: get rid of bd_mount_sem use from nilfs nilfs2: correct exclusion control in nilfs_remount function nilfs2: simplify remaining sget() use nilfs2: get rid of sget use for checking if current mount is present nilfs2: get rid of sget use for acquiring nilfs object nilfs2: remove meaningless EBUSY case from nilfs_get_sb function remove the call to ->write_super in __sync_filesystem nilfs2: call nilfs2_write_super from nilfs2_sync_fs jffs2: call jffs2_write_super from jffs2_sync_fs ufs: add ->sync_fs sysv: add ->sync_fs hfsplus: add ->sync_fs hfs: add ->sync_fs fat: add ->sync_fs ext2: add ->sync_fs exofs: add ->sync_fs bfs: add ->sync_fs affs: add ->sync_fs sanitize ->fsync() for affs repair bfs_write_inode(), switch bfs to simple_fsync() ...
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 5c6163f55039..201b40a441fe 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -42,6 +42,7 @@
42#include <linux/mount.h> 42#include <linux/mount.h>
43#include <linux/seq_file.h> 43#include <linux/seq_file.h>
44#include <linux/quotaops.h> 44#include <linux/quotaops.h>
45#include <linux/smp_lock.h>
45 46
46#define MLOG_MASK_PREFIX ML_SUPER 47#define MLOG_MASK_PREFIX ML_SUPER
47#include <cluster/masklog.h> 48#include <cluster/masklog.h>
@@ -126,7 +127,6 @@ static int ocfs2_get_sector(struct super_block *sb,
126 struct buffer_head **bh, 127 struct buffer_head **bh,
127 int block, 128 int block,
128 int sect_size); 129 int sect_size);
129static void ocfs2_write_super(struct super_block *sb);
130static struct inode *ocfs2_alloc_inode(struct super_block *sb); 130static struct inode *ocfs2_alloc_inode(struct super_block *sb);
131static void ocfs2_destroy_inode(struct inode *inode); 131static void ocfs2_destroy_inode(struct inode *inode);
132static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend); 132static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend);
@@ -141,7 +141,6 @@ static const struct super_operations ocfs2_sops = {
141 .clear_inode = ocfs2_clear_inode, 141 .clear_inode = ocfs2_clear_inode,
142 .delete_inode = ocfs2_delete_inode, 142 .delete_inode = ocfs2_delete_inode,
143 .sync_fs = ocfs2_sync_fs, 143 .sync_fs = ocfs2_sync_fs,
144 .write_super = ocfs2_write_super,
145 .put_super = ocfs2_put_super, 144 .put_super = ocfs2_put_super,
146 .remount_fs = ocfs2_remount, 145 .remount_fs = ocfs2_remount,
147 .show_options = ocfs2_show_options, 146 .show_options = ocfs2_show_options,
@@ -365,24 +364,12 @@ static struct file_operations ocfs2_osb_debug_fops = {
365 .llseek = generic_file_llseek, 364 .llseek = generic_file_llseek,
366}; 365};
367 366
368/*
369 * write_super and sync_fs ripped right out of ext3.
370 */
371static void ocfs2_write_super(struct super_block *sb)
372{
373 if (mutex_trylock(&sb->s_lock) != 0)
374 BUG();
375 sb->s_dirt = 0;
376}
377
378static int ocfs2_sync_fs(struct super_block *sb, int wait) 367static int ocfs2_sync_fs(struct super_block *sb, int wait)
379{ 368{
380 int status; 369 int status;
381 tid_t target; 370 tid_t target;
382 struct ocfs2_super *osb = OCFS2_SB(sb); 371 struct ocfs2_super *osb = OCFS2_SB(sb);
383 372
384 sb->s_dirt = 0;
385
386 if (ocfs2_is_hard_readonly(osb)) 373 if (ocfs2_is_hard_readonly(osb))
387 return -EROFS; 374 return -EROFS;
388 375
@@ -595,6 +582,8 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
595 struct mount_options parsed_options; 582 struct mount_options parsed_options;
596 struct ocfs2_super *osb = OCFS2_SB(sb); 583 struct ocfs2_super *osb = OCFS2_SB(sb);
597 584
585 lock_kernel();
586
598 if (!ocfs2_parse_options(sb, data, &parsed_options, 1)) { 587 if (!ocfs2_parse_options(sb, data, &parsed_options, 1)) {
599 ret = -EINVAL; 588 ret = -EINVAL;
600 goto out; 589 goto out;
@@ -698,6 +687,7 @@ unlock_osb:
698 ocfs2_set_journal_params(osb); 687 ocfs2_set_journal_params(osb);
699 } 688 }
700out: 689out:
690 unlock_kernel();
701 return ret; 691 return ret;
702} 692}
703 693
@@ -1550,9 +1540,13 @@ static void ocfs2_put_super(struct super_block *sb)
1550{ 1540{
1551 mlog_entry("(0x%p)\n", sb); 1541 mlog_entry("(0x%p)\n", sb);
1552 1542
1543 lock_kernel();
1544
1553 ocfs2_sync_blockdev(sb); 1545 ocfs2_sync_blockdev(sb);
1554 ocfs2_dismount_volume(sb, 0); 1546 ocfs2_dismount_volume(sb, 0);
1555 1547
1548 unlock_kernel();
1549
1556 mlog_exit_void(); 1550 mlog_exit_void();
1557} 1551}
1558 1552