aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-09-29 22:25:54 -0400
committerAlex Elder <aelder@sgi.com>2010-10-18 16:07:58 -0400
commit61ba35dea0593fbc8d062cab3e4c4c3da5ce7104 (patch)
treefa28b2c9d0c5a71f1d0415b042d45a7a56b8c2ff /fs/xfs
parent50f59e8eed85ec4c79bc2454ed50c7886f6c5ebf (diff)
xfs: remove XFS_MOUNT_NO_PERCPU_SB
Fail the mount if we can't allocate memory for the per-CPU counters. This is consistent with how we handle everything else in the mount path and makes the superblock counter modification a lot simpler. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c6
-rw-r--r--fs/xfs/xfs_mount.c40
-rw-r--r--fs/xfs/xfs_mount.h2
3 files changed, 19 insertions, 29 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 4759be4daa26..a316c7316702 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1518,8 +1518,9 @@ xfs_fs_fill_super(
1518 if (error) 1518 if (error)
1519 goto out_free_fsname; 1519 goto out_free_fsname;
1520 1520
1521 if (xfs_icsb_init_counters(mp)) 1521 error = xfs_icsb_init_counters(mp);
1522 mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; 1522 if (error)
1523 goto out_close_devices;
1523 1524
1524 error = xfs_readsb(mp, flags); 1525 error = xfs_readsb(mp, flags);
1525 if (error) 1526 if (error)
@@ -1580,6 +1581,7 @@ xfs_fs_fill_super(
1580 xfs_freesb(mp); 1581 xfs_freesb(mp);
1581 out_destroy_counters: 1582 out_destroy_counters:
1582 xfs_icsb_destroy_counters(mp); 1583 xfs_icsb_destroy_counters(mp);
1584 out_close_devices:
1583 xfs_close_devices(mp); 1585 xfs_close_devices(mp);
1584 out_free_fsname: 1586 out_free_fsname:
1585 xfs_free_fsname(mp); 1587 xfs_free_fsname(mp);
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index cfa2fb4e7f97..55de83585e00 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1856,12 +1856,8 @@ xfs_mod_incore_sb(
1856 case XFS_SBS_ICOUNT: 1856 case XFS_SBS_ICOUNT:
1857 case XFS_SBS_IFREE: 1857 case XFS_SBS_IFREE:
1858 case XFS_SBS_FDBLOCKS: 1858 case XFS_SBS_FDBLOCKS:
1859 if (!(mp->m_flags & XFS_MOUNT_NO_PERCPU_SB)) { 1859 status = xfs_icsb_modify_counters(mp, field, delta, rsvd);
1860 status = xfs_icsb_modify_counters(mp, field, 1860 break;
1861 delta, rsvd);
1862 break;
1863 }
1864 /* FALLTHROUGH */
1865#endif 1861#endif
1866 default: 1862 default:
1867 spin_lock(&mp->m_sb_lock); 1863 spin_lock(&mp->m_sb_lock);
@@ -1910,15 +1906,12 @@ xfs_mod_incore_sb_batch(xfs_mount_t *mp, xfs_mod_sb_t *msb, uint nmsb, int rsvd)
1910 case XFS_SBS_ICOUNT: 1906 case XFS_SBS_ICOUNT:
1911 case XFS_SBS_IFREE: 1907 case XFS_SBS_IFREE:
1912 case XFS_SBS_FDBLOCKS: 1908 case XFS_SBS_FDBLOCKS:
1913 if (!(mp->m_flags & XFS_MOUNT_NO_PERCPU_SB)) { 1909 spin_unlock(&mp->m_sb_lock);
1914 spin_unlock(&mp->m_sb_lock); 1910 status = xfs_icsb_modify_counters(mp,
1915 status = xfs_icsb_modify_counters(mp, 1911 msbp->msb_field,
1916 msbp->msb_field, 1912 msbp->msb_delta, rsvd);
1917 msbp->msb_delta, rsvd); 1913 spin_lock(&mp->m_sb_lock);
1918 spin_lock(&mp->m_sb_lock); 1914 break;
1919 break;
1920 }
1921 /* FALLTHROUGH */
1922#endif 1915#endif
1923 default: 1916 default:
1924 status = xfs_mod_incore_sb_unlocked(mp, 1917 status = xfs_mod_incore_sb_unlocked(mp,
@@ -1948,16 +1941,13 @@ xfs_mod_incore_sb_batch(xfs_mount_t *mp, xfs_mod_sb_t *msb, uint nmsb, int rsvd)
1948 case XFS_SBS_ICOUNT: 1941 case XFS_SBS_ICOUNT:
1949 case XFS_SBS_IFREE: 1942 case XFS_SBS_IFREE:
1950 case XFS_SBS_FDBLOCKS: 1943 case XFS_SBS_FDBLOCKS:
1951 if (!(mp->m_flags & XFS_MOUNT_NO_PERCPU_SB)) { 1944 spin_unlock(&mp->m_sb_lock);
1952 spin_unlock(&mp->m_sb_lock); 1945 status = xfs_icsb_modify_counters(mp,
1953 status = xfs_icsb_modify_counters(mp, 1946 msbp->msb_field,
1954 msbp->msb_field, 1947 -(msbp->msb_delta),
1955 -(msbp->msb_delta), 1948 rsvd);
1956 rsvd); 1949 spin_lock(&mp->m_sb_lock);
1957 spin_lock(&mp->m_sb_lock); 1950 break;
1958 break;
1959 }
1960 /* FALLTHROUGH */
1961#endif 1951#endif
1962 default: 1952 default:
1963 status = xfs_mod_incore_sb_unlocked(mp, 1953 status = xfs_mod_incore_sb_unlocked(mp,
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 7ab240930ba5..a9d366e7656a 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -232,8 +232,6 @@ typedef struct xfs_mount {
232#define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */ 232#define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */
233#define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred 233#define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred
234 * I/O size in stat() */ 234 * I/O size in stat() */
235#define XFS_MOUNT_NO_PERCPU_SB (1ULL << 23) /* don't use per-cpu superblock
236 counters */
237#define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams 235#define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams
238 allocator */ 236 allocator */
239#define XFS_MOUNT_NOATTR2 (1ULL << 25) /* disable use of attr2 format */ 237#define XFS_MOUNT_NOATTR2 (1ULL << 25) /* disable use of attr2 format */