diff options
Diffstat (limited to 'fs/super.c')
| -rw-r--r-- | fs/super.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/fs/super.c b/fs/super.c index 6987824d0dce..aec99ddbe53f 100644 --- a/fs/super.c +++ b/fs/super.c | |||
| @@ -220,6 +220,37 @@ static int grab_super(struct super_block *s) __releases(sb_lock) | |||
| 220 | return 0; | 220 | return 0; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | /* | ||
| 224 | * Write out and wait upon all dirty data associated with this | ||
| 225 | * superblock. Filesystem data as well as the underlying block | ||
| 226 | * device. Takes the superblock lock. Requires a second blkdev | ||
| 227 | * flush by the caller to complete the operation. | ||
| 228 | */ | ||
| 229 | void __fsync_super(struct super_block *sb) | ||
| 230 | { | ||
| 231 | sync_inodes_sb(sb, 0); | ||
| 232 | DQUOT_SYNC(sb); | ||
| 233 | lock_super(sb); | ||
| 234 | if (sb->s_dirt && sb->s_op->write_super) | ||
| 235 | sb->s_op->write_super(sb); | ||
| 236 | unlock_super(sb); | ||
| 237 | if (sb->s_op->sync_fs) | ||
| 238 | sb->s_op->sync_fs(sb, 1); | ||
| 239 | sync_blockdev(sb->s_bdev); | ||
| 240 | sync_inodes_sb(sb, 1); | ||
| 241 | } | ||
| 242 | |||
| 243 | /* | ||
| 244 | * Write out and wait upon all dirty data associated with this | ||
| 245 | * superblock. Filesystem data as well as the underlying block | ||
| 246 | * device. Takes the superblock lock. | ||
| 247 | */ | ||
| 248 | int fsync_super(struct super_block *sb) | ||
| 249 | { | ||
| 250 | __fsync_super(sb); | ||
| 251 | return sync_blockdev(sb->s_bdev); | ||
| 252 | } | ||
| 253 | |||
| 223 | /** | 254 | /** |
| 224 | * generic_shutdown_super - common helper for ->kill_sb() | 255 | * generic_shutdown_super - common helper for ->kill_sb() |
| 225 | * @sb: superblock to kill | 256 | * @sb: superblock to kill |
| @@ -540,8 +571,10 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | |||
| 540 | { | 571 | { |
| 541 | int retval; | 572 | int retval; |
| 542 | 573 | ||
| 574 | #ifdef CONFIG_BLOCK | ||
| 543 | if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev)) | 575 | if (!(flags & MS_RDONLY) && bdev_read_only(sb->s_bdev)) |
| 544 | return -EACCES; | 576 | return -EACCES; |
| 577 | #endif | ||
| 545 | if (flags & MS_RDONLY) | 578 | if (flags & MS_RDONLY) |
| 546 | acct_auto_close(sb); | 579 | acct_auto_close(sb); |
| 547 | shrink_dcache_sb(sb); | 580 | shrink_dcache_sb(sb); |
| @@ -661,6 +694,7 @@ void kill_litter_super(struct super_block *sb) | |||
| 661 | 694 | ||
| 662 | EXPORT_SYMBOL(kill_litter_super); | 695 | EXPORT_SYMBOL(kill_litter_super); |
| 663 | 696 | ||
| 697 | #ifdef CONFIG_BLOCK | ||
| 664 | static int set_bdev_super(struct super_block *s, void *data) | 698 | static int set_bdev_super(struct super_block *s, void *data) |
| 665 | { | 699 | { |
| 666 | s->s_bdev = data; | 700 | s->s_bdev = data; |
| @@ -756,6 +790,7 @@ void kill_block_super(struct super_block *sb) | |||
| 756 | } | 790 | } |
| 757 | 791 | ||
| 758 | EXPORT_SYMBOL(kill_block_super); | 792 | EXPORT_SYMBOL(kill_block_super); |
| 793 | #endif | ||
| 759 | 794 | ||
| 760 | int get_sb_nodev(struct file_system_type *fs_type, | 795 | int get_sb_nodev(struct file_system_type *fs_type, |
| 761 | int flags, void *data, | 796 | int flags, void *data, |
