提交 b267ce99 编写于 作者: C Christoph Hellwig 提交者: Tim Shimmin

[XFS] kill struct bhv_vfs

Now that struct bhv_vfs doesn't have any members left we can kill it and
go directly from the super_block to the xfs_mount everywhere.

SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29509a
Signed-off-by: NChristoph Hellwig <hch@infradead.org>
Signed-off-by: NDavid Chinner <dgc@sgi.com>
Signed-off-by: NTim Shimmin <tes@sgi.com>
上级 74394496
...@@ -107,7 +107,6 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \ ...@@ -107,7 +107,6 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \
xfs_iops.o \ xfs_iops.o \
xfs_lrw.o \ xfs_lrw.o \
xfs_super.o \ xfs_super.o \
xfs_vfs.o \
xfs_vnode.o) xfs_vnode.o)
# Objects in support/ # Objects in support/
......
...@@ -621,7 +621,7 @@ xfs_write( ...@@ -621,7 +621,7 @@ xfs_write(
io = &xip->i_iocore; io = &xip->i_iocore;
mp = io->io_mount; mp = io->io_mount;
vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_WRITE); xfs_wait_for_freeze(mp, SB_FREEZE_WRITE);
if (XFS_FORCED_SHUTDOWN(mp)) if (XFS_FORCED_SHUTDOWN(mp))
return -EIO; return -EIO;
......
...@@ -511,7 +511,7 @@ xfs_flush_device_work( ...@@ -511,7 +511,7 @@ xfs_flush_device_work(
void *arg) void *arg)
{ {
struct inode *inode = arg; struct inode *inode = arg;
sync_blockdev(mp->m_vfsp->vfs_super->s_bdev); sync_blockdev(mp->m_super->s_bdev);
iput(inode); iput(inode);
} }
...@@ -593,7 +593,6 @@ STATIC void ...@@ -593,7 +593,6 @@ STATIC void
xfs_fs_put_super( xfs_fs_put_super(
struct super_block *sb) struct super_block *sb)
{ {
bhv_vfs_t *vfsp = vfs_from_sb(sb);
struct xfs_mount *mp = XFS_M(sb); struct xfs_mount *mp = XFS_M(sb);
int error; int error;
...@@ -601,12 +600,8 @@ xfs_fs_put_super( ...@@ -601,12 +600,8 @@ xfs_fs_put_super(
xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI); xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI);
error = xfs_unmount(mp, 0, NULL); error = xfs_unmount(mp, 0, NULL);
if (error) { if (error)
printk("XFS: unmount got error=%d\n", error); printk("XFS: unmount got error=%d\n", error);
printk("%s: vfs=0x%p left dangling!\n", __FUNCTION__, vfsp);
} else {
vfs_deallocate(vfsp);
}
} }
STATIC void STATIC void
...@@ -764,7 +759,6 @@ xfs_fs_fill_super( ...@@ -764,7 +759,6 @@ xfs_fs_fill_super(
int silent) int silent)
{ {
struct inode *rootvp; struct inode *rootvp;
struct bhv_vfs *vfsp = vfs_allocate(sb);
struct xfs_mount *mp = NULL; struct xfs_mount *mp = NULL;
struct xfs_mount_args *args = xfs_args_allocate(sb, silent); struct xfs_mount_args *args = xfs_args_allocate(sb, silent);
struct kstatfs statvfs; struct kstatfs statvfs;
...@@ -776,8 +770,8 @@ xfs_fs_fill_super( ...@@ -776,8 +770,8 @@ xfs_fs_fill_super(
spin_lock_init(&mp->m_sync_lock); spin_lock_init(&mp->m_sync_lock);
init_waitqueue_head(&mp->m_wait_single_sync_task); init_waitqueue_head(&mp->m_wait_single_sync_task);
mp->m_vfsp = vfsp; mp->m_super = sb;
vfsp->vfs_mount = mp; sb->s_fs_info = mp;
if (sb->s_flags & MS_RDONLY) if (sb->s_flags & MS_RDONLY)
mp->m_flags |= XFS_MOUNT_RDONLY; mp->m_flags |= XFS_MOUNT_RDONLY;
...@@ -847,7 +841,6 @@ xfs_fs_fill_super( ...@@ -847,7 +841,6 @@ xfs_fs_fill_super(
xfs_unmount(mp, 0, NULL); xfs_unmount(mp, 0, NULL);
fail_vfsop: fail_vfsop:
vfs_deallocate(vfsp);
kmem_free(args, sizeof(*args)); kmem_free(args, sizeof(*args));
return -error; return -error;
} }
......
...@@ -120,7 +120,6 @@ extern void xfs_blkdev_issue_flush(struct xfs_buftarg *); ...@@ -120,7 +120,6 @@ extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
extern struct export_operations xfs_export_operations; extern struct export_operations xfs_export_operations;
#define XFS_M(sb) \ #define XFS_M(sb) ((struct xfs_mount *)((sb)->s_fs_info))
XFS_VFSTOM(vfs_from_sb(sb))
#endif /* __XFS_SUPER_H__ */ #endif /* __XFS_SUPER_H__ */
/*
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_inum.h"
#include "xfs_log.h"
#include "xfs_clnt.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_dir2.h"
#include "xfs_imap.h"
#include "xfs_alloc.h"
#include "xfs_dmapi.h"
#include "xfs_mount.h"
#include "xfs_quota.h"
int
vfs_mount(
struct bhv_desc *bdp,
struct xfs_mount_args *args,
struct cred *cr)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_mount)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_mount)(next, args, cr));
}
int
vfs_parseargs(
struct bhv_desc *bdp,
char *s,
struct xfs_mount_args *args,
int f)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_parseargs)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_parseargs)(next, s, args, f));
}
int
vfs_showargs(
struct bhv_desc *bdp,
struct seq_file *m)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_showargs)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_showargs)(next, m));
}
int
vfs_unmount(
struct bhv_desc *bdp,
int fl,
struct cred *cr)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_unmount)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_unmount)(next, fl, cr));
}
int
vfs_mntupdate(
struct bhv_desc *bdp,
int *fl,
struct xfs_mount_args *args)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_mntupdate)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_mntupdate)(next, fl, args));
}
int
vfs_root(
struct bhv_desc *bdp,
bhv_vnode_t **vpp)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_root)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_root)(next, vpp));
}
int
vfs_statvfs(
struct bhv_desc *bdp,
bhv_statvfs_t *statp,
bhv_vnode_t *vp)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_statvfs)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_statvfs)(next, statp, vp));
}
int
vfs_sync(
struct bhv_desc *bdp,
int fl,
struct cred *cr)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_sync)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_sync)(next, fl, cr));
}
int
vfs_vget(
struct bhv_desc *bdp,
bhv_vnode_t **vpp,
struct fid *fidp)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_vget)
next = BHV_NEXT(next);
return ((*bhvtovfsops(next)->vfs_vget)(next, vpp, fidp));
}
void
vfs_init_vnode(
struct bhv_desc *bdp,
bhv_vnode_t *vp,
struct xfs_inode *ip,
int unlock)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_init_vnode)
next = BHV_NEXT(next);
((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, ip, unlock));
}
void
vfs_force_shutdown(
struct bhv_desc *bdp,
int fl,
char *file,
int line)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_force_shutdown)
next = BHV_NEXT(next);
((*bhvtovfsops(next)->vfs_force_shutdown)(next, fl, file, line));
}
void
vfs_freeze(
struct bhv_desc *bdp)
{
struct bhv_desc *next = bdp;
ASSERT(next);
while (! (bhvtovfsops(next))->vfs_freeze)
next = BHV_NEXT(next);
((*bhvtovfsops(next)->vfs_freeze)(next));
}
bhv_vfs_t *
vfs_allocate(
struct super_block *sb)
{
struct bhv_vfs *vfsp;
vfsp = kmem_zalloc(sizeof(bhv_vfs_t), KM_SLEEP);
vfsp->vfs_super = sb;
sb->s_fs_info = vfsp;
return vfsp;
}
bhv_vfs_t *
vfs_from_sb(
struct super_block *sb)
{
return (bhv_vfs_t *)sb->s_fs_info;
}
void
vfs_deallocate(
struct bhv_vfs *vfsp)
{
kmem_free(vfsp, sizeof(bhv_vfs_t));
}
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <linux/vfs.h> #include <linux/vfs.h>
#include "xfs_fs.h" #include "xfs_fs.h"
struct bhv_vfs;
struct inode; struct inode;
struct fid; struct fid;
...@@ -41,11 +40,6 @@ typedef struct bhv_vfs_sync_work { ...@@ -41,11 +40,6 @@ typedef struct bhv_vfs_sync_work {
void (*w_syncer)(struct xfs_mount *, void *); void (*w_syncer)(struct xfs_mount *, void *);
} bhv_vfs_sync_work_t; } bhv_vfs_sync_work_t;
typedef struct bhv_vfs {
struct xfs_mount *vfs_mount;
struct super_block *vfs_super; /* generic superblock pointer */
} bhv_vfs_t;
#define SYNC_ATTR 0x0001 /* sync attributes */ #define SYNC_ATTR 0x0001 /* sync attributes */
#define SYNC_CLOSE 0x0002 /* close file system down */ #define SYNC_CLOSE 0x0002 /* close file system down */
#define SYNC_DELWRI 0x0004 /* look at delayed writes */ #define SYNC_DELWRI 0x0004 /* look at delayed writes */
...@@ -78,11 +72,7 @@ typedef struct bhv_vfs { ...@@ -78,11 +72,7 @@ typedef struct bhv_vfs {
#define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */ #define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */
#define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */ #define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */
#define vfs_test_for_freeze(vfs) ((vfs)->vfs_super->s_frozen) #define xfs_test_for_freeze(mp) ((mp)->m_super->s_frozen)
#define vfs_wait_for_freeze(vfs,l) vfs_check_frozen((vfs)->vfs_super, (l)) #define xfs_wait_for_freeze(mp,l) vfs_check_frozen((mp)->m_super, (l))
extern bhv_vfs_t *vfs_allocate(struct super_block *);
extern bhv_vfs_t *vfs_from_sb(struct super_block *);
extern void vfs_deallocate(bhv_vfs_t *);
#endif /* __XFS_VFS_H__ */ #endif /* __XFS_VFS_H__ */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#define __XFS_VNODE_H__ #define __XFS_VNODE_H__
struct file; struct file;
struct bhv_vfs;
struct bhv_vattr; struct bhv_vattr;
struct xfs_iomap; struct xfs_iomap;
struct attrlist_cursor_kern; struct attrlist_cursor_kern;
......
...@@ -174,7 +174,7 @@ xfs_growfs_data_private( ...@@ -174,7 +174,7 @@ xfs_growfs_data_private(
memset(&mp->m_perag[oagcount], 0, memset(&mp->m_perag[oagcount], 0,
(nagcount - oagcount) * sizeof(xfs_perag_t)); (nagcount - oagcount) * sizeof(xfs_perag_t));
mp->m_flags |= XFS_MOUNT_32BITINODES; mp->m_flags |= XFS_MOUNT_32BITINODES;
nagimax = xfs_initialize_perag(XFS_MTOVFS(mp), mp, nagcount); nagimax = xfs_initialize_perag(mp, nagcount);
up_write(&mp->m_peraglock); up_write(&mp->m_peraglock);
} }
tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS);
...@@ -626,8 +626,7 @@ xfs_fs_goingdown( ...@@ -626,8 +626,7 @@ xfs_fs_goingdown(
{ {
switch (inflags) { switch (inflags) {
case XFS_FSOP_GOING_FLAGS_DEFAULT: { case XFS_FSOP_GOING_FLAGS_DEFAULT: {
struct bhv_vfs *vfsp = XFS_MTOVFS(mp); struct super_block *sb = freeze_bdev(mp->m_super->s_bdev);
struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev);
if (sb && !IS_ERR(sb)) { if (sb && !IS_ERR(sb)) {
xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT);
......
...@@ -369,7 +369,7 @@ xfs_iget( ...@@ -369,7 +369,7 @@ xfs_iget(
XFS_STATS_INC(xs_ig_attempts); XFS_STATS_INC(xs_ig_attempts);
retry: retry:
inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino); inode = iget_locked(mp->m_super, ino);
if (inode) { if (inode) {
xfs_inode_t *ip; xfs_inode_t *ip;
......
...@@ -57,11 +57,11 @@ xfs_size_fn( ...@@ -57,11 +57,11 @@ xfs_size_fn(
STATIC int STATIC int
xfs_ioinit( xfs_ioinit(
struct bhv_vfs *vfsp, struct xfs_mount *mp,
struct xfs_mount_args *mntargs, struct xfs_mount_args *mntargs,
int flags) int flags)
{ {
return xfs_mountfs(vfsp, XFS_VFSTOM(vfsp), flags); return xfs_mountfs(mp, flags);
} }
xfs_ioops_t xfs_iocore_xfs = { xfs_ioops_t xfs_iocore_xfs = {
......
...@@ -341,7 +341,6 @@ xfs_initialize_perag_icache( ...@@ -341,7 +341,6 @@ xfs_initialize_perag_icache(
xfs_agnumber_t xfs_agnumber_t
xfs_initialize_perag( xfs_initialize_perag(
bhv_vfs_t *vfs,
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_agnumber_t agcount) xfs_agnumber_t agcount)
{ {
...@@ -748,7 +747,6 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount) ...@@ -748,7 +747,6 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount)
*/ */
int int
xfs_mountfs( xfs_mountfs(
bhv_vfs_t *vfsp,
xfs_mount_t *mp, xfs_mount_t *mp,
int mfsi_flags) int mfsi_flags)
{ {
...@@ -1025,7 +1023,7 @@ xfs_mountfs( ...@@ -1025,7 +1023,7 @@ xfs_mountfs(
mp->m_perag = mp->m_perag =
kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP); kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP);
mp->m_maxagi = xfs_initialize_perag(vfsp, mp, sbp->sb_agcount); mp->m_maxagi = xfs_initialize_perag(mp, sbp->sb_agcount);
/* /*
* log's mount-time initialization. Perform 1st part recovery if needed * log's mount-time initialization. Perform 1st part recovery if needed
...@@ -1192,7 +1190,6 @@ xfs_mountfs( ...@@ -1192,7 +1190,6 @@ xfs_mountfs(
int int
xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
{ {
struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
__uint64_t resblks; __uint64_t resblks;
/* /*
...@@ -1258,7 +1255,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) ...@@ -1258,7 +1255,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
#if defined(DEBUG) || defined(INDUCE_IO_ERROR) #if defined(DEBUG) || defined(INDUCE_IO_ERROR)
xfs_errortag_clearall(mp, 0); xfs_errortag_clearall(mp, 0);
#endif #endif
XFS_IODONE(vfsp); XFS_IODONE(mp);
xfs_mount_free(mp); xfs_mount_free(mp);
return 0; return 0;
} }
...@@ -1286,9 +1283,7 @@ xfs_unmountfs_wait(xfs_mount_t *mp) ...@@ -1286,9 +1283,7 @@ xfs_unmountfs_wait(xfs_mount_t *mp)
int int
xfs_fs_writable(xfs_mount_t *mp) xfs_fs_writable(xfs_mount_t *mp)
{ {
bhv_vfs_t *vfsp = XFS_MTOVFS(mp); return !(xfs_test_for_freeze(mp) || XFS_FORCED_SHUTDOWN(mp) ||
return !(vfs_test_for_freeze(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
(mp->m_flags & XFS_MOUNT_RDONLY)); (mp->m_flags & XFS_MOUNT_RDONLY));
} }
......
...@@ -54,7 +54,6 @@ typedef struct xfs_trans_reservations { ...@@ -54,7 +54,6 @@ typedef struct xfs_trans_reservations {
#else #else
struct cred; struct cred;
struct log; struct log;
struct bhv_vfs;
struct xfs_mount_args; struct xfs_mount_args;
struct xfs_inode; struct xfs_inode;
struct xfs_iocore; struct xfs_iocore;
...@@ -79,13 +78,13 @@ typedef int (*xfs_send_data_t)(int, bhv_vnode_t *, ...@@ -79,13 +78,13 @@ typedef int (*xfs_send_data_t)(int, bhv_vnode_t *,
xfs_off_t, size_t, int, bhv_vrwlock_t *); xfs_off_t, size_t, int, bhv_vrwlock_t *);
typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
typedef int (*xfs_send_destroy_t)(bhv_vnode_t *, dm_right_t); typedef int (*xfs_send_destroy_t)(bhv_vnode_t *, dm_right_t);
typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct bhv_vfs *, typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *,
bhv_vnode_t *, bhv_vnode_t *,
dm_right_t, bhv_vnode_t *, dm_right_t, dm_right_t, bhv_vnode_t *, dm_right_t,
char *, char *, mode_t, int, int); char *, char *, mode_t, int, int);
typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t, typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t,
char *, char *); char *, char *);
typedef void (*xfs_send_unmount_t)(struct bhv_vfs *, bhv_vnode_t *, typedef void (*xfs_send_unmount_t)(struct xfs_mount *, bhv_vnode_t *,
dm_right_t, mode_t, int, int); dm_right_t, mode_t, int, int);
typedef struct xfs_dmops { typedef struct xfs_dmops {
...@@ -105,12 +104,12 @@ typedef struct xfs_dmops { ...@@ -105,12 +104,12 @@ typedef struct xfs_dmops {
(*(mp)->m_dm_ops->xfs_send_destroy)(vp,right) (*(mp)->m_dm_ops->xfs_send_destroy)(vp,right)
#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
(*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl)
#define XFS_SEND_PREUNMOUNT(mp, vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ #define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
(*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r2,n1,n2,mode,rval,fl)
#define XFS_SEND_MOUNT(mp,right,path,name) \ #define XFS_SEND_MOUNT(mp,right,path,name) \
(*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name) (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name)
#define XFS_SEND_UNMOUNT(mp, vfsp,vp,right,mode,rval,fl) \ #define XFS_SEND_UNMOUNT(mp, vp,right,mode,rval,fl) \
(*(mp)->m_dm_ops->xfs_send_unmount)(vfsp,vp,right,mode,rval,fl) (*(mp)->m_dm_ops->xfs_send_unmount)(mp,vp,right,mode,rval,fl)
/* /*
...@@ -202,7 +201,7 @@ typedef struct xfs_qmops { ...@@ -202,7 +201,7 @@ typedef struct xfs_qmops {
* Prototypes and functions for I/O core modularization. * Prototypes and functions for I/O core modularization.
*/ */
typedef int (*xfs_ioinit_t)(struct bhv_vfs *, typedef int (*xfs_ioinit_t)(struct xfs_mount *,
struct xfs_mount_args *, int); struct xfs_mount_args *, int);
typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *, typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *,
xfs_fileoff_t, xfs_filblks_t, int, xfs_fileoff_t, xfs_filblks_t, int,
...@@ -232,7 +231,7 @@ typedef void (*xfs_lock_demote_t)(void *, uint); ...@@ -232,7 +231,7 @@ typedef void (*xfs_lock_demote_t)(void *, uint);
typedef int (*xfs_lock_nowait_t)(void *, uint); typedef int (*xfs_lock_nowait_t)(void *, uint);
typedef void (*xfs_unlk_t)(void *, unsigned int); typedef void (*xfs_unlk_t)(void *, unsigned int);
typedef xfs_fsize_t (*xfs_size_t)(void *); typedef xfs_fsize_t (*xfs_size_t)(void *);
typedef xfs_fsize_t (*xfs_iodone_t)(struct bhv_vfs *); typedef xfs_fsize_t (*xfs_iodone_t)(struct xfs_mount *);
typedef int (*xfs_swap_extents_t)(void *, void *, typedef int (*xfs_swap_extents_t)(void *, void *,
struct xfs_swapext*); struct xfs_swapext*);
...@@ -255,8 +254,8 @@ typedef struct xfs_ioops { ...@@ -255,8 +254,8 @@ typedef struct xfs_ioops {
xfs_swap_extents_t xfs_swap_extents_func; xfs_swap_extents_t xfs_swap_extents_func;
} xfs_ioops_t; } xfs_ioops_t;
#define XFS_IOINIT(vfsp, args, flags) \ #define XFS_IOINIT(mp, args, flags) \
(*(mp)->m_io_ops.xfs_ioinit)(vfsp, args, flags) (*(mp)->m_io_ops.xfs_ioinit)(mp, args, flags)
#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \ #define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \
(*(mp)->m_io_ops.xfs_bmapi_func) \ (*(mp)->m_io_ops.xfs_bmapi_func) \
(trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta) (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta)
...@@ -290,8 +289,8 @@ typedef struct xfs_ioops { ...@@ -290,8 +289,8 @@ typedef struct xfs_ioops {
(*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode) (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode)
#define XFS_SIZE(mp, io) \ #define XFS_SIZE(mp, io) \
(*(mp)->m_io_ops.xfs_size_func)((io)->io_obj) (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
#define XFS_IODONE(vfsp) \ #define XFS_IODONE(mp) \
(*(mp)->m_io_ops.xfs_iodone)(vfsp) (*(mp)->m_io_ops.xfs_iodone)(mp)
#define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \ #define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \
(*(mp)->m_io_ops.xfs_swap_extents_func) \ (*(mp)->m_io_ops.xfs_swap_extents_func) \
((io)->io_obj, (tio)->io_obj, sxp) ((io)->io_obj, (tio)->io_obj, sxp)
...@@ -328,7 +327,7 @@ extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int); ...@@ -328,7 +327,7 @@ extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int);
#endif #endif
typedef struct xfs_mount { typedef struct xfs_mount {
struct bhv_vfs *m_vfsp; struct super_block *m_super;
xfs_tid_t m_tid; /* next unused tid for fs */ xfs_tid_t m_tid; /* next unused tid for fs */
AIL_LOCK_T m_ail_lock; /* fs AIL mutex */ AIL_LOCK_T m_ail_lock; /* fs AIL mutex */
xfs_ail_entry_t m_ail; /* fs active log item list */ xfs_ail_entry_t m_ail; /* fs active log item list */
...@@ -548,21 +547,6 @@ void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, ...@@ -548,21 +547,6 @@ void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
/* XFS_MFSI_CONVERT_SUNIT */ /* XFS_MFSI_CONVERT_SUNIT */
#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */ #define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */
/*
* Macros for getting from mount to vfs and back.
*/
#define XFS_MTOVFS(mp) xfs_mtovfs(mp)
static inline struct bhv_vfs *xfs_mtovfs(xfs_mount_t *mp)
{
return mp->m_vfsp;
}
#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
{
return vfs->vfs_mount;
}
#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
static inline xfs_agnumber_t static inline xfs_agnumber_t
xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d) xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d)
...@@ -633,7 +617,7 @@ extern xfs_mount_t *xfs_mount_init(void); ...@@ -633,7 +617,7 @@ extern xfs_mount_t *xfs_mount_init(void);
extern void xfs_mod_sb(xfs_trans_t *, __int64_t); extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
extern int xfs_log_sbcount(xfs_mount_t *, uint); extern int xfs_log_sbcount(xfs_mount_t *, uint);
extern void xfs_mount_free(xfs_mount_t *mp); extern void xfs_mount_free(xfs_mount_t *mp);
extern int xfs_mountfs(struct bhv_vfs *, xfs_mount_t *mp, int); extern int xfs_mountfs(xfs_mount_t *mp, int);
extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); extern void xfs_mountfs_check_barriers(xfs_mount_t *mp);
extern int xfs_unmountfs(xfs_mount_t *, struct cred *); extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
...@@ -651,8 +635,7 @@ extern void xfs_freesb(xfs_mount_t *); ...@@ -651,8 +635,7 @@ extern void xfs_freesb(xfs_mount_t *);
extern int xfs_fs_writable(xfs_mount_t *); extern int xfs_fs_writable(xfs_mount_t *);
extern int xfs_syncsub(xfs_mount_t *, int, int *); extern int xfs_syncsub(xfs_mount_t *, int, int *);
extern int xfs_sync_inodes(xfs_mount_t *, int, int *); extern int xfs_sync_inodes(xfs_mount_t *, int, int *);
extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *, extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t);
xfs_agnumber_t);
extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *);
extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t);
extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t);
......
...@@ -234,7 +234,7 @@ xfs_trans_alloc( ...@@ -234,7 +234,7 @@ xfs_trans_alloc(
xfs_mount_t *mp, xfs_mount_t *mp,
uint type) uint type)
{ {
vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_TRANS); xfs_wait_for_freeze(mp, SB_FREEZE_TRANS);
return _xfs_trans_alloc(mp, type); return _xfs_trans_alloc(mp, type);
} }
...@@ -628,7 +628,7 @@ xfs_trans_apply_sb_deltas( ...@@ -628,7 +628,7 @@ xfs_trans_apply_sb_deltas(
offsetof(xfs_dsb_t, sb_frextents) + offsetof(xfs_dsb_t, sb_frextents) +
sizeof(sbp->sb_frextents) - 1); sizeof(sbp->sb_frextents) - 1);
XFS_MTOVFS(tp->t_mountp)->vfs_super->s_dirt = 1; tp->t_mountp->m_super->s_dirt = 1;
} }
/* /*
......
...@@ -211,7 +211,6 @@ xfs_cleanup(void) ...@@ -211,7 +211,6 @@ xfs_cleanup(void)
*/ */
STATIC int STATIC int
xfs_start_flags( xfs_start_flags(
struct bhv_vfs *vfs,
struct xfs_mount_args *ap, struct xfs_mount_args *ap,
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
...@@ -336,7 +335,6 @@ xfs_start_flags( ...@@ -336,7 +335,6 @@ xfs_start_flags(
*/ */
STATIC int STATIC int
xfs_finish_flags( xfs_finish_flags(
struct bhv_vfs *vfs,
struct xfs_mount_args *ap, struct xfs_mount_args *ap,
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
...@@ -438,11 +436,10 @@ xfs_mount( ...@@ -438,11 +436,10 @@ xfs_mount(
struct xfs_mount_args *args, struct xfs_mount_args *args,
cred_t *credp) cred_t *credp)
{ {
struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
struct block_device *ddev, *logdev, *rtdev; struct block_device *ddev, *logdev, *rtdev;
int flags = 0, error; int flags = 0, error;
ddev = vfsp->vfs_super->s_bdev; ddev = mp->m_super->s_bdev;
logdev = rtdev = NULL; logdev = rtdev = NULL;
error = xfs_dmops_get(mp, args); error = xfs_dmops_get(mp, args);
...@@ -510,13 +507,13 @@ xfs_mount( ...@@ -510,13 +507,13 @@ xfs_mount(
/* /*
* Setup flags based on mount(2) options and then the superblock * Setup flags based on mount(2) options and then the superblock
*/ */
error = xfs_start_flags(vfsp, args, mp); error = xfs_start_flags(args, mp);
if (error) if (error)
goto error1; goto error1;
error = xfs_readsb(mp, flags); error = xfs_readsb(mp, flags);
if (error) if (error)
goto error1; goto error1;
error = xfs_finish_flags(vfsp, args, mp); error = xfs_finish_flags(args, mp);
if (error) if (error)
goto error2; goto error2;
...@@ -547,7 +544,7 @@ xfs_mount( ...@@ -547,7 +544,7 @@ xfs_mount(
if ((error = xfs_filestream_mount(mp))) if ((error = xfs_filestream_mount(mp)))
goto error2; goto error2;
error = XFS_IOINIT(vfsp, args, flags); error = XFS_IOINIT(mp, args, flags);
if (error) if (error)
goto error2; goto error2;
...@@ -577,7 +574,6 @@ xfs_unmount( ...@@ -577,7 +574,6 @@ xfs_unmount(
int flags, int flags,
cred_t *credp) cred_t *credp)
{ {
bhv_vfs_t *vfsp = XFS_MTOVFS(mp);
xfs_inode_t *rip; xfs_inode_t *rip;
bhv_vnode_t *rvp; bhv_vnode_t *rvp;
int unmount_event_wanted = 0; int unmount_event_wanted = 0;
...@@ -590,7 +586,7 @@ xfs_unmount( ...@@ -590,7 +586,7 @@ xfs_unmount(
#ifdef HAVE_DMAPI #ifdef HAVE_DMAPI
if (mp->m_flags & XFS_MOUNT_DMAPI) { if (mp->m_flags & XFS_MOUNT_DMAPI) {
error = XFS_SEND_PREUNMOUNT(mp, vfsp, error = XFS_SEND_PREUNMOUNT(mp,
rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
NULL, NULL, 0, 0, NULL, NULL, 0, 0,
(mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))? (mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))?
...@@ -647,7 +643,7 @@ xfs_unmount( ...@@ -647,7 +643,7 @@ xfs_unmount(
/* Note: mp structure must still exist for /* Note: mp structure must still exist for
* XFS_SEND_UNMOUNT() call. * XFS_SEND_UNMOUNT() call.
*/ */
XFS_SEND_UNMOUNT(mp, vfsp, error == 0 ? rvp : NULL, XFS_SEND_UNMOUNT(mp, error == 0 ? rvp : NULL,
DM_RIGHT_NULL, 0, error, unmount_event_flags); DM_RIGHT_NULL, 0, error, unmount_event_flags);
} }
if (xfs_unmountfs_needed) { if (xfs_unmountfs_needed) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册