The dev argument to xfs_mountfs can't be zero so it and the
code depending on that are superflous.
Spotted by Al Viro.
--- 1.6/fs/xfs/xfs_iocore.c Fri May 2 22:01:27 2003
+++ edited/fs/xfs/xfs_iocore.c Sat Jun 14 21:35:35 2003
@@ -77,8 +77,7 @@
struct xfs_mount_args *mntargs,
int flags)
{
- return xfs_mountfs(vfsp, XFS_VFSTOM(vfsp),
- vfsp->vfs_super->s_bdev->bd_dev, flags);
+ return xfs_mountfs(vfsp, XFS_VFSTOM(vfsp), flags);
}
xfs_ioops_t xfs_iocore_xfs = {
--- 1.30/fs/xfs/xfs_mount.c Mon May 19 21:11:14 2003
+++ edited/fs/xfs/xfs_mount.c Sat Jun 14 21:35:11 2003
@@ -620,7 +620,6 @@
xfs_mountfs(
vfs_t *vfsp,
xfs_mount_t *mp,
- dev_t dev,
int mfsi_flags)
{
xfs_buf_t *bp;
@@ -633,11 +632,10 @@
__uint64_t ret64;
__int64_t update_flags;
uint quotamount, quotaflags;
- int agno, noio;
+ int agno;
int uuid_mounted = 0;
int error = 0;
- noio = dev == 0 && mp->m_sb_bp != NULL;
if (mp->m_sb_bp == NULL) {
if ((error = xfs_readsb(mp))) {
return (error);
@@ -826,22 +824,20 @@
error = XFS_ERROR(E2BIG);
goto error1;
}
- if (!noio) {
- error = xfs_read_buf(mp, mp->m_ddev_targp,
- d - XFS_FSS_TO_BB(mp, 1),
- XFS_FSS_TO_BB(mp, 1), 0, &bp);
- if (!error) {
- xfs_buf_relse(bp);
- } else {
- cmn_err(CE_WARN, "XFS: size check 2 failed");
- if (error == ENOSPC) {
- error = XFS_ERROR(E2BIG);
- }
- goto error1;
+ error = xfs_read_buf(mp, mp->m_ddev_targp,
+ d - XFS_FSS_TO_BB(mp, 1),
+ XFS_FSS_TO_BB(mp, 1), 0, &bp);
+ if (!error) {
+ xfs_buf_relse(bp);
+ } else {
+ cmn_err(CE_WARN, "XFS: size check 2 failed");
+ if (error == ENOSPC) {
+ error = XFS_ERROR(E2BIG);
}
+ goto error1;
}
- if (!noio && ((mfsi_flags & XFS_MFSI_CLIENT) == 0) &&
+ if (((mfsi_flags & XFS_MFSI_CLIENT) == 0) &&
mp->m_logdev_targp != mp->m_ddev_targp) {
d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) {
@@ -918,10 +914,6 @@
* Initialize the precomputed transaction reservations values.
*/
xfs_trans_init(mp);
- if (noio) {
- ASSERT((mfsi_flags & XFS_MFSI_CLIENT) == 0);
- return 0;
- }
/*
* Allocate and initialize the inode hash table for this
--- 1.15/fs/xfs/xfs_mount.h Mon May 19 21:11:14 2003
+++ edited/fs/xfs/xfs_mount.h Sat Jun 14 21:35:21 2003
@@ -539,7 +539,7 @@
extern xfs_mount_t *xfs_mount_init(void);
extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
-extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, dev_t, int);
+extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, int);
extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *);
|