aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
-rw-r--r--fs/xfs/xfs_vfsops.c82
1 files changed, 44 insertions, 38 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index b6ad370fab3d..d4ec4dfaf19c 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -55,7 +55,7 @@
55#include "xfs_clnt.h" 55#include "xfs_clnt.h"
56#include "xfs_fsops.h" 56#include "xfs_fsops.h"
57 57
58STATIC int xfs_sync(bhv_desc_t *, int, cred_t *); 58STATIC int xfs_sync(bhv_desc_t *, int, cred_t *);
59 59
60int 60int
61xfs_init(void) 61xfs_init(void)
@@ -77,11 +77,12 @@ xfs_init(void)
77 "xfs_bmap_free_item"); 77 "xfs_bmap_free_item");
78 xfs_btree_cur_zone = kmem_zone_init(sizeof(xfs_btree_cur_t), 78 xfs_btree_cur_zone = kmem_zone_init(sizeof(xfs_btree_cur_t),
79 "xfs_btree_cur"); 79 "xfs_btree_cur");
80 xfs_inode_zone = kmem_zone_init(sizeof(xfs_inode_t), "xfs_inode");
81 xfs_trans_zone = kmem_zone_init(sizeof(xfs_trans_t), "xfs_trans"); 80 xfs_trans_zone = kmem_zone_init(sizeof(xfs_trans_t), "xfs_trans");
82 xfs_da_state_zone = 81 xfs_da_state_zone =
83 kmem_zone_init(sizeof(xfs_da_state_t), "xfs_da_state"); 82 kmem_zone_init(sizeof(xfs_da_state_t), "xfs_da_state");
84 xfs_dabuf_zone = kmem_zone_init(sizeof(xfs_dabuf_t), "xfs_dabuf"); 83 xfs_dabuf_zone = kmem_zone_init(sizeof(xfs_dabuf_t), "xfs_dabuf");
84 xfs_ifork_zone = kmem_zone_init(sizeof(xfs_ifork_t), "xfs_ifork");
85 xfs_acl_zone_init(xfs_acl_zone, "xfs_acl");
85 86
86 /* 87 /*
87 * The size of the zone allocated buf log item is the maximum 88 * The size of the zone allocated buf log item is the maximum
@@ -93,17 +94,30 @@ xfs_init(void)
93 (((XFS_MAX_BLOCKSIZE / XFS_BLI_CHUNK) / 94 (((XFS_MAX_BLOCKSIZE / XFS_BLI_CHUNK) /
94 NBWORD) * sizeof(int))), 95 NBWORD) * sizeof(int))),
95 "xfs_buf_item"); 96 "xfs_buf_item");
96 xfs_efd_zone = kmem_zone_init((sizeof(xfs_efd_log_item_t) + 97 xfs_efd_zone =
97 ((XFS_EFD_MAX_FAST_EXTENTS - 1) * sizeof(xfs_extent_t))), 98 kmem_zone_init((sizeof(xfs_efd_log_item_t) +
99 ((XFS_EFD_MAX_FAST_EXTENTS - 1) *
100 sizeof(xfs_extent_t))),
98 "xfs_efd_item"); 101 "xfs_efd_item");
99 xfs_efi_zone = kmem_zone_init((sizeof(xfs_efi_log_item_t) + 102 xfs_efi_zone =
100 ((XFS_EFI_MAX_FAST_EXTENTS - 1) * sizeof(xfs_extent_t))), 103 kmem_zone_init((sizeof(xfs_efi_log_item_t) +
104 ((XFS_EFI_MAX_FAST_EXTENTS - 1) *
105 sizeof(xfs_extent_t))),
101 "xfs_efi_item"); 106 "xfs_efi_item");
102 xfs_ifork_zone = kmem_zone_init(sizeof(xfs_ifork_t), "xfs_ifork"); 107
103 xfs_ili_zone = kmem_zone_init(sizeof(xfs_inode_log_item_t), "xfs_ili"); 108 /*
104 xfs_chashlist_zone = kmem_zone_init(sizeof(xfs_chashlist_t), 109 * These zones warrant special memory allocator hints
105 "xfs_chashlist"); 110 */
106 xfs_acl_zone_init(xfs_acl_zone, "xfs_acl"); 111 xfs_inode_zone =
112 kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode",
113 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
114 KM_ZONE_SPREAD, NULL);
115 xfs_ili_zone =
116 kmem_zone_init_flags(sizeof(xfs_inode_log_item_t), "xfs_ili",
117 KM_ZONE_SPREAD, NULL);
118 xfs_chashlist_zone =
119 kmem_zone_init_flags(sizeof(xfs_chashlist_t), "xfs_chashlist",
120 KM_ZONE_SPREAD, NULL);
107 121
108 /* 122 /*
109 * Allocate global trace buffers. 123 * Allocate global trace buffers.
@@ -176,18 +190,18 @@ xfs_cleanup(void)
176 ktrace_free(xfs_alloc_trace_buf); 190 ktrace_free(xfs_alloc_trace_buf);
177#endif 191#endif
178 192
179 kmem_cache_destroy(xfs_bmap_free_item_zone); 193 kmem_zone_destroy(xfs_bmap_free_item_zone);
180 kmem_cache_destroy(xfs_btree_cur_zone); 194 kmem_zone_destroy(xfs_btree_cur_zone);
181 kmem_cache_destroy(xfs_inode_zone); 195 kmem_zone_destroy(xfs_inode_zone);
182 kmem_cache_destroy(xfs_trans_zone); 196 kmem_zone_destroy(xfs_trans_zone);
183 kmem_cache_destroy(xfs_da_state_zone); 197 kmem_zone_destroy(xfs_da_state_zone);
184 kmem_cache_destroy(xfs_dabuf_zone); 198 kmem_zone_destroy(xfs_dabuf_zone);
185 kmem_cache_destroy(xfs_buf_item_zone); 199 kmem_zone_destroy(xfs_buf_item_zone);
186 kmem_cache_destroy(xfs_efd_zone); 200 kmem_zone_destroy(xfs_efd_zone);
187 kmem_cache_destroy(xfs_efi_zone); 201 kmem_zone_destroy(xfs_efi_zone);
188 kmem_cache_destroy(xfs_ifork_zone); 202 kmem_zone_destroy(xfs_ifork_zone);
189 kmem_cache_destroy(xfs_ili_zone); 203 kmem_zone_destroy(xfs_ili_zone);
190 kmem_cache_destroy(xfs_chashlist_zone); 204 kmem_zone_destroy(xfs_chashlist_zone);
191} 205}
192 206
193/* 207/*
@@ -258,8 +272,6 @@ xfs_start_flags(
258 mp->m_inoadd = XFS_INO64_OFFSET; 272 mp->m_inoadd = XFS_INO64_OFFSET;
259 } 273 }
260#endif 274#endif
261 if (ap->flags & XFSMNT_NOATIME)
262 mp->m_flags |= XFS_MOUNT_NOATIME;
263 if (ap->flags & XFSMNT_RETERR) 275 if (ap->flags & XFSMNT_RETERR)
264 mp->m_flags |= XFS_MOUNT_RETERR; 276 mp->m_flags |= XFS_MOUNT_RETERR;
265 if (ap->flags & XFSMNT_NOALIGN) 277 if (ap->flags & XFSMNT_NOALIGN)
@@ -620,7 +632,7 @@ xfs_quiesce_fs(
620 xfs_mount_t *mp) 632 xfs_mount_t *mp)
621{ 633{
622 int count = 0, pincount; 634 int count = 0, pincount;
623 635
624 xfs_refcache_purge_mp(mp); 636 xfs_refcache_purge_mp(mp);
625 xfs_flush_buftarg(mp->m_ddev_targp, 0); 637 xfs_flush_buftarg(mp->m_ddev_targp, 0);
626 xfs_finish_reclaim_all(mp, 0); 638 xfs_finish_reclaim_all(mp, 0);
@@ -631,7 +643,7 @@ xfs_quiesce_fs(
631 * meta data (typically directory updates). 643 * meta data (typically directory updates).
632 * Which then must be flushed and logged before 644 * Which then must be flushed and logged before
633 * we can write the unmount record. 645 * we can write the unmount record.
634 */ 646 */
635 do { 647 do {
636 xfs_syncsub(mp, SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT, 0, NULL); 648 xfs_syncsub(mp, SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT, 0, NULL);
637 pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1); 649 pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1);
@@ -654,11 +666,6 @@ xfs_mntupdate(
654 xfs_mount_t *mp = XFS_BHVTOM(bdp); 666 xfs_mount_t *mp = XFS_BHVTOM(bdp);
655 int error; 667 int error;
656 668
657 if (args->flags & XFSMNT_NOATIME)
658 mp->m_flags |= XFS_MOUNT_NOATIME;
659 else
660 mp->m_flags &= ~XFS_MOUNT_NOATIME;
661
662 if (args->flags & XFSMNT_BARRIER) 669 if (args->flags & XFSMNT_BARRIER)
663 mp->m_flags |= XFS_MOUNT_BARRIER; 670 mp->m_flags |= XFS_MOUNT_BARRIER;
664 else 671 else
@@ -814,6 +821,7 @@ xfs_statvfs(
814 821
815 statp->f_type = XFS_SB_MAGIC; 822 statp->f_type = XFS_SB_MAGIC;
816 823
824 xfs_icsb_sync_counters_lazy(mp);
817 s = XFS_SB_LOCK(mp); 825 s = XFS_SB_LOCK(mp);
818 statp->f_bsize = sbp->sb_blocksize; 826 statp->f_bsize = sbp->sb_blocksize;
819 lsize = sbp->sb_logstart ? sbp->sb_logblocks : 0; 827 lsize = sbp->sb_logstart ? sbp->sb_logblocks : 0;
@@ -1221,7 +1229,7 @@ xfs_sync_inodes(
1221 xfs_iunlock(ip, XFS_ILOCK_SHARED); 1229 xfs_iunlock(ip, XFS_ILOCK_SHARED);
1222 1230
1223 error = xfs_itobp(mp, NULL, ip, 1231 error = xfs_itobp(mp, NULL, ip,
1224 &dip, &bp, 0); 1232 &dip, &bp, 0, 0);
1225 if (!error) { 1233 if (!error) {
1226 xfs_buf_relse(bp); 1234 xfs_buf_relse(bp);
1227 } else { 1235 } else {
@@ -1690,10 +1698,7 @@ xfs_parseargs(
1690 int iosize; 1698 int iosize;
1691 1699
1692 args->flags2 |= XFSMNT2_COMPAT_IOSIZE; 1700 args->flags2 |= XFSMNT2_COMPAT_IOSIZE;
1693 1701 args->flags |= XFSMNT_IDELETE;
1694#if 0 /* XXX: off by default, until some remaining issues ironed out */
1695 args->flags |= XFSMNT_IDELETE; /* default to on */
1696#endif
1697 1702
1698 if (!options) 1703 if (!options)
1699 goto done; 1704 goto done;
@@ -1903,7 +1908,6 @@ xfs_showargs(
1903 { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, 1908 { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID },
1904 { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, 1909 { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY },
1905 { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, 1910 { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC },
1906 { XFS_MOUNT_IDELETE, "," MNTOPT_NOIKEEP },
1907 { 0, NULL } 1911 { 0, NULL }
1908 }; 1912 };
1909 struct proc_xfs_info *xfs_infop; 1913 struct proc_xfs_info *xfs_infop;
@@ -1939,6 +1943,8 @@ xfs_showargs(
1939 seq_printf(m, "," MNTOPT_SWIDTH "=%d", 1943 seq_printf(m, "," MNTOPT_SWIDTH "=%d",
1940 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); 1944 (int)XFS_FSB_TO_BB(mp, mp->m_swidth));
1941 1945
1946 if (!(mp->m_flags & XFS_MOUNT_IDELETE))
1947 seq_printf(m, "," MNTOPT_IKEEP);
1942 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) 1948 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE))
1943 seq_printf(m, "," MNTOPT_LARGEIO); 1949 seq_printf(m, "," MNTOPT_LARGEIO);
1944 if (mp->m_flags & XFS_MOUNT_BARRIER) 1950 if (mp->m_flags & XFS_MOUNT_BARRIER)