aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 02:37:49 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:37:49 -0400
commit116545130cbc5214523c2f994a11c81ef9eb9186 (patch)
tree1cecd684b20bcbd6d163dd7120160277b58c2091 /fs
parent7a3be02baef7bdec43965103441bde5de4dd8601 (diff)
[XFS] kill deleted inodes list
Now that the deleted inodes list is unused, kill it. This also removes the i_reclaim list head from the xfs_inode, shrinking it by two pointers. SGI-PV: 988142 SGI-Modid: xfs-linux-melb:xfs-kern:32334a Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c6
-rw-r--r--fs/xfs/xfs_iget.c8
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_inode.h1
-rw-r--r--fs/xfs/xfs_mount.c1
-rw-r--r--fs/xfs/xfs_mount.h5
-rw-r--r--fs/xfs/xfs_vnodeops.c12
8 files changed, 10 insertions, 29 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 1d67d7f92a46..206a949e3870 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -913,7 +913,6 @@ xfs_fs_inode_init_once(
913 atomic_set(&ip->i_iocount, 0); 913 atomic_set(&ip->i_iocount, 0);
914 atomic_set(&ip->i_pincount, 0); 914 atomic_set(&ip->i_pincount, 0);
915 spin_lock_init(&ip->i_flags_lock); 915 spin_lock_init(&ip->i_flags_lock);
916 INIT_LIST_HEAD(&ip->i_reclaim);
917 init_waitqueue_head(&ip->i_ipin_wait); 916 init_waitqueue_head(&ip->i_ipin_wait);
918 /* 917 /*
919 * Because we want to use a counting completion, complete 918 * Because we want to use a counting completion, complete
@@ -1546,7 +1545,6 @@ xfs_fs_fill_super(
1546 goto out_free_args; 1545 goto out_free_args;
1547 1546
1548 spin_lock_init(&mp->m_sb_lock); 1547 spin_lock_init(&mp->m_sb_lock);
1549 mutex_init(&mp->m_ilock);
1550 mutex_init(&mp->m_growlock); 1548 mutex_init(&mp->m_growlock);
1551 atomic_set(&mp->m_active_trans, 0); 1549 atomic_set(&mp->m_active_trans, 0);
1552 INIT_LIST_HEAD(&mp->m_sync_list); 1550 INIT_LIST_HEAD(&mp->m_sync_list);
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index bbb40e27840b..22006b5733c4 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -644,6 +644,11 @@ xfs_reclaim_inode(
644 return 0; 644 return 0;
645} 645}
646 646
647/*
648 * We set the inode flag atomically with the radix tree tag.
649 * Once we get tag lookups on the radix tree, this inode flag
650 * can go away.
651 */
647void 652void
648xfs_inode_set_reclaim_tag( 653xfs_inode_set_reclaim_tag(
649 xfs_inode_t *ip) 654 xfs_inode_t *ip)
@@ -655,6 +660,7 @@ xfs_inode_set_reclaim_tag(
655 spin_lock(&ip->i_flags_lock); 660 spin_lock(&ip->i_flags_lock);
656 radix_tree_tag_set(&pag->pag_ici_root, 661 radix_tree_tag_set(&pag->pag_ici_root,
657 XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG); 662 XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
663 __xfs_iflags_set(ip, XFS_IRECLAIMABLE);
658 spin_unlock(&ip->i_flags_lock); 664 spin_unlock(&ip->i_flags_lock);
659 read_unlock(&pag->pag_ici_lock); 665 read_unlock(&pag->pag_ici_lock);
660 xfs_put_perag(mp, pag); 666 xfs_put_perag(mp, pag);
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index a0387f14c204..800133805ca1 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -95,10 +95,6 @@ xfs_iget_cache_hit(
95 /* clear the radix tree reclaim flag as well. */ 95 /* clear the radix tree reclaim flag as well. */
96 __xfs_inode_clear_reclaim_tag(mp, pag, ip); 96 __xfs_inode_clear_reclaim_tag(mp, pag, ip);
97 read_unlock(&pag->pag_ici_lock); 97 read_unlock(&pag->pag_ici_lock);
98
99 XFS_MOUNT_ILOCK(mp);
100 list_del_init(&ip->i_reclaim);
101 XFS_MOUNT_IUNLOCK(mp);
102 } else if (!igrab(VFS_I(ip))) { 98 } else if (!igrab(VFS_I(ip))) {
103 /* If the VFS inode is being torn down, pause and try again. */ 99 /* If the VFS inode is being torn down, pause and try again. */
104 error = EAGAIN; 100 error = EAGAIN;
@@ -419,11 +415,7 @@ xfs_iextract(
419 write_unlock(&pag->pag_ici_lock); 415 write_unlock(&pag->pag_ici_lock);
420 xfs_put_perag(mp, pag); 416 xfs_put_perag(mp, pag);
421 417
422 /* Deal with the deleted inodes list */
423 XFS_MOUNT_ILOCK(mp);
424 list_del_init(&ip->i_reclaim);
425 mp->m_ireclaims++; 418 mp->m_ireclaims++;
426 XFS_MOUNT_IUNLOCK(mp);
427} 419}
428 420
429/* 421/*
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 99d9118c4a41..4eb629f0513e 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -811,7 +811,7 @@ xfs_inode_alloc(
811 ASSERT(atomic_read(&ip->i_iocount) == 0); 811 ASSERT(atomic_read(&ip->i_iocount) == 0);
812 ASSERT(atomic_read(&ip->i_pincount) == 0); 812 ASSERT(atomic_read(&ip->i_pincount) == 0);
813 ASSERT(!spin_is_locked(&ip->i_flags_lock)); 813 ASSERT(!spin_is_locked(&ip->i_flags_lock));
814 ASSERT(list_empty(&ip->i_reclaim)); 814 ASSERT(completion_done(&ip->i_flush));
815 815
816 /* 816 /*
817 * initialise the VFS inode here to get failures 817 * initialise the VFS inode here to get failures
@@ -2729,7 +2729,7 @@ xfs_idestroy(
2729 ASSERT(atomic_read(&ip->i_iocount) == 0); 2729 ASSERT(atomic_read(&ip->i_iocount) == 0);
2730 ASSERT(atomic_read(&ip->i_pincount) == 0); 2730 ASSERT(atomic_read(&ip->i_pincount) == 0);
2731 ASSERT(!spin_is_locked(&ip->i_flags_lock)); 2731 ASSERT(!spin_is_locked(&ip->i_flags_lock));
2732 ASSERT(list_empty(&ip->i_reclaim)); 2732 ASSERT(completion_done(&ip->i_flush));
2733 kmem_zone_free(xfs_inode_zone, ip); 2733 kmem_zone_free(xfs_inode_zone, ip);
2734} 2734}
2735 2735
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 64e50ff9ad23..a5aeb9cfeae8 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -235,7 +235,6 @@ typedef struct dm_attrs_s {
235typedef struct xfs_inode { 235typedef struct xfs_inode {
236 /* Inode linking and identification information. */ 236 /* Inode linking and identification information. */
237 struct xfs_mount *i_mount; /* fs mount struct ptr */ 237 struct xfs_mount *i_mount; /* fs mount struct ptr */
238 struct list_head i_reclaim; /* reclaim list */
239 struct xfs_dquot *i_udquot; /* user dquot */ 238 struct xfs_dquot *i_udquot; /* user dquot */
240 struct xfs_dquot *i_gdquot; /* group dquot */ 239 struct xfs_dquot *i_gdquot; /* group dquot */
241 240
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 3704baefe2ef..177976dfea04 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -580,7 +580,6 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp)
580 mp->m_blockmask = sbp->sb_blocksize - 1; 580 mp->m_blockmask = sbp->sb_blocksize - 1;
581 mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG; 581 mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG;
582 mp->m_blockwmask = mp->m_blockwsize - 1; 582 mp->m_blockwmask = mp->m_blockwsize - 1;
583 INIT_LIST_HEAD(&mp->m_del_inodes);
584 583
585 /* 584 /*
586 * Setup for attributes, in case they get created. 585 * Setup for attributes, in case they get created.
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 4e62802b6abc..67cf0b2bb848 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -248,8 +248,6 @@ typedef struct xfs_mount {
248 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ 248 xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */
249 spinlock_t m_agirotor_lock;/* .. and lock protecting it */ 249 spinlock_t m_agirotor_lock;/* .. and lock protecting it */
250 xfs_agnumber_t m_maxagi; /* highest inode alloc group */ 250 xfs_agnumber_t m_maxagi; /* highest inode alloc group */
251 struct list_head m_del_inodes; /* inodes to reclaim */
252 mutex_t m_ilock; /* inode list mutex */
253 uint m_ireclaims; /* count of calls to reclaim*/ 251 uint m_ireclaims; /* count of calls to reclaim*/
254 uint m_readio_log; /* min read size log bytes */ 252 uint m_readio_log; /* min read size log bytes */
255 uint m_readio_blocks; /* min read size blocks */ 253 uint m_readio_blocks; /* min read size blocks */
@@ -312,8 +310,7 @@ typedef struct xfs_mount {
312 int m_attr_magicpct;/* 37% of the blocksize */ 310 int m_attr_magicpct;/* 37% of the blocksize */
313 int m_dir_magicpct; /* 37% of the dir blocksize */ 311 int m_dir_magicpct; /* 37% of the dir blocksize */
314 __uint8_t m_mk_sharedro; /* mark shared ro on unmount */ 312 __uint8_t m_mk_sharedro; /* mark shared ro on unmount */
315 __uint8_t m_inode_quiesce;/* call quiesce on new inodes. 313 __uint8_t m_inode_quiesce;/* call quiesce on new inodes. */
316 field governed by m_ilock */
317 __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ 314 __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */
318 const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ 315 const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */
319 int m_dirblksize; /* directory block sz--bytes */ 316 int m_dirblksize; /* directory block sz--bytes */
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index f89a73eb0167..1d15a320b9a6 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -2835,18 +2835,8 @@ xfs_reclaim(
2835 xfs_iflock(ip); 2835 xfs_iflock(ip);
2836 xfs_iflags_set(ip, XFS_IRECLAIMABLE); 2836 xfs_iflags_set(ip, XFS_IRECLAIMABLE);
2837 return xfs_reclaim_inode(ip, 1, XFS_IFLUSH_DELWRI_ELSE_SYNC); 2837 return xfs_reclaim_inode(ip, 1, XFS_IFLUSH_DELWRI_ELSE_SYNC);
2838 } else {
2839 xfs_mount_t *mp = ip->i_mount;
2840
2841 /* Protect sync and unpin from us */
2842 XFS_MOUNT_ILOCK(mp);
2843 spin_lock(&ip->i_flags_lock);
2844 __xfs_iflags_set(ip, XFS_IRECLAIMABLE);
2845 spin_unlock(&ip->i_flags_lock);
2846 list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
2847 XFS_MOUNT_IUNLOCK(mp);
2848 xfs_inode_set_reclaim_tag(ip);
2849 } 2838 }
2839 xfs_inode_set_reclaim_tag(ip);
2850 return 0; 2840 return 0;
2851} 2841}
2852 2842