aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iget.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_iget.c')
-rw-r--r--fs/xfs/xfs_iget.c42
1 files changed, 1 insertions, 41 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 4c92d190b3bd..1256746b249f 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -76,7 +76,6 @@ xfs_iget_core(
76{ 76{
77 struct inode *old_inode; 77 struct inode *old_inode;
78 xfs_inode_t *ip; 78 xfs_inode_t *ip;
79 xfs_inode_t *iq;
80 int error; 79 int error;
81 unsigned long first_index, mask; 80 unsigned long first_index, mask;
82 xfs_perag_t *pag; 81 xfs_perag_t *pag;
@@ -255,24 +254,6 @@ finish_inode:
255 254
256 write_unlock(&pag->pag_ici_lock); 255 write_unlock(&pag->pag_ici_lock);
257 radix_tree_preload_end(); 256 radix_tree_preload_end();
258
259 /*
260 * Link ip to its mount and thread it on the mount's inode list.
261 */
262 XFS_MOUNT_ILOCK(mp);
263 if ((iq = mp->m_inodes)) {
264 ASSERT(iq->i_mprev->i_mnext == iq);
265 ip->i_mprev = iq->i_mprev;
266 iq->i_mprev->i_mnext = ip;
267 iq->i_mprev = ip;
268 ip->i_mnext = iq;
269 } else {
270 ip->i_mnext = ip;
271 ip->i_mprev = ip;
272 }
273 mp->m_inodes = ip;
274
275 XFS_MOUNT_IUNLOCK(mp);
276 xfs_put_perag(mp, pag); 257 xfs_put_perag(mp, pag);
277 258
278 return_ip: 259 return_ip:
@@ -493,36 +474,15 @@ xfs_iextract(
493{ 474{
494 xfs_mount_t *mp = ip->i_mount; 475 xfs_mount_t *mp = ip->i_mount;
495 xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); 476 xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino);
496 xfs_inode_t *iq;
497 477
498 write_lock(&pag->pag_ici_lock); 478 write_lock(&pag->pag_ici_lock);
499 radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino)); 479 radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino));
500 write_unlock(&pag->pag_ici_lock); 480 write_unlock(&pag->pag_ici_lock);
501 xfs_put_perag(mp, pag); 481 xfs_put_perag(mp, pag);
502 482
503 /*
504 * Remove from mount's inode list.
505 */
506 XFS_MOUNT_ILOCK(mp);
507 ASSERT((ip->i_mnext != NULL) && (ip->i_mprev != NULL));
508 iq = ip->i_mnext;
509 iq->i_mprev = ip->i_mprev;
510 ip->i_mprev->i_mnext = iq;
511
512 /*
513 * Fix up the head pointer if it points to the inode being deleted.
514 */
515 if (mp->m_inodes == ip) {
516 if (ip == iq) {
517 mp->m_inodes = NULL;
518 } else {
519 mp->m_inodes = iq;
520 }
521 }
522
523 /* Deal with the deleted inodes list */ 483 /* Deal with the deleted inodes list */
484 XFS_MOUNT_ILOCK(mp);
524 list_del_init(&ip->i_reclaim); 485 list_del_init(&ip->i_reclaim);
525
526 mp->m_ireclaims++; 486 mp->m_ireclaims++;
527 XFS_MOUNT_IUNLOCK(mp); 487 XFS_MOUNT_IUNLOCK(mp);
528} 488}