diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 21:10:18 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 21:10:18 -0400 |
| commit | 08615d7d85e5aa02c05bf6c4dde87d940e7f85f6 (patch) | |
| tree | 18906149d313d25914160aca21cedf54b3a7e818 /fs/fat/inode.c | |
| parent | 9fdadb2cbaf4b482dfd6086e8bd3d2db071a1702 (diff) | |
| parent | 0a4dd35c67b144d8ef9432120105f1aab9293ee9 (diff) | |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton:
- the "misc" tree - stuff from all over the map
- checkpatch updates
- fatfs
- kmod changes
- procfs
- cpumask
- UML
- kexec
- mqueue
- rapidio
- pidns
- some checkpoint-restore feature work. Reluctantly. Most of it
delayed a release. I'm still rather worried that we don't have a
clear roadmap to completion for this work.
* emailed from Andrew Morton <akpm@linux-foundation.org>: (78 patches)
kconfig: update compression algorithm info
c/r: prctl: add ability to set new mm_struct::exe_file
c/r: prctl: extend PR_SET_MM to set up more mm_struct entries
c/r: procfs: add arg_start/end, env_start/end and exit_code members to /proc/$pid/stat
syscalls, x86: add __NR_kcmp syscall
fs, proc: introduce /proc/<pid>/task/<tid>/children entry
sysctl: make kernel.ns_last_pid control dependent on CHECKPOINT_RESTORE
aio/vfs: cleanup of rw_copy_check_uvector() and compat_rw_copy_check_uvector()
eventfd: change int to __u64 in eventfd_signal()
fs/nls: add Apple NLS
pidns: make killed children autoreap
pidns: use task_active_pid_ns in do_notify_parent
rapidio/tsi721: add DMA engine support
rapidio: add DMA engine support for RIO data transfers
ipc/mqueue: add rbtree node caching support
tools/selftests: add mq_perf_tests
ipc/mqueue: strengthen checks on mqueue creation
ipc/mqueue: correct mq_attr_ok test
ipc/mqueue: improve performance of send/recv
selftests: add mq_open_tests
...
Diffstat (limited to 'fs/fat/inode.c')
| -rw-r--r-- | fs/fat/inode.c | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index b3d290c1b513..c2973ea5df9a 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
| @@ -459,37 +459,11 @@ static void fat_evict_inode(struct inode *inode) | |||
| 459 | fat_detach(inode); | 459 | fat_detach(inode); |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | static void fat_write_super(struct super_block *sb) | ||
| 463 | { | ||
| 464 | lock_super(sb); | ||
| 465 | sb->s_dirt = 0; | ||
| 466 | |||
| 467 | if (!(sb->s_flags & MS_RDONLY)) | ||
| 468 | fat_clusters_flush(sb); | ||
| 469 | unlock_super(sb); | ||
| 470 | } | ||
| 471 | |||
| 472 | static int fat_sync_fs(struct super_block *sb, int wait) | ||
| 473 | { | ||
| 474 | int err = 0; | ||
| 475 | |||
| 476 | if (sb->s_dirt) { | ||
| 477 | lock_super(sb); | ||
| 478 | sb->s_dirt = 0; | ||
| 479 | err = fat_clusters_flush(sb); | ||
| 480 | unlock_super(sb); | ||
| 481 | } | ||
| 482 | |||
| 483 | return err; | ||
| 484 | } | ||
| 485 | |||
| 486 | static void fat_put_super(struct super_block *sb) | 462 | static void fat_put_super(struct super_block *sb) |
| 487 | { | 463 | { |
| 488 | struct msdos_sb_info *sbi = MSDOS_SB(sb); | 464 | struct msdos_sb_info *sbi = MSDOS_SB(sb); |
| 489 | 465 | ||
| 490 | if (sb->s_dirt) | 466 | iput(sbi->fsinfo_inode); |
| 491 | fat_write_super(sb); | ||
| 492 | |||
| 493 | iput(sbi->fat_inode); | 467 | iput(sbi->fat_inode); |
| 494 | 468 | ||
| 495 | unload_nls(sbi->nls_disk); | 469 | unload_nls(sbi->nls_disk); |
| @@ -661,7 +635,18 @@ retry: | |||
| 661 | 635 | ||
| 662 | static int fat_write_inode(struct inode *inode, struct writeback_control *wbc) | 636 | static int fat_write_inode(struct inode *inode, struct writeback_control *wbc) |
| 663 | { | 637 | { |
| 664 | return __fat_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL); | 638 | int err; |
| 639 | |||
| 640 | if (inode->i_ino == MSDOS_FSINFO_INO) { | ||
| 641 | struct super_block *sb = inode->i_sb; | ||
| 642 | |||
| 643 | lock_super(sb); | ||
| 644 | err = fat_clusters_flush(sb); | ||
| 645 | unlock_super(sb); | ||
| 646 | } else | ||
| 647 | err = __fat_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL); | ||
| 648 | |||
| 649 | return err; | ||
| 665 | } | 650 | } |
| 666 | 651 | ||
| 667 | int fat_sync_inode(struct inode *inode) | 652 | int fat_sync_inode(struct inode *inode) |
| @@ -678,8 +663,6 @@ static const struct super_operations fat_sops = { | |||
| 678 | .write_inode = fat_write_inode, | 663 | .write_inode = fat_write_inode, |
| 679 | .evict_inode = fat_evict_inode, | 664 | .evict_inode = fat_evict_inode, |
| 680 | .put_super = fat_put_super, | 665 | .put_super = fat_put_super, |
| 681 | .write_super = fat_write_super, | ||
| 682 | .sync_fs = fat_sync_fs, | ||
| 683 | .statfs = fat_statfs, | 666 | .statfs = fat_statfs, |
| 684 | .remount_fs = fat_remount, | 667 | .remount_fs = fat_remount, |
| 685 | 668 | ||
| @@ -1244,6 +1227,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, | |||
| 1244 | void (*setup)(struct super_block *)) | 1227 | void (*setup)(struct super_block *)) |
| 1245 | { | 1228 | { |
| 1246 | struct inode *root_inode = NULL, *fat_inode = NULL; | 1229 | struct inode *root_inode = NULL, *fat_inode = NULL; |
| 1230 | struct inode *fsinfo_inode = NULL; | ||
| 1247 | struct buffer_head *bh; | 1231 | struct buffer_head *bh; |
| 1248 | struct fat_boot_sector *b; | 1232 | struct fat_boot_sector *b; |
| 1249 | struct msdos_sb_info *sbi; | 1233 | struct msdos_sb_info *sbi; |
| @@ -1490,6 +1474,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, | |||
| 1490 | goto out_fail; | 1474 | goto out_fail; |
| 1491 | MSDOS_I(fat_inode)->i_pos = 0; | 1475 | MSDOS_I(fat_inode)->i_pos = 0; |
| 1492 | sbi->fat_inode = fat_inode; | 1476 | sbi->fat_inode = fat_inode; |
| 1477 | |||
| 1478 | fsinfo_inode = new_inode(sb); | ||
| 1479 | if (!fsinfo_inode) | ||
| 1480 | goto out_fail; | ||
| 1481 | fsinfo_inode->i_ino = MSDOS_FSINFO_INO; | ||
| 1482 | sbi->fsinfo_inode = fsinfo_inode; | ||
| 1483 | insert_inode_hash(fsinfo_inode); | ||
| 1484 | |||
| 1493 | root_inode = new_inode(sb); | 1485 | root_inode = new_inode(sb); |
| 1494 | if (!root_inode) | 1486 | if (!root_inode) |
| 1495 | goto out_fail; | 1487 | goto out_fail; |
| @@ -1516,6 +1508,8 @@ out_invalid: | |||
| 1516 | fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem"); | 1508 | fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem"); |
| 1517 | 1509 | ||
| 1518 | out_fail: | 1510 | out_fail: |
| 1511 | if (fsinfo_inode) | ||
| 1512 | iput(fsinfo_inode); | ||
| 1519 | if (fat_inode) | 1513 | if (fat_inode) |
| 1520 | iput(fat_inode); | 1514 | iput(fat_inode); |
| 1521 | unload_nls(sbi->nls_io); | 1515 | unload_nls(sbi->nls_io); |
