Commit b83bd138 authored by Nathan Scott's avatar Nathan Scott

[XFS] Resolve a namespace collision on vfs/vfsops for FreeBSD porters.

SGI-PV: 9533338
SGI-Modid: xfs-linux-melb:xfs-kern:26106a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 932f2c32
...@@ -97,7 +97,7 @@ xfs_fs_encode_fh( ...@@ -97,7 +97,7 @@ xfs_fs_encode_fh(
int len; int len;
int is64 = 0; int is64 = 0;
#if XFS_BIG_INUMS #if XFS_BIG_INUMS
vfs_t *vfs = vfs_from_sb(inode->i_sb); bhv_vfs_t *vfs = vfs_from_sb(inode->i_sb);
if (!(vfs->vfs_flag & VFS_32BITINODES)) { if (!(vfs->vfs_flag & VFS_32BITINODES)) {
/* filesystem may contain 64bit inode numbers */ /* filesystem may contain 64bit inode numbers */
...@@ -139,10 +139,10 @@ xfs_fs_get_dentry( ...@@ -139,10 +139,10 @@ xfs_fs_get_dentry(
vnode_t *vp; vnode_t *vp;
struct inode *inode; struct inode *inode;
struct dentry *result; struct dentry *result;
vfs_t *vfsp = vfs_from_sb(sb); bhv_vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
VFS_VGET(vfsp, &vp, (fid_t *)data, error); error = bhv_vfs_vget(vfsp, &vp, (fid_t *)data);
if (error || vp == NULL) if (error || vp == NULL)
return ERR_PTR(-ESTALE) ; return ERR_PTR(-ESTALE) ;
......
...@@ -475,13 +475,13 @@ xfs_fs_clear_inode( ...@@ -475,13 +475,13 @@ xfs_fs_clear_inode(
*/ */
STATIC void STATIC void
xfs_syncd_queue_work( xfs_syncd_queue_work(
struct vfs *vfs, struct bhv_vfs *vfs,
void *data, void *data,
void (*syncer)(vfs_t *, void *)) void (*syncer)(bhv_vfs_t *, void *))
{ {
vfs_sync_work_t *work; struct bhv_vfs_sync_work *work;
work = kmem_alloc(sizeof(struct vfs_sync_work), KM_SLEEP); work = kmem_alloc(sizeof(struct bhv_vfs_sync_work), KM_SLEEP);
INIT_LIST_HEAD(&work->w_list); INIT_LIST_HEAD(&work->w_list);
work->w_syncer = syncer; work->w_syncer = syncer;
work->w_data = data; work->w_data = data;
...@@ -500,7 +500,7 @@ xfs_syncd_queue_work( ...@@ -500,7 +500,7 @@ xfs_syncd_queue_work(
*/ */
STATIC void STATIC void
xfs_flush_inode_work( xfs_flush_inode_work(
vfs_t *vfs, bhv_vfs_t *vfs,
void *inode) void *inode)
{ {
filemap_flush(((struct inode *)inode)->i_mapping); filemap_flush(((struct inode *)inode)->i_mapping);
...@@ -512,7 +512,7 @@ xfs_flush_inode( ...@@ -512,7 +512,7 @@ xfs_flush_inode(
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
struct inode *inode = vn_to_inode(XFS_ITOV(ip)); struct inode *inode = vn_to_inode(XFS_ITOV(ip));
struct vfs *vfs = XFS_MTOVFS(ip->i_mount); struct bhv_vfs *vfs = XFS_MTOVFS(ip->i_mount);
igrab(inode); igrab(inode);
xfs_syncd_queue_work(vfs, inode, xfs_flush_inode_work); xfs_syncd_queue_work(vfs, inode, xfs_flush_inode_work);
...@@ -525,7 +525,7 @@ xfs_flush_inode( ...@@ -525,7 +525,7 @@ xfs_flush_inode(
*/ */
STATIC void STATIC void
xfs_flush_device_work( xfs_flush_device_work(
vfs_t *vfs, bhv_vfs_t *vfs,
void *inode) void *inode)
{ {
sync_blockdev(vfs->vfs_super->s_bdev); sync_blockdev(vfs->vfs_super->s_bdev);
...@@ -537,7 +537,7 @@ xfs_flush_device( ...@@ -537,7 +537,7 @@ xfs_flush_device(
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
struct inode *inode = vn_to_inode(XFS_ITOV(ip)); struct inode *inode = vn_to_inode(XFS_ITOV(ip));
struct vfs *vfs = XFS_MTOVFS(ip->i_mount); struct bhv_vfs *vfs = XFS_MTOVFS(ip->i_mount);
igrab(inode); igrab(inode);
xfs_syncd_queue_work(vfs, inode, xfs_flush_device_work); xfs_syncd_queue_work(vfs, inode, xfs_flush_device_work);
...@@ -545,16 +545,16 @@ xfs_flush_device( ...@@ -545,16 +545,16 @@ xfs_flush_device(
xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC);
} }
#define SYNCD_FLAGS (SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR|SYNC_REFCACHE)
STATIC void STATIC void
vfs_sync_worker( vfs_sync_worker(
vfs_t *vfsp, bhv_vfs_t *vfsp,
void *unused) void *unused)
{ {
int error; int error;
if (!(vfsp->vfs_flag & VFS_RDONLY)) if (!(vfsp->vfs_flag & VFS_RDONLY))
VFS_SYNC(vfsp, SYNCD_FLAGS, NULL, error); error = bhv_vfs_sync(vfsp, SYNC_FSDATA | SYNC_BDFLUSH | \
SYNC_ATTR | SYNC_REFCACHE, NULL);
vfsp->vfs_sync_seq++; vfsp->vfs_sync_seq++;
wmb(); wmb();
wake_up(&vfsp->vfs_wait_single_sync_task); wake_up(&vfsp->vfs_wait_single_sync_task);
...@@ -565,8 +565,8 @@ xfssyncd( ...@@ -565,8 +565,8 @@ xfssyncd(
void *arg) void *arg)
{ {
long timeleft; long timeleft;
vfs_t *vfsp = (vfs_t *) arg; bhv_vfs_t *vfsp = (bhv_vfs_t *) arg;
struct vfs_sync_work *work, *n; bhv_vfs_sync_work_t *work, *n;
LIST_HEAD (tmp); LIST_HEAD (tmp);
timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10); timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10);
...@@ -600,7 +600,7 @@ xfssyncd( ...@@ -600,7 +600,7 @@ xfssyncd(
list_del(&work->w_list); list_del(&work->w_list);
if (work == &vfsp->vfs_sync_work) if (work == &vfsp->vfs_sync_work)
continue; continue;
kmem_free(work, sizeof(struct vfs_sync_work)); kmem_free(work, sizeof(struct bhv_vfs_sync_work));
} }
} }
...@@ -609,7 +609,7 @@ xfssyncd( ...@@ -609,7 +609,7 @@ xfssyncd(
STATIC int STATIC int
xfs_fs_start_syncd( xfs_fs_start_syncd(
vfs_t *vfsp) bhv_vfs_t *vfsp)
{ {
vfsp->vfs_sync_work.w_syncer = vfs_sync_worker; vfsp->vfs_sync_work.w_syncer = vfs_sync_worker;
vfsp->vfs_sync_work.w_vfs = vfsp; vfsp->vfs_sync_work.w_vfs = vfsp;
...@@ -621,7 +621,7 @@ xfs_fs_start_syncd( ...@@ -621,7 +621,7 @@ xfs_fs_start_syncd(
STATIC void STATIC void
xfs_fs_stop_syncd( xfs_fs_stop_syncd(
vfs_t *vfsp) bhv_vfs_t *vfsp)
{ {
kthread_stop(vfsp->vfs_sync_task); kthread_stop(vfsp->vfs_sync_task);
} }
...@@ -630,35 +630,26 @@ STATIC void ...@@ -630,35 +630,26 @@ STATIC void
xfs_fs_put_super( xfs_fs_put_super(
struct super_block *sb) struct super_block *sb)
{ {
vfs_t *vfsp = vfs_from_sb(sb); bhv_vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
xfs_fs_stop_syncd(vfsp); xfs_fs_stop_syncd(vfsp);
VFS_SYNC(vfsp, SYNC_ATTR|SYNC_DELWRI, NULL, error); bhv_vfs_sync(vfsp, SYNC_ATTR | SYNC_DELWRI, NULL);
if (!error) error = bhv_vfs_unmount(vfsp, 0, NULL);
VFS_UNMOUNT(vfsp, 0, NULL, error);
if (error) { if (error) {
printk("XFS unmount got error %d\n", error); printk("XFS: unmount got error=%d\n", error);
printk("%s: vfsp/0x%p left dangling!\n", __FUNCTION__, vfsp); printk("%s: vfs=0x%p left dangling!\n", __FUNCTION__, vfsp);
return; } else {
vfs_deallocate(vfsp);
} }
vfs_deallocate(vfsp);
} }
STATIC void STATIC void
xfs_fs_write_super( xfs_fs_write_super(
struct super_block *sb) struct super_block *sb)
{ {
vfs_t *vfsp = vfs_from_sb(sb); if (!(sb->s_flags & MS_RDONLY))
int error; bhv_vfs_sync(vfs_from_sb(sb), SYNC_FSDATA, NULL);
if (sb->s_flags & MS_RDONLY) {
sb->s_dirt = 0; /* paranoia */
return;
}
/* Push the log and superblock a little */
VFS_SYNC(vfsp, SYNC_FSDATA, NULL, error);
sb->s_dirt = 0; sb->s_dirt = 0;
} }
...@@ -667,16 +658,16 @@ xfs_fs_sync_super( ...@@ -667,16 +658,16 @@ xfs_fs_sync_super(
struct super_block *sb, struct super_block *sb,
int wait) int wait)
{ {
vfs_t *vfsp = vfs_from_sb(sb); bhv_vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
int flags = SYNC_FSDATA; int flags;
if (unlikely(sb->s_frozen == SB_FREEZE_WRITE)) if (unlikely(sb->s_frozen == SB_FREEZE_WRITE))
flags = SYNC_QUIESCE; flags = SYNC_QUIESCE;
else else
flags = SYNC_FSDATA | (wait ? SYNC_WAIT : 0); flags = SYNC_FSDATA | (wait ? SYNC_WAIT : 0);
VFS_SYNC(vfsp, flags, NULL, error); error = bhv_vfs_sync(vfsp, flags, NULL);
sb->s_dirt = 0; sb->s_dirt = 0;
if (unlikely(laptop_mode)) { if (unlikely(laptop_mode)) {
...@@ -706,11 +697,7 @@ xfs_fs_statfs( ...@@ -706,11 +697,7 @@ xfs_fs_statfs(
struct super_block *sb, struct super_block *sb,
struct kstatfs *statp) struct kstatfs *statp)
{ {
vfs_t *vfsp = vfs_from_sb(sb); return -bhv_vfs_statvfs(vfs_from_sb(sb), statp, NULL);
int error;
VFS_STATVFS(vfsp, statp, NULL, error);
return -error;
} }
STATIC int STATIC int
...@@ -719,13 +706,13 @@ xfs_fs_remount( ...@@ -719,13 +706,13 @@ xfs_fs_remount(
int *flags, int *flags,
char *options) char *options)
{ {
vfs_t *vfsp = vfs_from_sb(sb); bhv_vfs_t *vfsp = vfs_from_sb(sb);
struct xfs_mount_args *args = xfs_args_allocate(sb, 0); struct xfs_mount_args *args = xfs_args_allocate(sb, 0);
int error; int error;
VFS_PARSEARGS(vfsp, options, args, 1, error); error = bhv_vfs_parseargs(vfsp, options, args, 1);
if (!error) if (!error)
VFS_MNTUPDATE(vfsp, flags, args, error); error = bhv_vfs_mntupdate(vfsp, flags, args);
kmem_free(args, sizeof(*args)); kmem_free(args, sizeof(*args));
return -error; return -error;
} }
...@@ -734,7 +721,7 @@ STATIC void ...@@ -734,7 +721,7 @@ STATIC void
xfs_fs_lockfs( xfs_fs_lockfs(
struct super_block *sb) struct super_block *sb)
{ {
VFS_FREEZE(vfs_from_sb(sb)); bhv_vfs_freeze(vfs_from_sb(sb));
} }
STATIC int STATIC int
...@@ -742,11 +729,7 @@ xfs_fs_show_options( ...@@ -742,11 +729,7 @@ xfs_fs_show_options(
struct seq_file *m, struct seq_file *m,
struct vfsmount *mnt) struct vfsmount *mnt)
{ {
struct vfs *vfsp = vfs_from_sb(mnt->mnt_sb); return -bhv_vfs_showargs(vfs_from_sb(mnt->mnt_sb), m);
int error;
VFS_SHOWARGS(vfsp, m, error);
return error;
} }
STATIC int STATIC int
...@@ -754,11 +737,7 @@ xfs_fs_quotasync( ...@@ -754,11 +737,7 @@ xfs_fs_quotasync(
struct super_block *sb, struct super_block *sb,
int type) int type)
{ {
struct vfs *vfsp = vfs_from_sb(sb); return -bhv_vfs_quotactl(vfs_from_sb(sb), Q_XQUOTASYNC, 0, NULL);
int error;
VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error);
return -error;
} }
STATIC int STATIC int
...@@ -766,11 +745,7 @@ xfs_fs_getxstate( ...@@ -766,11 +745,7 @@ xfs_fs_getxstate(
struct super_block *sb, struct super_block *sb,
struct fs_quota_stat *fqs) struct fs_quota_stat *fqs)
{ {
struct vfs *vfsp = vfs_from_sb(sb); return -bhv_vfs_quotactl(vfs_from_sb(sb), Q_XGETQSTAT, 0, (caddr_t)fqs);
int error;
VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error);
return -error;
} }
STATIC int STATIC int
...@@ -779,11 +754,7 @@ xfs_fs_setxstate( ...@@ -779,11 +754,7 @@ xfs_fs_setxstate(
unsigned int flags, unsigned int flags,
int op) int op)
{ {
struct vfs *vfsp = vfs_from_sb(sb); return -bhv_vfs_quotactl(vfs_from_sb(sb), op, 0, (caddr_t)&flags);
int error;
VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error);
return -error;
} }
STATIC int STATIC int
...@@ -793,13 +764,10 @@ xfs_fs_getxquota( ...@@ -793,13 +764,10 @@ xfs_fs_getxquota(
qid_t id, qid_t id,
struct fs_disk_quota *fdq) struct fs_disk_quota *fdq)
{ {
struct vfs *vfsp = vfs_from_sb(sb); return -bhv_vfs_quotactl(vfs_from_sb(sb),
int error, getmode; (type == USRQUOTA) ? Q_XGETQUOTA :
((type == GRPQUOTA) ? Q_XGETGQUOTA :
getmode = (type == USRQUOTA) ? Q_XGETQUOTA : Q_XGETPQUOTA), id, (caddr_t)fdq);
((type == GRPQUOTA) ? Q_XGETGQUOTA : Q_XGETPQUOTA);
VFS_QUOTACTL(vfsp, getmode, id, (caddr_t)fdq, error);
return -error;
} }
STATIC int STATIC int
...@@ -809,13 +777,10 @@ xfs_fs_setxquota( ...@@ -809,13 +777,10 @@ xfs_fs_setxquota(
qid_t id, qid_t id,
struct fs_disk_quota *fdq) struct fs_disk_quota *fdq)
{ {
struct vfs *vfsp = vfs_from_sb(sb); return -bhv_vfs_quotactl(vfs_from_sb(sb),
int error, setmode; (type == USRQUOTA) ? Q_XSETQLIM :
((type == GRPQUOTA) ? Q_XSETGQLIM :
setmode = (type == USRQUOTA) ? Q_XSETQLIM : Q_XSETPQLIM), id, (caddr_t)fdq);
((type == GRPQUOTA) ? Q_XSETGQLIM : Q_XSETPQLIM);
VFS_QUOTACTL(vfsp, setmode, id, (caddr_t)fdq, error);
return -error;
} }
STATIC int STATIC int
...@@ -825,14 +790,14 @@ xfs_fs_fill_super( ...@@ -825,14 +790,14 @@ xfs_fs_fill_super(
int silent) int silent)
{ {
vnode_t *rootvp; vnode_t *rootvp;
struct vfs *vfsp = vfs_allocate(sb); struct bhv_vfs *vfsp = vfs_allocate(sb);
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;
int error, error2; int error;
bhv_insert_all_vfsops(vfsp); bhv_insert_all_vfsops(vfsp);
VFS_PARSEARGS(vfsp, (char *)data, args, 0, error); error = bhv_vfs_parseargs(vfsp, (char *)data, args, 0);
if (error) { if (error) {
bhv_remove_all_vfsops(vfsp, 1); bhv_remove_all_vfsops(vfsp, 1);
goto fail_vfsop; goto fail_vfsop;
...@@ -845,13 +810,13 @@ xfs_fs_fill_super( ...@@ -845,13 +810,13 @@ xfs_fs_fill_super(
sb->s_qcop = &xfs_quotactl_operations; sb->s_qcop = &xfs_quotactl_operations;
sb->s_op = &xfs_super_operations; sb->s_op = &xfs_super_operations;
VFS_MOUNT(vfsp, args, NULL, error); error = bhv_vfs_mount(vfsp, args, NULL);
if (error) { if (error) {
bhv_remove_all_vfsops(vfsp, 1); bhv_remove_all_vfsops(vfsp, 1);
goto fail_vfsop; goto fail_vfsop;
} }
VFS_STATVFS(vfsp, &statvfs, NULL, error); error = bhv_vfs_statvfs(vfsp, &statvfs, NULL);
if (error) if (error)
goto fail_unmount; goto fail_unmount;
...@@ -863,7 +828,7 @@ xfs_fs_fill_super( ...@@ -863,7 +828,7 @@ xfs_fs_fill_super(
sb->s_time_gran = 1; sb->s_time_gran = 1;
set_posix_acl_flag(sb); set_posix_acl_flag(sb);
VFS_ROOT(vfsp, &rootvp, error); error = bhv_vfs_root(vfsp, &rootvp);
if (error) if (error)
goto fail_unmount; goto fail_unmount;
...@@ -892,7 +857,7 @@ xfs_fs_fill_super( ...@@ -892,7 +857,7 @@ xfs_fs_fill_super(
} }
fail_unmount: fail_unmount:
VFS_UNMOUNT(vfsp, 0, NULL, error2); bhv_vfs_unmount(vfsp, 0, NULL);
fail_vfsop: fail_vfsop:
vfs_deallocate(vfsp); vfs_deallocate(vfsp);
......
...@@ -226,13 +226,13 @@ vfs_freeze( ...@@ -226,13 +226,13 @@ vfs_freeze(
((*bhvtovfsops(next)->vfs_freeze)(next)); ((*bhvtovfsops(next)->vfs_freeze)(next));
} }
vfs_t * bhv_vfs_t *
vfs_allocate( vfs_allocate(
struct super_block *sb) struct super_block *sb)
{ {
struct vfs *vfsp; struct bhv_vfs *vfsp;
vfsp = kmem_zalloc(sizeof(vfs_t), KM_SLEEP); vfsp = kmem_zalloc(sizeof(bhv_vfs_t), KM_SLEEP);
bhv_head_init(VFS_BHVHEAD(vfsp), "vfs"); bhv_head_init(VFS_BHVHEAD(vfsp), "vfs");
INIT_LIST_HEAD(&vfsp->vfs_sync_list); INIT_LIST_HEAD(&vfsp->vfs_sync_list);
spin_lock_init(&vfsp->vfs_sync_lock); spin_lock_init(&vfsp->vfs_sync_lock);
...@@ -247,25 +247,25 @@ vfs_allocate( ...@@ -247,25 +247,25 @@ vfs_allocate(
return vfsp; return vfsp;
} }
vfs_t * bhv_vfs_t *
vfs_from_sb( vfs_from_sb(
struct super_block *sb) struct super_block *sb)
{ {
return (vfs_t *)sb->s_fs_info; return (bhv_vfs_t *)sb->s_fs_info;
} }
void void
vfs_deallocate( vfs_deallocate(
struct vfs *vfsp) struct bhv_vfs *vfsp)
{ {
bhv_head_destroy(VFS_BHVHEAD(vfsp)); bhv_head_destroy(VFS_BHVHEAD(vfsp));
kmem_free(vfsp, sizeof(vfs_t)); kmem_free(vfsp, sizeof(bhv_vfs_t));
} }
void void
vfs_insertops( vfs_insertops(
struct vfs *vfsp, struct bhv_vfs *vfsp,
struct bhv_vfsops *vfsops) struct bhv_module_vfsops *vfsops)
{ {
struct bhv_desc *bdp; struct bhv_desc *bdp;
...@@ -276,9 +276,9 @@ vfs_insertops( ...@@ -276,9 +276,9 @@ vfs_insertops(
void void
vfs_insertbhv( vfs_insertbhv(
struct vfs *vfsp, struct bhv_vfs *vfsp,
struct bhv_desc *bdp, struct bhv_desc *bdp,
struct vfsops *vfsops, struct bhv_vfsops *vfsops,
void *mount) void *mount)
{ {
bhv_desc_init(bdp, mount, vfsp, vfsops); bhv_desc_init(bdp, mount, vfsp, vfsops);
...@@ -287,7 +287,7 @@ vfs_insertbhv( ...@@ -287,7 +287,7 @@ vfs_insertbhv(
void void
bhv_remove_vfsops( bhv_remove_vfsops(
struct vfs *vfsp, struct bhv_vfs *vfsp,
int pos) int pos)
{ {
struct bhv_desc *bhv; struct bhv_desc *bhv;
...@@ -301,7 +301,7 @@ bhv_remove_vfsops( ...@@ -301,7 +301,7 @@ bhv_remove_vfsops(
void void
bhv_remove_all_vfsops( bhv_remove_all_vfsops(
struct vfs *vfsp, struct bhv_vfs *vfsp,
int freebase) int freebase)
{ {
struct xfs_mount *mp; struct xfs_mount *mp;
...@@ -317,7 +317,7 @@ bhv_remove_all_vfsops( ...@@ -317,7 +317,7 @@ bhv_remove_all_vfsops(
void void
bhv_insert_all_vfsops( bhv_insert_all_vfsops(
struct vfs *vfsp) struct bhv_vfs *vfsp)
{ {
struct xfs_mount *mp; struct xfs_mount *mp;
......
/* /*
* Copyright (c) 2000-2005 Silicon Graphics, Inc. * Copyright (c) 2000-2006 Silicon Graphics, Inc.
* All Rights Reserved. * All Rights Reserved.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -21,42 +21,42 @@ ...@@ -21,42 +21,42 @@
#include <linux/vfs.h> #include <linux/vfs.h>
#include "xfs_fs.h" #include "xfs_fs.h"
struct bhv_vfs;
struct fid; struct fid;
struct vfs;
struct cred; struct cred;
struct vnode; struct vnode;
struct kstatfs; struct statfs;
struct seq_file; struct seq_file;
struct super_block; struct super_block;
struct xfs_mount_args; struct xfs_mount_args;
typedef struct kstatfs xfs_statfs_t; typedef struct kstatfs xfs_statfs_t;
typedef struct vfs_sync_work { typedef struct bhv_vfs_sync_work {
struct list_head w_list; struct list_head w_list;
struct vfs *w_vfs; struct bhv_vfs *w_vfs;
void *w_data; /* syncer routine argument */ void *w_data; /* syncer routine argument */
void (*w_syncer)(struct vfs *, void *); void (*w_syncer)(struct bhv_vfs *, void *);
} vfs_sync_work_t; } bhv_vfs_sync_work_t;
typedef struct vfs { typedef struct bhv_vfs {
u_int vfs_flag; /* flags */ u_int vfs_flag; /* flags */
xfs_fsid_t vfs_fsid; /* file system ID */ xfs_fsid_t vfs_fsid; /* file system ID */
xfs_fsid_t *vfs_altfsid; /* An ID fixed for life of FS */ xfs_fsid_t *vfs_altfsid; /* An ID fixed for life of FS */
bhv_head_t vfs_bh; /* head of vfs behavior chain */ bhv_head_t vfs_bh; /* head of vfs behavior chain */
struct super_block *vfs_super; /* generic superblock pointer */ struct super_block *vfs_super; /* generic superblock pointer */
struct task_struct *vfs_sync_task; /* generalised sync thread */ struct task_struct *vfs_sync_task; /* generalised sync thread */
vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */ bhv_vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */
struct list_head vfs_sync_list; /* sync thread work item list */ struct list_head vfs_sync_list; /* sync thread work item list */
spinlock_t vfs_sync_lock; /* work item list lock */ spinlock_t vfs_sync_lock; /* work item list lock */
int vfs_sync_seq; /* sync thread generation no. */ int vfs_sync_seq; /* sync thread generation no. */
wait_queue_head_t vfs_wait_single_sync_task; wait_queue_head_t vfs_wait_single_sync_task;
} vfs_t; } bhv_vfs_t;
#define vfs_fbhv vfs_bh.bh_first /* 1st on vfs behavior chain */ #define vfs_fbhv vfs_bh.bh_first /* 1st on vfs behavior chain */
#define bhvtovfs(bdp) ( (struct vfs *)BHV_VOBJ(bdp) ) #define bhvtovfs(bdp) ( (struct bhv_vfs *)BHV_VOBJ(bdp) )
#define bhvtovfsops(bdp) ( (struct vfsops *)BHV_OPS(bdp) ) #define bhvtovfsops(bdp) ( (struct bhv_vfsops *)BHV_OPS(bdp) )
#define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh ) #define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh )
#define VFS_REMOVEBHV(vfs, bdp) ( bhv_remove(VFS_BHVHEAD(vfs), bdp) ) #define VFS_REMOVEBHV(vfs, bdp) ( bhv_remove(VFS_BHVHEAD(vfs), bdp) )
...@@ -71,7 +71,7 @@ typedef enum { ...@@ -71,7 +71,7 @@ typedef enum {
VFS_BHV_QM, /* quota manager */ VFS_BHV_QM, /* quota manager */
VFS_BHV_IO, /* IO path */ VFS_BHV_IO, /* IO path */
VFS_BHV_END /* housekeeping end-of-range */ VFS_BHV_END /* housekeeping end-of-range */
} vfs_bhv_t; } bhv_vfs_type_t;
#define VFS_POSITION_XFS (BHV_POSITION_BASE) #define VFS_POSITION_XFS (BHV_POSITION_BASE)
#define VFS_POSITION_DM (VFS_POSITION_BASE+10) #define VFS_POSITION_DM (VFS_POSITION_BASE+10)
...@@ -81,8 +81,9 @@ typedef enum { ...@@ -81,8 +81,9 @@ typedef enum {
#define VFS_RDONLY 0x0001 /* read-only vfs */ #define VFS_RDONLY 0x0001 /* read-only vfs */
#define VFS_GRPID 0x0002 /* group-ID assigned from directory */ #define VFS_GRPID 0x0002 /* group-ID assigned from directory */
#define VFS_DMI 0x0004 /* filesystem has the DMI enabled */ #define VFS_DMI 0x0004 /* filesystem has the DMI enabled */
#define VFS_32BITINODES 0x0008 /* do not use inums above 32 bits */ #define VFS_UMOUNT 0x0008 /* unmount in progress */
#define VFS_END 0x0008 /* max flag */ #define VFS_32BITINODES 0x0010 /* do not use inums above 32 bits */
#define VFS_END 0x0010 /* max flag */
#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 */
...@@ -92,7 +93,7 @@ typedef enum { ...@@ -92,7 +93,7 @@ typedef enum {
#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ #define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */
#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ #define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */
#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ #define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */
#define SYNC_QUIESCE 0x0100 /* quiesce filesystem for a snapshot */ #define SYNC_QUIESCE 0x0100 /* quiesce fileystem for a snapshot */
#define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */ #define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */
#define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */ #define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */
...@@ -120,7 +121,7 @@ typedef void (*vfs_init_vnode_t)(bhv_desc_t *, ...@@ -120,7 +121,7 @@ typedef void (*vfs_init_vnode_t)(bhv_desc_t *,
typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int); typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int);
typedef void (*vfs_freeze_t)(bhv_desc_t *); typedef void (*vfs_freeze_t)(bhv_desc_t *);
typedef struct vfsops { typedef struct bhv_vfsops {
bhv_position_t vf_position; /* behavior chain position */ bhv_position_t vf_position; /* behavior chain position */
vfs_mount_t vfs_mount; /* mount file system */ vfs_mount_t vfs_mount; /* mount file system */
vfs_parseargs_t vfs_parseargs; /* parse mount options */ vfs_parseargs_t vfs_parseargs; /* parse mount options */
...@@ -136,44 +137,44 @@ typedef struct vfsops { ...@@ -136,44 +137,44 @@ typedef struct vfsops {
vfs_init_vnode_t vfs_init_vnode; /* initialize a new vnode */ vfs_init_vnode_t vfs_init_vnode; /* initialize a new vnode */
vfs_force_shutdown_t vfs_force_shutdown; /* crash and burn */ vfs_force_shutdown_t vfs_force_shutdown; /* crash and burn */
vfs_freeze_t vfs_freeze; /* freeze fs for snapshot */ vfs_freeze_t vfs_freeze; /* freeze fs for snapshot */
} vfsops_t; } bhv_vfsops_t;
/* /*
* VFS's. Operates on vfs structure pointers (starts at bhv head). * VFS's. Operates on vfs structure pointers (starts at bhv head).
*/ */
#define VHEAD(v) ((v)->vfs_fbhv) #define VHEAD(v) ((v)->vfs_fbhv)
#define VFS_MOUNT(v, ma,cr, rv) ((rv) = vfs_mount(VHEAD(v), ma,cr)) #define bhv_vfs_mount(v, ma,cr) vfs_mount(VHEAD(v), ma,cr)
#define VFS_PARSEARGS(v, o,ma,f, rv) ((rv) = vfs_parseargs(VHEAD(v), o,ma,f)) #define bhv_vfs_parseargs(v, o,ma,f) vfs_parseargs(VHEAD(v), o,ma,f)
#define VFS_SHOWARGS(v, m, rv) ((rv) = vfs_showargs(VHEAD(v), m)) #define bhv_vfs_showargs(v, m) vfs_showargs(VHEAD(v), m)
#define VFS_UNMOUNT(v, f, cr, rv) ((rv) = vfs_unmount(VHEAD(v), f,cr)) #define bhv_vfs_unmount(v, f,cr) vfs_unmount(VHEAD(v), f,cr)
#define VFS_MNTUPDATE(v, fl, args, rv) ((rv) = vfs_mntupdate(VHEAD(v), fl, args)) #define bhv_vfs_mntupdate(v, fl,args) vfs_mntupdate(VHEAD(v), fl,args)
#define VFS_ROOT(v, vpp, rv) ((rv) = vfs_root(VHEAD(v), vpp)) #define bhv_vfs_root(v, vpp) vfs_root(VHEAD(v), vpp)
#define VFS_STATVFS(v, sp,vp, rv) ((rv) = vfs_statvfs(VHEAD(v), sp,vp)) #define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VHEAD(v), sp,vp)
#define VFS_SYNC(v, flag,cr, rv) ((rv) = vfs_sync(VHEAD(v), flag,cr)) #define bhv_vfs_sync(v, flag,cr) vfs_sync(VHEAD(v), flag,cr)
#define VFS_VGET(v, vpp,fidp, rv) ((rv) = vfs_vget(VHEAD(v), vpp,fidp)) #define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VHEAD(v), vpp,fidp)
#define VFS_DMAPIOPS(v, p, rv) ((rv) = vfs_dmapiops(VHEAD(v), p)) #define bhv_vfs_dmapiops(v, p) vfs_dmapiops(VHEAD(v), p)
#define VFS_QUOTACTL(v, c,id,p, rv) ((rv) = vfs_quotactl(VHEAD(v), c,id,p)) #define bhv_vfs_quotactl(v, c,id,p) vfs_quotactl(VHEAD(v), c,id,p)
#define VFS_INIT_VNODE(v, vp,b,ul) ( vfs_init_vnode(VHEAD(v), vp,b,ul) ) #define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VHEAD(v), vp,b,ul)
#define VFS_FORCE_SHUTDOWN(v, fl,f,l) ( vfs_force_shutdown(VHEAD(v), fl,f,l) ) #define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VHEAD(v), u,f,l)
#define VFS_FREEZE(v) ( vfs_freeze(VHEAD(v)) ) #define bhv_vfs_freeze(v) vfs_freeze(VHEAD(v))
/* /*
* PVFS's. Operates on behavior descriptor pointers. * PVFS's. Operates on behavior descriptor pointers.
*/ */
#define PVFS_MOUNT(b, ma,cr, rv) ((rv) = vfs_mount(b, ma,cr)) #define bhv_next_vfs_mount(b, ma,cr) vfs_mount(b, ma,cr)
#define PVFS_PARSEARGS(b, o,ma,f, rv) ((rv) = vfs_parseargs(b, o,ma,f)) #define bhv_next_vfs_parseargs(b, o,ma,f) vfs_parseargs(b, o,ma,f)
#define PVFS_SHOWARGS(b, m, rv) ((rv) = vfs_showargs(b, m)) #define bhv_next_vfs_showargs(b, m) vfs_showargs(b, m)
#define PVFS_UNMOUNT(b, f,cr, rv) ((rv) = vfs_unmount(b, f,cr)) #define bhv_next_vfs_unmount(b, f,cr) vfs_unmount(b, f,cr)
#define PVFS_MNTUPDATE(b, fl, args, rv) ((rv) = vfs_mntupdate(b, fl, args)) #define bhv_next_vfs_mntupdate(b, fl,args) vfs_mntupdate(b, fl, args)
#define PVFS_ROOT(b, vpp, rv) ((rv) = vfs_root(b, vpp)) #define bhv_next_vfs_root(b, vpp) vfs_root(b, vpp)
#define PVFS_STATVFS(b, sp,vp, rv) ((rv) = vfs_statvfs(b, sp,vp)) #define bhv_next_vfs_statvfs(b, sp,vp) vfs_statvfs(b, sp,vp)
#define PVFS_SYNC(b, flag,cr, rv) ((rv) = vfs_sync(b, flag,cr)) #define bhv_next_vfs_sync(b, flag,cr) vfs_sync(b, flag,cr)
#define PVFS_VGET(b, vpp,fidp, rv) ((rv) = vfs_vget(b, vpp,fidp)) #define bhv_next_vfs_vget(b, vpp,fidp) vfs_vget(b, vpp,fidp)
#define PVFS_DMAPIOPS(b, p, rv) ((rv) = vfs_dmapiops(b, p)) #define bhv_next_vfs_dmapiops(b, p) vfs_dmapiops(b, p)
#define PVFS_QUOTACTL(b, c,id,p, rv) ((rv) = vfs_quotactl(b, c,id,p)) #define bhv_next_vfs_quotactl(b, c,id,p) vfs_quotactl(b, c,id,p)
#define PVFS_INIT_VNODE(b, vp,b2,ul) ( vfs_init_vnode(b, vp,b2,ul) ) #define bhv_next_vfs_init_vnode(b, vp,b2,ul) vfs_init_vnode(b, vp,b2,ul)
#define PVFS_FORCE_SHUTDOWN(b, fl,f,l) ( vfs_force_shutdown(b, fl,f,l) ) #define bhv_next_force_shutdown(b, fl,f,l) vfs_force_shutdown(b, fl,f,l)
#define PVFS_FREEZE(b) ( vfs_freeze(b) ) #define bhv_next_vfs_freeze(b) vfs_freeze(b)
extern int vfs_mount(bhv_desc_t *, struct xfs_mount_args *, struct cred *); extern int vfs_mount(bhv_desc_t *, struct xfs_mount_args *, struct cred *);
extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int); extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int);
...@@ -190,25 +191,26 @@ extern void vfs_init_vnode(bhv_desc_t *, struct vnode *, bhv_desc_t *, int); ...@@ -190,25 +191,26 @@ extern void vfs_init_vnode(bhv_desc_t *, struct vnode *, bhv_desc_t *, int);
extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int);
extern void vfs_freeze(bhv_desc_t *); extern void vfs_freeze(bhv_desc_t *);
typedef struct bhv_vfsops { typedef struct bhv_module_vfsops {
struct vfsops bhv_common; struct bhv_vfsops bhv_common;
void * bhv_custom; void * bhv_custom;
} bhv_vfsops_t; } bhv_module_vfsops_t;
#define vfs_bhv_lookup(v, id) (bhv_lookup_range(&(v)->vfs_bh, (id), (id)))
#define vfs_bhv_custom(b) (((bhv_module_vfsops_t*)BHV_OPS(b))->bhv_custom)
#define vfs_bhv_set_custom(b,o) ((b)->bhv_custom = (void *)(o))
#define vfs_bhv_clr_custom(b) ((b)->bhv_custom = NULL)
#define vfs_bhv_lookup(v, id) ( bhv_lookup_range(&(v)->vfs_bh, (id), (id)) ) extern bhv_vfs_t *vfs_allocate(struct super_block *);
#define vfs_bhv_custom(b) ( ((bhv_vfsops_t *)BHV_OPS(b))->bhv_custom ) extern bhv_vfs_t *vfs_from_sb(struct super_block *);
#define vfs_bhv_set_custom(b,o) ( (b)->bhv_custom = (void *)(o)) extern void vfs_deallocate(bhv_vfs_t *);
#define vfs_bhv_clr_custom(b) ( (b)->bhv_custom = NULL ) extern void vfs_insertbhv(bhv_vfs_t *, bhv_desc_t *, bhv_vfsops_t *, void *);
extern vfs_t *vfs_allocate(struct super_block *); extern void vfs_insertops(bhv_vfs_t *, bhv_module_vfsops_t *);
extern vfs_t *vfs_from_sb(struct super_block *);
extern void vfs_deallocate(vfs_t *);
extern void vfs_insertops(vfs_t *, bhv_vfsops_t *);
extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *);
extern void bhv_insert_all_vfsops(struct vfs *); extern void bhv_insert_all_vfsops(struct bhv_vfs *);
extern void bhv_remove_all_vfsops(struct vfs *, int); extern void bhv_remove_all_vfsops(struct bhv_vfs *, int);
extern void bhv_remove_vfsops(struct vfs *, int); extern void bhv_remove_vfsops(struct bhv_vfs *, int);
#define fs_frozen(vfsp) ((vfsp)->vfs_super->s_frozen) #define fs_frozen(vfsp) ((vfsp)->vfs_super->s_frozen)
#define fs_check_frozen(vfsp, level) \ #define fs_check_frozen(vfsp, level) \
......
...@@ -67,7 +67,7 @@ vn_ioerror( ...@@ -67,7 +67,7 @@ vn_ioerror(
int l) int l)
{ {
if (unlikely(error == -ENODEV)) if (unlikely(error == -ENODEV))
VFS_FORCE_SHUTDOWN(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l); bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l);
} }
struct vnode * struct vnode *
......
...@@ -68,7 +68,7 @@ typedef enum vflags { ...@@ -68,7 +68,7 @@ typedef enum vflags {
*/ */
typedef struct vnode { typedef struct vnode {
vflags_t v_flag; /* vnode flags (see above) */ vflags_t v_flag; /* vnode flags (see above) */
struct vfs *v_vfsp; /* ptr to containing VFS */ struct bhv_vfs *v_vfsp; /* ptr to containing VFS */
vnumber_t v_number; /* in-core vnode number */ vnumber_t v_number; /* in-core vnode number */
vn_bhv_head_t v_bh; /* behavior head */ vn_bhv_head_t v_bh; /* behavior head */
spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
...@@ -503,7 +503,7 @@ extern vnode_t *vn_initialize(struct inode *); ...@@ -503,7 +503,7 @@ extern vnode_t *vn_initialize(struct inode *);
* vnode_map structures _must_ match vn_epoch and vnode structure sizes. * vnode_map structures _must_ match vn_epoch and vnode structure sizes.
*/ */
typedef struct vnode_map { typedef struct vnode_map {
vfs_t *v_vfsp; bhv_vfs_t *v_vfsp;
vnumber_t v_number; /* in-core vnode number */ vnumber_t v_number; /* in-core vnode number */
xfs_ino_t v_ino; /* inode # */ xfs_ino_t v_ino; /* inode # */
} vmap_t; } vmap_t;
......
...@@ -129,7 +129,7 @@ xfs_qm_parseargs( ...@@ -129,7 +129,7 @@ xfs_qm_parseargs(
return XFS_ERROR(EINVAL); return XFS_ERROR(EINVAL);
} }
PVFS_PARSEARGS(BHV_NEXT(bhv), options, args, update, error); error = bhv_next_vfs_parseargs(BHV_NEXT(bhv), options, args, update);
if (!error && !referenced) if (!error && !referenced)
bhv_remove_vfsops(bhvtovfs(bhv), VFS_POSITION_QM); bhv_remove_vfsops(bhvtovfs(bhv), VFS_POSITION_QM);
return error; return error;
...@@ -140,9 +140,8 @@ xfs_qm_showargs( ...@@ -140,9 +140,8 @@ xfs_qm_showargs(
struct bhv_desc *bhv, struct bhv_desc *bhv,
struct seq_file *m) struct seq_file *m)
{ {
struct vfs *vfsp = bhvtovfs(bhv); struct bhv_vfs *vfsp = bhvtovfs(bhv);
struct xfs_mount *mp = XFS_VFSTOM(vfsp); struct xfs_mount *mp = XFS_VFSTOM(vfsp);
int error;
if (mp->m_qflags & XFS_UQUOTA_ACCT) { if (mp->m_qflags & XFS_UQUOTA_ACCT) {
(mp->m_qflags & XFS_UQUOTA_ENFD) ? (mp->m_qflags & XFS_UQUOTA_ENFD) ?
...@@ -165,8 +164,7 @@ xfs_qm_showargs( ...@@ -165,8 +164,7 @@ xfs_qm_showargs(
if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
seq_puts(m, "," MNTOPT_NOQUOTA); seq_puts(m, "," MNTOPT_NOQUOTA);
PVFS_SHOWARGS(BHV_NEXT(bhv), m, error); return bhv_next_vfs_showargs(BHV_NEXT(bhv), m);
return error;
} }
STATIC int STATIC int
...@@ -175,14 +173,12 @@ xfs_qm_mount( ...@@ -175,14 +173,12 @@ xfs_qm_mount(
struct xfs_mount_args *args, struct xfs_mount_args *args,
struct cred *cr) struct cred *cr)
{ {
struct vfs *vfsp = bhvtovfs(bhv); struct bhv_vfs *vfsp = bhvtovfs(bhv);
struct xfs_mount *mp = XFS_VFSTOM(vfsp); struct xfs_mount *mp = XFS_VFSTOM(vfsp);
int error;
if (args->flags & (XFSMNT_UQUOTA | XFSMNT_GQUOTA | XFSMNT_PQUOTA)) if (args->flags & (XFSMNT_UQUOTA | XFSMNT_GQUOTA | XFSMNT_PQUOTA))
xfs_qm_mount_quotainit(mp, args->flags); xfs_qm_mount_quotainit(mp, args->flags);
PVFS_MOUNT(BHV_NEXT(bhv), args, cr, error); return bhv_next_vfs_mount(BHV_NEXT(bhv), args, cr);
return error;
} }
/* /*
...@@ -205,7 +201,7 @@ xfs_qm_statvfs( ...@@ -205,7 +201,7 @@ xfs_qm_statvfs(
__uint64_t limit; __uint64_t limit;
int error; int error;
error = PVFS_STATVFS(BHV_NEXT(bhv), statp, vnode); error = bhv_next_vfs_statvfs(BHV_NEXT(bhv), statp, vnode);
if (error || !vnode) if (error || !vnode)
return error; return error;
...@@ -246,7 +242,7 @@ xfs_qm_syncall( ...@@ -246,7 +242,7 @@ xfs_qm_syncall(
int flags, int flags,
cred_t *credp) cred_t *credp)
{ {
struct vfs *vfsp = bhvtovfs(bhv); struct bhv_vfs *vfsp = bhvtovfs(bhv);
struct xfs_mount *mp = XFS_VFSTOM(vfsp); struct xfs_mount *mp = XFS_VFSTOM(vfsp);
int error; int error;
...@@ -265,8 +261,7 @@ xfs_qm_syncall( ...@@ -265,8 +261,7 @@ xfs_qm_syncall(
} }
} }
} }
PVFS_SYNC(BHV_NEXT(bhv), flags, credp, error); return bhv_next_vfs_sync(BHV_NEXT(bhv), flags, credp);
return error;
} }
STATIC int STATIC int
...@@ -401,7 +396,7 @@ STATIC struct xfs_qmops xfs_qmcore_xfs = { ...@@ -401,7 +396,7 @@ STATIC struct xfs_qmops xfs_qmcore_xfs = {
.xfs_dqtrxops = &xfs_trans_dquot_ops, .xfs_dqtrxops = &xfs_trans_dquot_ops,
}; };
struct bhv_vfsops xfs_qmops = { { struct bhv_module_vfsops xfs_qmops = { {
BHV_IDENTITY_INIT(VFS_BHV_QM, VFS_POSITION_QM), BHV_IDENTITY_INIT(VFS_BHV_QM, VFS_POSITION_QM),
.vfs_parseargs = xfs_qm_parseargs, .vfs_parseargs = xfs_qm_parseargs,
.vfs_showargs = xfs_qm_showargs, .vfs_showargs = xfs_qm_showargs,
......
...@@ -91,8 +91,8 @@ xfs_qm_quotactl( ...@@ -91,8 +91,8 @@ xfs_qm_quotactl(
xfs_caddr_t addr) xfs_caddr_t addr)
{ {
xfs_mount_t *mp; xfs_mount_t *mp;
bhv_vfs_t *vfsp;
int error; int error;
struct vfs *vfsp;
vfsp = bhvtovfs(bdp); vfsp = bhvtovfs(bdp);
mp = XFS_VFSTOM(vfsp); mp = XFS_VFSTOM(vfsp);
......
...@@ -189,6 +189,6 @@ typedef enum { ...@@ -189,6 +189,6 @@ typedef enum {
#define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) #define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0)
extern struct bhv_vfsops xfs_dmops; extern struct bhv_module_vfsops xfs_dmops;
#endif /* __XFS_DMAPI_H__ */ #endif /* __XFS_DMAPI_H__ */
...@@ -574,7 +574,7 @@ xfs_fs_goingdown( ...@@ -574,7 +574,7 @@ xfs_fs_goingdown(
{ {
switch (inflags) { switch (inflags) {
case XFS_FSOP_GOING_FLAGS_DEFAULT: { case XFS_FSOP_GOING_FLAGS_DEFAULT: {
struct vfs *vfsp = XFS_MTOVFS(mp); struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev);
if (sb && !IS_ERR(sb)) { if (sb && !IS_ERR(sb)) {
......
...@@ -468,7 +468,7 @@ xfs_iget_core( ...@@ -468,7 +468,7 @@ xfs_iget_core(
* If we have a real type for an on-disk inode, we can set ops(&unlock) * If we have a real type for an on-disk inode, we can set ops(&unlock)
* now. If it's a new inode being created, xfs_ialloc will handle it. * now. If it's a new inode being created, xfs_ialloc will handle it.
*/ */
VFS_INIT_VNODE(XFS_MTOVFS(mp), vp, XFS_ITOBHV(ip), 1); bhv_vfs_init_vnode(XFS_MTOVFS(mp), vp, XFS_ITOBHV(ip), 1);
return 0; return 0;
} }
......
...@@ -1250,8 +1250,8 @@ xfs_ialloc( ...@@ -1250,8 +1250,8 @@ xfs_ialloc(
*/ */
xfs_trans_log_inode(tp, ip, flags); xfs_trans_log_inode(tp, ip, flags);
/* now that we have an i_mode we can set Linux inode ops (& unlock) */ /* now that we have an i_mode we can setup inode ops and unlock */
VFS_INIT_VNODE(XFS_MTOVFS(tp->t_mountp), vp, XFS_ITOBHV(ip), 1); bhv_vfs_init_vnode(XFS_MTOVFS(tp->t_mountp), vp, XFS_ITOBHV(ip), 1);
*ipp = ip; *ipp = ip;
return 0; return 0;
......
...@@ -509,7 +509,6 @@ extern struct kmem_zone *xfs_chashlist_zone; ...@@ -509,7 +509,6 @@ extern struct kmem_zone *xfs_chashlist_zone;
extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_ifork_zone;
extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_inode_zone;
extern struct kmem_zone *xfs_ili_zone; extern struct kmem_zone *xfs_ili_zone;
extern struct vnodeops xfs_vnodeops;
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -59,7 +59,7 @@ xfs_size_fn( ...@@ -59,7 +59,7 @@ xfs_size_fn(
STATIC int STATIC int
xfs_ioinit( xfs_ioinit(
struct vfs *vfsp, struct bhv_vfs *vfsp,
struct xfs_mount_args *mntargs, struct xfs_mount_args *mntargs,
int flags) int flags)
{ {
......
...@@ -498,9 +498,8 @@ xfs_log_mount(xfs_mount_t *mp, ...@@ -498,9 +498,8 @@ xfs_log_mount(xfs_mount_t *mp,
* just worked. * just worked.
*/ */
if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) { if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) {
int error; bhv_vfs_t *vfsp = XFS_MTOVFS(mp);
vfs_t *vfsp = XFS_MTOVFS(mp); int error, readonly = (vfsp->vfs_flag & VFS_RDONLY);
int readonly = (vfsp->vfs_flag & VFS_RDONLY);
if (readonly) if (readonly)
vfsp->vfs_flag &= ~VFS_RDONLY; vfsp->vfs_flag &= ~VFS_RDONLY;
...@@ -816,7 +815,7 @@ xfs_log_need_covered(xfs_mount_t *mp) ...@@ -816,7 +815,7 @@ xfs_log_need_covered(xfs_mount_t *mp)
SPLDECL(s); SPLDECL(s);
int needed = 0, gen; int needed = 0, gen;
xlog_t *log = mp->m_log; xlog_t *log = mp->m_log;
vfs_t *vfsp = XFS_MTOVFS(mp); bhv_vfs_t *vfsp = XFS_MTOVFS(mp);
if (fs_frozen(vfsp) || XFS_FORCED_SHUTDOWN(mp) || if (fs_frozen(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
(vfsp->vfs_flag & VFS_RDONLY)) (vfsp->vfs_flag & VFS_RDONLY))
......
...@@ -196,7 +196,7 @@ xfs_mount_free( ...@@ -196,7 +196,7 @@ xfs_mount_free(
kmem_free(mp->m_logname, strlen(mp->m_logname) + 1); kmem_free(mp->m_logname, strlen(mp->m_logname) + 1);
if (remove_bhv) { if (remove_bhv) {
struct vfs *vfsp = XFS_MTOVFS(mp); struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
bhv_remove_all_vfsops(vfsp, 0); bhv_remove_all_vfsops(vfsp, 0);
VFS_REMOVEBHV(vfsp, &mp->m_bhv); VFS_REMOVEBHV(vfsp, &mp->m_bhv);
...@@ -337,7 +337,7 @@ xfs_mount_validate_sb( ...@@ -337,7 +337,7 @@ xfs_mount_validate_sb(
xfs_agnumber_t xfs_agnumber_t
xfs_initialize_perag( xfs_initialize_perag(
struct vfs *vfs, bhv_vfs_t *vfs,
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_agnumber_t agcount) xfs_agnumber_t agcount)
{ {
...@@ -651,7 +651,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp) ...@@ -651,7 +651,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp)
*/ */
int int
xfs_mountfs( xfs_mountfs(
vfs_t *vfsp, bhv_vfs_t *vfsp,
xfs_mount_t *mp, xfs_mount_t *mp,
int mfsi_flags) int mfsi_flags)
{ {
...@@ -1095,7 +1095,7 @@ xfs_mountfs( ...@@ -1095,7 +1095,7 @@ xfs_mountfs(
int int
xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
{ {
struct vfs *vfsp = XFS_MTOVFS(mp); struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
#if defined(DEBUG) || defined(INDUCE_IO_ERROR) #if defined(DEBUG) || defined(INDUCE_IO_ERROR)
int64_t fsid; int64_t fsid;
#endif #endif
......
...@@ -53,7 +53,7 @@ typedef struct xfs_trans_reservations { ...@@ -53,7 +53,7 @@ typedef struct xfs_trans_reservations {
#else #else
struct cred; struct cred;
struct log; struct log;
struct vfs; struct bhv_vfs;
struct vnode; struct vnode;
struct xfs_mount_args; struct xfs_mount_args;
struct xfs_ihash; struct xfs_ihash;
...@@ -66,7 +66,7 @@ struct xfs_bmap_free; ...@@ -66,7 +66,7 @@ struct xfs_bmap_free;
struct xfs_extdelta; struct xfs_extdelta;
struct xfs_swapext; struct xfs_swapext;
extern struct vfsops xfs_vfsops; extern struct bhv_vfsops xfs_vfsops;
extern struct vnodeops xfs_vnodeops; extern struct vnodeops xfs_vnodeops;
#define AIL_LOCK_T lock_t #define AIL_LOCK_T lock_t
...@@ -84,11 +84,11 @@ typedef int (*xfs_send_data_t)(int, struct vnode *, ...@@ -84,11 +84,11 @@ typedef int (*xfs_send_data_t)(int, struct vnode *,
xfs_off_t, size_t, int, vrwlock_t *); xfs_off_t, size_t, int, 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)(struct vnode *, dm_right_t); typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t);
typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct vfs *, typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct bhv_vfs *,
struct vnode *, struct vnode *,
dm_right_t, struct vnode *, dm_right_t, dm_right_t, struct vnode *, dm_right_t,
char *, char *, mode_t, int, int); char *, char *, mode_t, int, int);
typedef void (*xfs_send_unmount_t)(struct vfs *, struct vnode *, typedef void (*xfs_send_unmount_t)(struct bhv_vfs *, struct vnode *,
dm_right_t, mode_t, int, int); dm_right_t, mode_t, int, int);
typedef struct xfs_dmops { typedef struct xfs_dmops {
...@@ -190,7 +190,7 @@ typedef struct xfs_qmops { ...@@ -190,7 +190,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 vfs *, typedef int (*xfs_ioinit_t)(struct bhv_vfs *,
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,
...@@ -220,7 +220,7 @@ typedef void (*xfs_lock_demote_t)(void *, uint); ...@@ -220,7 +220,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 vfs *); typedef xfs_fsize_t (*xfs_iodone_t)(struct bhv_vfs *);
typedef int (*xfs_swap_extents_t)(void *, void *, typedef int (*xfs_swap_extents_t)(void *, void *,
struct xfs_swapext*); struct xfs_swapext*);
...@@ -511,7 +511,7 @@ xfs_preferred_iosize(xfs_mount_t *mp) ...@@ -511,7 +511,7 @@ xfs_preferred_iosize(xfs_mount_t *mp)
#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) #define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
#define xfs_force_shutdown(m,f) \ #define xfs_force_shutdown(m,f) \
VFS_FORCE_SHUTDOWN((XFS_MTOVFS(m)), f, __FILE__, __LINE__) bhv_vfs_force_shutdown((XFS_MTOVFS(m)), f, __FILE__, __LINE__)
/* /*
* Flags for xfs_mountfs * Flags for xfs_mountfs
...@@ -529,7 +529,7 @@ xfs_preferred_iosize(xfs_mount_t *mp) ...@@ -529,7 +529,7 @@ xfs_preferred_iosize(xfs_mount_t *mp)
* Macros for getting from mount to vfs and back. * Macros for getting from mount to vfs and back.
*/ */
#define XFS_MTOVFS(mp) xfs_mtovfs(mp) #define XFS_MTOVFS(mp) xfs_mtovfs(mp)
static inline struct vfs *xfs_mtovfs(xfs_mount_t *mp) static inline struct bhv_vfs *xfs_mtovfs(xfs_mount_t *mp)
{ {
return bhvtovfs(&mp->m_bhv); return bhvtovfs(&mp->m_bhv);
} }
...@@ -541,7 +541,7 @@ static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp) ...@@ -541,7 +541,7 @@ static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp)
} }
#define XFS_VFSTOM(vfs) xfs_vfstom(vfs) #define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
static inline xfs_mount_t *xfs_vfstom(vfs_t *vfs) static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
{ {
return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops)); return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops));
} }
...@@ -579,7 +579,7 @@ typedef struct xfs_mod_sb { ...@@ -579,7 +579,7 @@ typedef struct xfs_mod_sb {
extern xfs_mount_t *xfs_mount_init(void); 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 void xfs_mount_free(xfs_mount_t *mp, int remove_bhv); extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, int); extern int xfs_mountfs(struct bhv_vfs *, 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 *);
...@@ -597,7 +597,7 @@ extern void xfs_freesb(xfs_mount_t *); ...@@ -597,7 +597,7 @@ extern void xfs_freesb(xfs_mount_t *);
extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
extern int xfs_syncsub(xfs_mount_t *, int, int, int *); extern int xfs_syncsub(xfs_mount_t *, int, int, int *);
extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *); extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *);
extern xfs_agnumber_t xfs_initialize_perag(struct vfs *, xfs_mount_t *, extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *,
xfs_agnumber_t); xfs_agnumber_t);
extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);
......
...@@ -365,7 +365,7 @@ typedef struct xfs_dqtrxops { ...@@ -365,7 +365,7 @@ typedef struct xfs_dqtrxops {
extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *); extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *);
extern int xfs_mount_reset_sbqflags(struct xfs_mount *); extern int xfs_mount_reset_sbqflags(struct xfs_mount *);
extern struct bhv_vfsops xfs_qmops; extern struct bhv_module_vfsops xfs_qmops;
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -212,7 +212,7 @@ xfs_cleanup(void) ...@@ -212,7 +212,7 @@ xfs_cleanup(void)
*/ */
STATIC int STATIC int
xfs_start_flags( xfs_start_flags(
struct vfs *vfs, struct bhv_vfs *vfs,
struct xfs_mount_args *ap, struct xfs_mount_args *ap,
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
...@@ -337,7 +337,7 @@ xfs_start_flags( ...@@ -337,7 +337,7 @@ xfs_start_flags(
*/ */
STATIC int STATIC int
xfs_finish_flags( xfs_finish_flags(
struct vfs *vfs, struct bhv_vfs *vfs,
struct xfs_mount_args *ap, struct xfs_mount_args *ap,
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
...@@ -423,7 +423,7 @@ xfs_mount( ...@@ -423,7 +423,7 @@ xfs_mount(
struct xfs_mount_args *args, struct xfs_mount_args *args,
cred_t *credp) cred_t *credp)
{ {
struct vfs *vfsp = bhvtovfs(bhvp); struct bhv_vfs *vfsp = bhvtovfs(bhvp);
struct bhv_desc *p; struct bhv_desc *p;
struct xfs_mount *mp = XFS_BHVTOM(bhvp); struct xfs_mount *mp = XFS_BHVTOM(bhvp);
struct block_device *ddev, *logdev, *rtdev; struct block_device *ddev, *logdev, *rtdev;
...@@ -552,7 +552,7 @@ xfs_unmount( ...@@ -552,7 +552,7 @@ xfs_unmount(
int flags, int flags,
cred_t *credp) cred_t *credp)
{ {
struct vfs *vfsp = bhvtovfs(bdp); bhv_vfs_t *vfsp = bhvtovfs(bdp);
xfs_mount_t *mp = XFS_BHVTOM(bdp); xfs_mount_t *mp = XFS_BHVTOM(bdp);
xfs_inode_t *rip; xfs_inode_t *rip;
vnode_t *rvp; vnode_t *rvp;
...@@ -665,9 +665,8 @@ xfs_mntupdate( ...@@ -665,9 +665,8 @@ xfs_mntupdate(
int *flags, int *flags,
struct xfs_mount_args *args) struct xfs_mount_args *args)
{ {
struct vfs *vfsp = bhvtovfs(bdp); bhv_vfs_t *vfsp = bhvtovfs(bdp);
xfs_mount_t *mp = XFS_BHVTOM(bdp); xfs_mount_t *mp = XFS_BHVTOM(bdp);
int error;
if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */
if (vfsp->vfs_flag & VFS_RDONLY) if (vfsp->vfs_flag & VFS_RDONLY)
...@@ -679,7 +678,7 @@ xfs_mntupdate( ...@@ -679,7 +678,7 @@ xfs_mntupdate(
mp->m_flags &= ~XFS_MOUNT_BARRIER; mp->m_flags &= ~XFS_MOUNT_BARRIER;
} }
} else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */ } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */
VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); bhv_vfs_sync(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL);
xfs_quiesce_fs(mp); xfs_quiesce_fs(mp);
xfs_log_unmount_write(mp); xfs_log_unmount_write(mp);
xfs_unmountfs_writesb(mp); xfs_unmountfs_writesb(mp);
...@@ -900,7 +899,7 @@ xfs_sync( ...@@ -900,7 +899,7 @@ xfs_sync(
/* /*
* xfs sync routine for internal use * xfs sync routine for internal use
* *
* This routine supports all of the flags defined for the generic VFS_SYNC * This routine supports all of the flags defined for the generic vfs_sync
* interface as explained above under xfs_sync. In the interests of not * interface as explained above under xfs_sync. In the interests of not
* changing interfaces within the 6.5 family, additional internally- * changing interfaces within the 6.5 family, additional internally-
* required functions are specified within a separate xflags parameter, * required functions are specified within a separate xflags parameter,
...@@ -1421,7 +1420,7 @@ xfs_sync_inodes( ...@@ -1421,7 +1420,7 @@ xfs_sync_inodes(
/* /*
* xfs sync routine for internal use * xfs sync routine for internal use
* *
* This routine supports all of the flags defined for the generic VFS_SYNC * This routine supports all of the flags defined for the generic vfs_sync
* interface as explained above under xfs_sync. In the interests of not * interface as explained above under xfs_sync. In the interests of not
* changing interfaces within the 6.5 family, additional internally- * changing interfaces within the 6.5 family, additional internally-
* required functions are specified within a separate xflags parameter, * required functions are specified within a separate xflags parameter,
...@@ -1686,7 +1685,7 @@ xfs_parseargs( ...@@ -1686,7 +1685,7 @@ xfs_parseargs(
struct xfs_mount_args *args, struct xfs_mount_args *args,
int update) int update)
{ {
struct vfs *vfsp = bhvtovfs(bhv); bhv_vfs_t *vfsp = bhvtovfs(bhv);
char *this_char, *value, *eov; char *this_char, *value, *eov;
int dsunit, dswidth, vol_dsunit, vol_dswidth; int dsunit, dswidth, vol_dsunit, vol_dswidth;
int iosize; int iosize;
...@@ -1924,7 +1923,7 @@ xfs_showargs( ...@@ -1924,7 +1923,7 @@ xfs_showargs(
}; };
struct proc_xfs_info *xfs_infop; struct proc_xfs_info *xfs_infop;
struct xfs_mount *mp = XFS_BHVTOM(bhv); struct xfs_mount *mp = XFS_BHVTOM(bhv);
struct vfs *vfsp = XFS_MTOVFS(mp); struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
if (mp->m_flags & xfs_infop->flag) if (mp->m_flags & xfs_infop->flag)
...@@ -1984,7 +1983,7 @@ xfs_freeze( ...@@ -1984,7 +1983,7 @@ xfs_freeze(
} }
vfsops_t xfs_vfsops = { bhv_vfsops_t xfs_vfsops = {
BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS), BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS),
.vfs_parseargs = xfs_parseargs, .vfs_parseargs = xfs_parseargs,
.vfs_showargs = xfs_showargs, .vfs_showargs = xfs_showargs,
......
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