Commit 797a8b13 authored by Christoph Hellwig's avatar Christoph Hellwig

[XFS] remove busy inode check in the umount path - Linux checked it for us...

[XFS] remove busy inode check in the umount path - Linux checked it for us before calling into the filesystem.  We're beyond the point of no return for umount anyway

SGI Modid: 2.5.x-xfs:slinx:142731a
parent 80d316b7
...@@ -3608,31 +3608,6 @@ xfs_ichgtime(xfs_inode_t *ip, ...@@ -3608,31 +3608,6 @@ xfs_ichgtime(xfs_inode_t *ip,
ip->i_update_core = 1; ip->i_update_core = 1;
} }
/*
* xfs_ibusy_check -- Checks whether inode reference count allows unmount
*
* The value returned is one if the reference count would prevent an unmount.
*/
int
xfs_ibusy_check(
xfs_inode_t *ip,
int refs)
{
xfs_mount_t *mp = ip->i_mount;
if ((refs == 1) && (ip == mp->m_rootip))
return (0);
if ((refs == 1) && (ip == mp->m_rbmip))
return (0);
if ((refs == 1) && (ip == mp->m_rsumip))
return (0);
if (mp->m_quotainfo && ip->i_ino == mp->m_sb.sb_uquotino)
return (0);
if (mp->m_quotainfo && ip->i_ino == mp->m_sb.sb_gquotino)
return (0);
return (1);
}
#ifdef XFS_ILOCK_TRACE #ifdef XFS_ILOCK_TRACE
void void
xfs_ilock_trace(xfs_inode_t *ip, int lock, unsigned int lockflags, inst_t *ra) xfs_ilock_trace(xfs_inode_t *ip, int lock, unsigned int lockflags, inst_t *ra)
......
...@@ -516,7 +516,6 @@ void xfs_iunpin(xfs_inode_t *); ...@@ -516,7 +516,6 @@ void xfs_iunpin(xfs_inode_t *);
int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
int xfs_iflush(xfs_inode_t *, uint); int xfs_iflush(xfs_inode_t *, uint);
int xfs_iflush_all(struct xfs_mount *, int); int xfs_iflush_all(struct xfs_mount *, int);
int xfs_ibusy_check(xfs_inode_t *, int);
int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *); int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *);
uint xfs_iroundup(uint); uint xfs_iroundup(uint);
void xfs_ichgtime(xfs_inode_t *, int); void xfs_ichgtime(xfs_inode_t *, int);
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
#include <xfs.h> #include <xfs.h>
STATIC int xfs_ibusy(xfs_mount_t *);
STATIC int xfs_sync(bhv_desc_t *, int, cred_t *); STATIC int xfs_sync(bhv_desc_t *, int, cred_t *);
STATIC int xfs_unmount(bhv_desc_t *, int, cred_t *);
int int
xfs_init(void) xfs_init(void)
...@@ -485,59 +483,6 @@ xfs_mount( ...@@ -485,59 +483,6 @@ xfs_mount(
return error; return error;
} }
/*
* xfs_ibusy searches for a busy inode in the mounted file system.
*
* Return 0 if there are no active inodes otherwise return 1.
*/
STATIC int
xfs_ibusy(
xfs_mount_t *mp)
{
xfs_inode_t *ip;
vnode_t *vp;
int busy;
busy = 0;
XFS_MOUNT_ILOCK(mp);
ip = mp->m_inodes;
if (ip == NULL) {
XFS_MOUNT_IUNLOCK(mp);
return busy;
}
do {
/* Skip markers inserted by xfs_sync */
if (ip->i_mount == NULL) {
ip = ip->i_mnext;
continue;
}
vp = XFS_ITOV_NULL(ip);
if (vp && vn_count(vp) != 0) {
if (xfs_ibusy_check(ip, vn_count(vp)) == 0) {
ip = ip->i_mnext;
continue;
}
#ifdef DEBUG
cmn_err(CE_WARN, "%s: busy vp=0x%p ip=0x%p "
"inum %Ld count=%d",
__FUNCTION__, vp, ip, ip->i_ino, vn_count(vp));
#endif
busy++;
}
ip = ip->i_mnext;
} while ((ip != mp->m_inodes) && !busy);
XFS_MOUNT_IUNLOCK(mp);
return busy;
}
STATIC int STATIC int
xfs_unmount( xfs_unmount(
bhv_desc_t *bdp, bhv_desc_t *bdp,
...@@ -572,16 +517,6 @@ xfs_unmount( ...@@ -572,16 +517,6 @@ xfs_unmount(
0 : DM_FLAGS_UNWANTED; 0 : DM_FLAGS_UNWANTED;
} }
/*
* Make sure there are no active users.
*/
if (xfs_ibusy(mp)) {
error = XFS_ERROR(EBUSY);
cmn_err(CE_ALERT, "%s: xfs_ibusy failed -- error code %d",
__FUNCTION__, error);
goto out;
}
XFS_bflush(mp->m_ddev_targp); XFS_bflush(mp->m_ddev_targp);
error = xfs_unmount_flush(mp, 0); error = xfs_unmount_flush(mp, 0);
if (error) if (error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment