Commit 3952101e authored by Christoph Hellwig's avatar Christoph Hellwig

[XFS] add a new xfs_mount parameter to xfs_blkdev_get

SGI Modid: 2.5.x-xfs:slinx:134788a
parent c5c9a566
......@@ -466,8 +466,10 @@ xfs_initialize_vnode(
}
}
/*ARGSUSED*/
int
xfs_blkdev_get(
xfs_mount_t *mp,
const char *name,
struct block_device **bdevp)
{
......
......@@ -78,12 +78,14 @@
#define LINVFS_SET_VFS(s, vfsp) \
((s)->s_fs_info = vfsp)
struct xfs_mount;
struct pb_target;
struct block_device;
extern void xfs_initialize_vnode (bhv_desc_t *, vnode_t *, bhv_desc_t *, int);
extern int xfs_blkdev_get (const char *, struct block_device **);
extern int xfs_blkdev_get (struct xfs_mount *, const char *,
struct block_device **);
extern void xfs_blkdev_put (struct block_device *);
extern struct pb_target *xfs_alloc_buftarg (struct block_device *);
......
......@@ -428,11 +428,6 @@ int xfs_syncsub(xfs_mount_t *, int, int, int *);
void xfs_initialize_perag(xfs_mount_t *, int);
void xfs_xlatesb(void *, struct xfs_sb *, int, xfs_arch_t, __int64_t);
int xfs_blkdev_get(const char *, struct block_device **);
void xfs_blkdev_put(struct block_device *);
struct xfs_buftarg *xfs_alloc_buftarg(struct block_device *);
void xfs_free_buftarg(struct xfs_buftarg *);
/*
* Flags for freeze operations.
*/
......
......@@ -381,8 +381,9 @@ xfs_finish_flags(
* (2) logical volume with data and log subvolumes.
* (3) logical volume with data, log, and realtime subvolumes.
*
* The Linux VFS took care of finding and opening the data volume for
* us. We have to handle the other two (if present) here.
* We only have to handle opening the log and realtime volumes here if
* they are present. The data subvolume has already been opened by
* get_sb_bdev() and is stored in vfsp->vfs_super->s_bdev.
*/
STATIC int
xfs_mount(
......@@ -398,19 +399,24 @@ xfs_mount(
ddev = vfsp->vfs_super->s_bdev;
logdev = rtdev = NULL;
/*
* Allocate VFS private data (xfs mount structure).
*/
mp = xfs_mount_init();
/*
* Open real time and log devices - order is important.
*/
if (args->logname[0]) {
error = xfs_blkdev_get(args->logname, &logdev);
error = xfs_blkdev_get(mp, args->logname, &logdev);
if (error)
return error;
goto free_mp;
}
if (args->rtname[0]) {
error = xfs_blkdev_get(args->rtname, &rtdev);
error = xfs_blkdev_get(mp, args->rtname, &rtdev);
if (error) {
xfs_blkdev_put(logdev);
return error;
goto free_mp;
}
if (rtdev == ddev || rtdev == logdev) {
......@@ -418,15 +424,11 @@ xfs_mount(
"XFS: Cannot mount filesystem with identical rtdev and ddev/logdev.");
xfs_blkdev_put(logdev);
xfs_blkdev_put(rtdev);
return EINVAL;
error = EINVAL;
goto free_mp;
}
}
/*
* Allocate VFS private data (xfs mount structure).
*/
mp = xfs_mount_init();
vfs_insertbhv(vfsp, &mp->m_bhv, &xfs_vfsops, mp);
mp->m_ddev_targp = xfs_alloc_buftarg(ddev);
......@@ -476,6 +478,8 @@ xfs_mount(
xfs_binval(mp->m_rtdev_targp);
}
xfs_unmountfs_close(mp, NULL);
free_mp:
xfs_mount_free(mp, 1);
return 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