aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2009-03-03 14:48:37 -0500
committerFelix Blyakher <felixb@sgi.com>2009-03-04 08:31:55 -0500
commitb79631330a653f568a2ac4eb4a32474c80e3fe77 (patch)
tree4e8f3311b90005d8ff514828786172a353471502 /fs
parented93ec3907f063268ced18728d0653f6199d100c (diff)
xfs: only issues a cache flush on unmount if barriers are enabled
Currently we unconditionally issue a flush from xfs_free_buftarg, but since 2.6.29-rc1 this gives a warning in the style of end_request: I/O error, dev vdb, sector 0 Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Felix Blyakher <felixb@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c12
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.h2
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c10
3 files changed, 16 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index cb329edc925b..aa1016bb9134 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -34,6 +34,12 @@
34#include <linux/backing-dev.h> 34#include <linux/backing-dev.h>
35#include <linux/freezer.h> 35#include <linux/freezer.h>
36 36
37#include "xfs_sb.h"
38#include "xfs_inum.h"
39#include "xfs_ag.h"
40#include "xfs_dmapi.h"
41#include "xfs_mount.h"
42
37static kmem_zone_t *xfs_buf_zone; 43static kmem_zone_t *xfs_buf_zone;
38STATIC int xfsbufd(void *); 44STATIC int xfsbufd(void *);
39STATIC int xfsbufd_wakeup(int, gfp_t); 45STATIC int xfsbufd_wakeup(int, gfp_t);
@@ -1435,10 +1441,12 @@ xfs_unregister_buftarg(
1435 1441
1436void 1442void
1437xfs_free_buftarg( 1443xfs_free_buftarg(
1438 xfs_buftarg_t *btp) 1444 struct xfs_mount *mp,
1445 struct xfs_buftarg *btp)
1439{ 1446{
1440 xfs_flush_buftarg(btp, 1); 1447 xfs_flush_buftarg(btp, 1);
1441 xfs_blkdev_issue_flush(btp); 1448 if (mp->m_flags & XFS_MOUNT_BARRIER)
1449 xfs_blkdev_issue_flush(btp);
1442 xfs_free_bufhash(btp); 1450 xfs_free_bufhash(btp);
1443 iput(btp->bt_mapping->host); 1451 iput(btp->bt_mapping->host);
1444 1452
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index 288ae7c4c800..9b4d666ad31f 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -413,7 +413,7 @@ static inline int XFS_bwrite(xfs_buf_t *bp)
413 * Handling of buftargs. 413 * Handling of buftargs.
414 */ 414 */
415extern xfs_buftarg_t *xfs_alloc_buftarg(struct block_device *, int); 415extern xfs_buftarg_t *xfs_alloc_buftarg(struct block_device *, int);
416extern void xfs_free_buftarg(xfs_buftarg_t *); 416extern void xfs_free_buftarg(struct xfs_mount *, struct xfs_buftarg *);
417extern void xfs_wait_buftarg(xfs_buftarg_t *); 417extern void xfs_wait_buftarg(xfs_buftarg_t *);
418extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int); 418extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int);
419extern int xfs_flush_buftarg(xfs_buftarg_t *, int); 419extern int xfs_flush_buftarg(xfs_buftarg_t *, int);
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index bc1e64708e2b..8483b35821e0 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -733,15 +733,15 @@ xfs_close_devices(
733{ 733{
734 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { 734 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
735 struct block_device *logdev = mp->m_logdev_targp->bt_bdev; 735 struct block_device *logdev = mp->m_logdev_targp->bt_bdev;
736 xfs_free_buftarg(mp->m_logdev_targp); 736 xfs_free_buftarg(mp, mp->m_logdev_targp);
737 xfs_blkdev_put(logdev); 737 xfs_blkdev_put(logdev);
738 } 738 }
739 if (mp->m_rtdev_targp) { 739 if (mp->m_rtdev_targp) {
740 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev; 740 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev;
741 xfs_free_buftarg(mp->m_rtdev_targp); 741 xfs_free_buftarg(mp, mp->m_rtdev_targp);
742 xfs_blkdev_put(rtdev); 742 xfs_blkdev_put(rtdev);
743 } 743 }
744 xfs_free_buftarg(mp->m_ddev_targp); 744 xfs_free_buftarg(mp, mp->m_ddev_targp);
745} 745}
746 746
747/* 747/*
@@ -810,9 +810,9 @@ xfs_open_devices(
810 810
811 out_free_rtdev_targ: 811 out_free_rtdev_targ:
812 if (mp->m_rtdev_targp) 812 if (mp->m_rtdev_targp)
813 xfs_free_buftarg(mp->m_rtdev_targp); 813 xfs_free_buftarg(mp, mp->m_rtdev_targp);
814 out_free_ddev_targ: 814 out_free_ddev_targ:
815 xfs_free_buftarg(mp->m_ddev_targp); 815 xfs_free_buftarg(mp, mp->m_ddev_targp);
816 out_close_rtdev: 816 out_close_rtdev:
817 if (rtdev) 817 if (rtdev)
818 xfs_blkdev_put(rtdev); 818 xfs_blkdev_put(rtdev);