X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fjfs%2Fjfs_umount.c;h=7971f37534a359e0dcfed248cb56e56a14c7fac7;hb=ecd27b92fbb41f779d857632a69bd45dbaf0f915;hp=f31a9e3f3fecc6d19a04f49a82ea9a9b36176521;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6 diff --git a/fs/jfs/jfs_umount.c b/fs/jfs/jfs_umount.c index f31a9e3f3f..7971f37534 100644 --- a/fs/jfs/jfs_umount.c +++ b/fs/jfs/jfs_umount.c @@ -3,16 +3,16 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -22,8 +22,8 @@ * note: file system in transition to aggregate/fileset: * (ref. jfs_mount.c) * - * file system unmount is interpreted as mount of the single/only - * fileset in the aggregate and, if unmount of the last fileset, + * file system unmount is interpreted as mount of the single/only + * fileset in the aggregate and, if unmount of the last fileset, * as unmount of the aggerate; */ @@ -49,7 +49,6 @@ */ int jfs_umount(struct super_block *sb) { - struct address_space *bdev_mapping = sb->s_bdev->bd_inode->i_mapping; struct jfs_sb_info *sbi = JFS_SBI(sb); struct inode *ipbmap = sbi->ipbmap; struct inode *ipimap = sbi->ipimap; @@ -61,13 +60,13 @@ int jfs_umount(struct super_block *sb) jfs_info("UnMount JFS: sb:0x%p", sb); /* - * update superblock and close log + * update superblock and close log * * if mounted read-write and log based recovery was enabled */ if ((log = sbi->log)) /* - * Wait for outstanding transactions to be written to log: + * Wait for outstanding transactions to be written to log: */ jfs_flush_journal(log, 2); @@ -109,25 +108,21 @@ int jfs_umount(struct super_block *sb) * Make sure all metadata makes it to disk before we mark * the superblock as clean */ - filemap_fdatawrite(bdev_mapping); - filemap_fdatawait(bdev_mapping); + filemap_write_and_wait(sbi->direct_inode->i_mapping); /* * ensure all file system file pages are propagated to their - * home blocks on disk (and their in-memory buffer pages are + * home blocks on disk (and their in-memory buffer pages are * invalidated) BEFORE updating file system superblock state - * (to signify file system is unmounted cleanly, and thus in - * consistent state) and log superblock active file system + * (to signify file system is unmounted cleanly, and thus in + * consistent state) and log superblock active file system * list (to signify skip logredo()). */ if (log) { /* log = NULL if read-only mount */ updateSuper(sb, FM_CLEAN); - /* Restore default gfp_mask for bdev */ - mapping_set_gfp_mask(bdev_mapping, GFP_USER); - /* - * close log: + * close log: * * remove file system from log active file system list. */ @@ -140,7 +135,6 @@ int jfs_umount(struct super_block *sb) int jfs_umount_rw(struct super_block *sb) { - struct address_space *bdev_mapping = sb->s_bdev->bd_inode->i_mapping; struct jfs_sb_info *sbi = JFS_SBI(sb); struct jfs_log *log = sbi->log; @@ -148,7 +142,7 @@ int jfs_umount_rw(struct super_block *sb) return 0; /* - * close log: + * close log: * * remove file system from log active file system list. */ @@ -166,13 +160,9 @@ int jfs_umount_rw(struct super_block *sb) * mark the superblock clean before everything is flushed to * disk. */ - filemap_fdatawrite(bdev_mapping); - filemap_fdatawait(bdev_mapping); + filemap_write_and_wait(sbi->direct_inode->i_mapping); updateSuper(sb, FM_CLEAN); - /* Restore default gfp_mask for bdev */ - mapping_set_gfp_mask(bdev_mapping, GFP_USER); - return lmLogClose(sb); }