diff options
| author | Christoph Hellwig <hch@infradead.org> | 2007-08-30 03:20:31 -0400 |
|---|---|---|
| committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 21:43:55 -0400 |
| commit | 48c872a9f3ec4cdc37801aae9ef16c80026503ea (patch) | |
| tree | 51d377e7ced7298d96daf9008558e54177e47a30 | |
| parent | b09cc77109dbf33463480952de10511a2b67bba6 (diff) | |
[XFS] decontaminate vfs operations from behavior details
All vfs ops now take struct xfs_mount pointers and the behaviour related
glue is split out into methods of its own.
SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29504a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
| -rw-r--r-- | fs/xfs/Makefile-linux-2.6 | 1 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 4 | ||||
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_super.h | 2 | ||||
| -rw-r--r-- | fs/xfs/xfs_mount.h | 1 | ||||
| -rw-r--r-- | fs/xfs/xfs_rw.c | 5 | ||||
| -rw-r--r-- | fs/xfs/xfs_vfsops.c | 86 | ||||
| -rw-r--r-- | fs/xfs/xfs_vfsops.h | 31 | ||||
| -rw-r--r-- | fs/xfs/xfs_vfsops_bhv.c | 145 |
8 files changed, 207 insertions, 68 deletions
diff --git a/fs/xfs/Makefile-linux-2.6 b/fs/xfs/Makefile-linux-2.6 index 6d48a5ed38f3..0e474785ebae 100644 --- a/fs/xfs/Makefile-linux-2.6 +++ b/fs/xfs/Makefile-linux-2.6 | |||
| @@ -88,6 +88,7 @@ xfs-y += xfs_alloc.o \ | |||
| 88 | xfs_trans_item.o \ | 88 | xfs_trans_item.o \ |
| 89 | xfs_utils.o \ | 89 | xfs_utils.o \ |
| 90 | xfs_vfsops.o \ | 90 | xfs_vfsops.o \ |
| 91 | xfs_vfsops_bhv.o \ | ||
| 91 | xfs_vnodeops.o \ | 92 | xfs_vnodeops.o \ |
| 92 | xfs_rw.o \ | 93 | xfs_rw.o \ |
| 93 | xfs_dmops.o \ | 94 | xfs_dmops.o \ |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 103add6eccb6..0cb149ad65cc 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
| @@ -202,7 +202,7 @@ xfs_revalidate_inode( | |||
| 202 | 202 | ||
| 203 | void | 203 | void |
| 204 | xfs_initialize_vnode( | 204 | xfs_initialize_vnode( |
| 205 | bhv_desc_t *bdp, | 205 | struct xfs_mount *mp, |
| 206 | bhv_vnode_t *vp, | 206 | bhv_vnode_t *vp, |
| 207 | struct xfs_inode *ip, | 207 | struct xfs_inode *ip, |
| 208 | int unlock) | 208 | int unlock) |
| @@ -222,7 +222,7 @@ xfs_initialize_vnode( | |||
| 222 | * finish our work. | 222 | * finish our work. |
| 223 | */ | 223 | */ |
| 224 | if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) { | 224 | if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) { |
| 225 | xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip); | 225 | xfs_revalidate_inode(mp, vp, ip); |
| 226 | xfs_set_inodeops(inode); | 226 | xfs_set_inodeops(inode); |
| 227 | 227 | ||
| 228 | xfs_iflags_clear(ip, XFS_INEW); | 228 | xfs_iflags_clear(ip, XFS_INEW); |
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h index 4bbf985a7de7..dba6f1cc348a 100644 --- a/fs/xfs/linux-2.6/xfs_super.h +++ b/fs/xfs/linux-2.6/xfs_super.h | |||
| @@ -107,8 +107,6 @@ struct block_device; | |||
| 107 | 107 | ||
| 108 | extern __uint64_t xfs_max_file_offset(unsigned int); | 108 | extern __uint64_t xfs_max_file_offset(unsigned int); |
| 109 | 109 | ||
| 110 | extern void xfs_initialize_vnode(bhv_desc_t *, bhv_vnode_t *, struct xfs_inode *, int); | ||
| 111 | |||
| 112 | extern void xfs_flush_inode(struct xfs_inode *); | 110 | extern void xfs_flush_inode(struct xfs_inode *); |
| 113 | extern void xfs_flush_device(struct xfs_inode *); | 111 | extern void xfs_flush_device(struct xfs_inode *); |
| 114 | 112 | ||
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 594d7856c77e..68d712574b81 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
| @@ -650,7 +650,6 @@ extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int); | |||
| 650 | extern int xfs_readsb(xfs_mount_t *, int); | 650 | extern int xfs_readsb(xfs_mount_t *, int); |
| 651 | extern void xfs_freesb(xfs_mount_t *); | 651 | extern void xfs_freesb(xfs_mount_t *); |
| 652 | extern int xfs_fs_writable(xfs_mount_t *); | 652 | extern int xfs_fs_writable(xfs_mount_t *); |
| 653 | extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); | ||
| 654 | extern int xfs_syncsub(xfs_mount_t *, int, int *); | 653 | extern int xfs_syncsub(xfs_mount_t *, int, int *); |
| 655 | extern int xfs_sync_inodes(xfs_mount_t *, int, int *); | 654 | extern int xfs_sync_inodes(xfs_mount_t *, int, int *); |
| 656 | extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *, | 655 | extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *, |
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c index 905d1c008be7..cd3ece6cc918 100644 --- a/fs/xfs/xfs_rw.c +++ b/fs/xfs/xfs_rw.c | |||
| @@ -178,18 +178,15 @@ xfs_write_sync_logforce( | |||
| 178 | * the shop, make sure that absolutely nothing persistent happens to | 178 | * the shop, make sure that absolutely nothing persistent happens to |
| 179 | * this filesystem after this point. | 179 | * this filesystem after this point. |
| 180 | */ | 180 | */ |
| 181 | |||
| 182 | void | 181 | void |
| 183 | xfs_do_force_shutdown( | 182 | xfs_do_force_shutdown( |
| 184 | bhv_desc_t *bdp, | 183 | xfs_mount_t *mp, |
| 185 | int flags, | 184 | int flags, |
| 186 | char *fname, | 185 | char *fname, |
| 187 | int lnnum) | 186 | int lnnum) |
| 188 | { | 187 | { |
| 189 | int logerror; | 188 | int logerror; |
| 190 | xfs_mount_t *mp; | ||
| 191 | 189 | ||
| 192 | mp = XFS_BHVTOM(bdp); | ||
| 193 | logerror = flags & SHUTDOWN_LOG_IO_ERROR; | 190 | logerror = flags & SHUTDOWN_LOG_IO_ERROR; |
| 194 | 191 | ||
| 195 | if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { | 192 | if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { |
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index f62f6e486f23..2d672f317110 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
| @@ -55,10 +55,9 @@ | |||
| 55 | #include "xfs_filestream.h" | 55 | #include "xfs_filestream.h" |
| 56 | #include "xfs_fsops.h" | 56 | #include "xfs_fsops.h" |
| 57 | #include "xfs_vnodeops.h" | 57 | #include "xfs_vnodeops.h" |
| 58 | #include "xfs_vfsops.h" | ||
| 58 | 59 | ||
| 59 | 60 | ||
| 60 | STATIC int xfs_sync(bhv_desc_t *, int, cred_t *); | ||
| 61 | |||
| 62 | int | 61 | int |
| 63 | xfs_init(void) | 62 | xfs_init(void) |
| 64 | { | 63 | { |
| @@ -433,15 +432,14 @@ xfs_finish_flags( | |||
| 433 | * they are present. The data subvolume has already been opened by | 432 | * they are present. The data subvolume has already been opened by |
| 434 | * get_sb_bdev() and is stored in vfsp->vfs_super->s_bdev. | 433 | * get_sb_bdev() and is stored in vfsp->vfs_super->s_bdev. |
| 435 | */ | 434 | */ |
| 436 | STATIC int | 435 | int |
| 437 | xfs_mount( | 436 | xfs_mount( |
| 438 | struct bhv_desc *bhvp, | 437 | struct xfs_mount *mp, |
| 439 | struct xfs_mount_args *args, | 438 | struct xfs_mount_args *args, |
| 440 | cred_t *credp) | 439 | cred_t *credp) |
| 441 | { | 440 | { |
| 442 | struct bhv_vfs *vfsp = bhvtovfs(bhvp); | 441 | struct bhv_vfs *vfsp = XFS_MTOVFS(mp); |
| 443 | struct bhv_desc *p; | 442 | struct bhv_desc *p; |
| 444 | struct xfs_mount *mp = XFS_BHVTOM(bhvp); | ||
| 445 | struct block_device *ddev, *logdev, *rtdev; | 443 | struct block_device *ddev, *logdev, *rtdev; |
| 446 | int flags = 0, error; | 444 | int flags = 0, error; |
| 447 | 445 | ||
| @@ -578,14 +576,13 @@ error0: | |||
| 578 | return error; | 576 | return error; |
| 579 | } | 577 | } |
| 580 | 578 | ||
| 581 | STATIC int | 579 | int |
| 582 | xfs_unmount( | 580 | xfs_unmount( |
| 583 | bhv_desc_t *bdp, | 581 | xfs_mount_t *mp, |
| 584 | int flags, | 582 | int flags, |
| 585 | cred_t *credp) | 583 | cred_t *credp) |
| 586 | { | 584 | { |
| 587 | bhv_vfs_t *vfsp = bhvtovfs(bdp); | 585 | bhv_vfs_t *vfsp = XFS_MTOVFS(mp); |
| 588 | xfs_mount_t *mp = XFS_BHVTOM(bdp); | ||
| 589 | xfs_inode_t *rip; | 586 | xfs_inode_t *rip; |
| 590 | bhv_vnode_t *rvp; | 587 | bhv_vnode_t *rvp; |
| 591 | int unmount_event_wanted = 0; | 588 | int unmount_event_wanted = 0; |
| @@ -641,8 +638,7 @@ xfs_unmount( | |||
| 641 | * referenced vnodes as well. | 638 | * referenced vnodes as well. |
| 642 | */ | 639 | */ |
| 643 | if (XFS_FORCED_SHUTDOWN(mp)) { | 640 | if (XFS_FORCED_SHUTDOWN(mp)) { |
| 644 | error = xfs_sync(&mp->m_bhv, | 641 | error = xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE); |
| 645 | (SYNC_WAIT | SYNC_CLOSE), credp); | ||
| 646 | ASSERT(error != EFSCORRUPTED); | 642 | ASSERT(error != EFSCORRUPTED); |
| 647 | } | 643 | } |
| 648 | xfs_unmountfs_needed = 1; | 644 | xfs_unmountfs_needed = 1; |
| @@ -726,14 +722,13 @@ xfs_attr_quiesce( | |||
| 726 | xfs_unmountfs_writesb(mp); | 722 | xfs_unmountfs_writesb(mp); |
| 727 | } | 723 | } |
| 728 | 724 | ||
| 729 | STATIC int | 725 | int |
| 730 | xfs_mntupdate( | 726 | xfs_mntupdate( |
| 731 | bhv_desc_t *bdp, | 727 | struct xfs_mount *mp, |
| 732 | int *flags, | 728 | int *flags, |
| 733 | struct xfs_mount_args *args) | 729 | struct xfs_mount_args *args) |
| 734 | { | 730 | { |
| 735 | bhv_vfs_t *vfsp = bhvtovfs(bdp); | 731 | struct bhv_vfs *vfsp = XFS_MTOVFS(mp); |
| 736 | xfs_mount_t *mp = XFS_BHVTOM(bdp); | ||
| 737 | 732 | ||
| 738 | if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ | 733 | if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ |
| 739 | if (vfsp->vfs_flag & VFS_RDONLY) | 734 | if (vfsp->vfs_flag & VFS_RDONLY) |
| @@ -843,14 +838,14 @@ fscorrupt_out2: | |||
| 843 | * vpp -- address of the caller's vnode pointer which should be | 838 | * vpp -- address of the caller's vnode pointer which should be |
| 844 | * set to the desired fs root vnode | 839 | * set to the desired fs root vnode |
| 845 | */ | 840 | */ |
| 846 | STATIC int | 841 | int |
| 847 | xfs_root( | 842 | xfs_root( |
| 848 | bhv_desc_t *bdp, | 843 | xfs_mount_t *mp, |
| 849 | bhv_vnode_t **vpp) | 844 | bhv_vnode_t **vpp) |
| 850 | { | 845 | { |
| 851 | bhv_vnode_t *vp; | 846 | bhv_vnode_t *vp; |
| 852 | 847 | ||
| 853 | vp = XFS_ITOV((XFS_BHVTOM(bdp))->m_rootip); | 848 | vp = XFS_ITOV(mp->m_rootip); |
| 854 | VN_HOLD(vp); | 849 | VN_HOLD(vp); |
| 855 | *vpp = vp; | 850 | *vpp = vp; |
| 856 | return 0; | 851 | return 0; |
| @@ -863,19 +858,17 @@ xfs_root( | |||
| 863 | * the superblock lock in the mount structure to ensure a consistent | 858 | * the superblock lock in the mount structure to ensure a consistent |
| 864 | * snapshot of the counters returned. | 859 | * snapshot of the counters returned. |
| 865 | */ | 860 | */ |
| 866 | STATIC int | 861 | int |
| 867 | xfs_statvfs( | 862 | xfs_statvfs( |
| 868 | bhv_desc_t *bdp, | 863 | xfs_mount_t *mp, |
| 869 | bhv_statvfs_t *statp, | 864 | bhv_statvfs_t *statp, |
| 870 | bhv_vnode_t *vp) | 865 | bhv_vnode_t *vp) |
| 871 | { | 866 | { |
| 872 | __uint64_t fakeinos; | 867 | __uint64_t fakeinos; |
| 873 | xfs_extlen_t lsize; | 868 | xfs_extlen_t lsize; |
| 874 | xfs_mount_t *mp; | ||
| 875 | xfs_sb_t *sbp; | 869 | xfs_sb_t *sbp; |
| 876 | unsigned long s; | 870 | unsigned long s; |
| 877 | 871 | ||
| 878 | mp = XFS_BHVTOM(bdp); | ||
| 879 | sbp = &(mp->m_sb); | 872 | sbp = &(mp->m_sb); |
| 880 | 873 | ||
| 881 | statp->f_type = XFS_SB_MAGIC; | 874 | statp->f_type = XFS_SB_MAGIC; |
| @@ -954,14 +947,11 @@ xfs_statvfs( | |||
| 954 | * filesystem. | 947 | * filesystem. |
| 955 | * | 948 | * |
| 956 | */ | 949 | */ |
| 957 | /*ARGSUSED*/ | 950 | int |
| 958 | STATIC int | ||
| 959 | xfs_sync( | 951 | xfs_sync( |
| 960 | bhv_desc_t *bdp, | 952 | xfs_mount_t *mp, |
| 961 | int flags, | 953 | int flags) |
| 962 | cred_t *credp) | ||
| 963 | { | 954 | { |
| 964 | xfs_mount_t *mp = XFS_BHVTOM(bdp); | ||
| 965 | int error; | 955 | int error; |
| 966 | 956 | ||
| 967 | /* | 957 | /* |
| @@ -1652,13 +1642,12 @@ xfs_syncsub( | |||
| 1652 | /* | 1642 | /* |
| 1653 | * xfs_vget - called by DMAPI and NFSD to get vnode from file handle | 1643 | * xfs_vget - called by DMAPI and NFSD to get vnode from file handle |
| 1654 | */ | 1644 | */ |
| 1655 | STATIC int | 1645 | int |
| 1656 | xfs_vget( | 1646 | xfs_vget( |
| 1657 | bhv_desc_t *bdp, | 1647 | xfs_mount_t *mp, |
| 1658 | bhv_vnode_t **vpp, | 1648 | bhv_vnode_t **vpp, |
| 1659 | fid_t *fidp) | 1649 | fid_t *fidp) |
| 1660 | { | 1650 | { |
| 1661 | xfs_mount_t *mp = XFS_BHVTOM(bdp); | ||
| 1662 | xfs_fid_t *xfid = (struct xfs_fid *)fidp; | 1651 | xfs_fid_t *xfid = (struct xfs_fid *)fidp; |
| 1663 | xfs_inode_t *ip; | 1652 | xfs_inode_t *ip; |
| 1664 | int error; | 1653 | int error; |
| @@ -1775,14 +1764,14 @@ suffix_strtoul(char *s, char **endp, unsigned int base) | |||
| 1775 | return simple_strtoul((const char *)s, endp, base) << shift_left_factor; | 1764 | return simple_strtoul((const char *)s, endp, base) << shift_left_factor; |
| 1776 | } | 1765 | } |
| 1777 | 1766 | ||
| 1778 | STATIC int | 1767 | int |
| 1779 | xfs_parseargs( | 1768 | xfs_parseargs( |
| 1780 | struct bhv_desc *bhv, | 1769 | struct xfs_mount *mp, |
| 1781 | char *options, | 1770 | char *options, |
| 1782 | struct xfs_mount_args *args, | 1771 | struct xfs_mount_args *args, |
| 1783 | int update) | 1772 | int update) |
| 1784 | { | 1773 | { |
| 1785 | bhv_vfs_t *vfsp = bhvtovfs(bhv); | 1774 | bhv_vfs_t *vfsp = XFS_MTOVFS(mp); |
| 1786 | char *this_char, *value, *eov; | 1775 | char *this_char, *value, *eov; |
| 1787 | int dsunit, dswidth, vol_dsunit, vol_dswidth; | 1776 | int dsunit, dswidth, vol_dsunit, vol_dswidth; |
| 1788 | int iosize; | 1777 | int iosize; |
| @@ -2047,9 +2036,9 @@ done: | |||
| 2047 | return 0; | 2036 | return 0; |
| 2048 | } | 2037 | } |
| 2049 | 2038 | ||
| 2050 | STATIC int | 2039 | int |
| 2051 | xfs_showargs( | 2040 | xfs_showargs( |
| 2052 | struct bhv_desc *bhv, | 2041 | struct xfs_mount *mp, |
| 2053 | struct seq_file *m) | 2042 | struct seq_file *m) |
| 2054 | { | 2043 | { |
| 2055 | static struct proc_xfs_info { | 2044 | static struct proc_xfs_info { |
| @@ -2067,7 +2056,6 @@ xfs_showargs( | |||
| 2067 | { 0, NULL } | 2056 | { 0, NULL } |
| 2068 | }; | 2057 | }; |
| 2069 | struct proc_xfs_info *xfs_infop; | 2058 | struct proc_xfs_info *xfs_infop; |
| 2070 | struct xfs_mount *mp = XFS_BHVTOM(bhv); | ||
| 2071 | struct bhv_vfs *vfsp = XFS_MTOVFS(mp); | 2059 | struct bhv_vfs *vfsp = XFS_MTOVFS(mp); |
| 2072 | 2060 | ||
| 2073 | for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { | 2061 | for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { |
| @@ -2142,28 +2130,8 @@ xfs_showargs( | |||
| 2142 | */ | 2130 | */ |
| 2143 | STATIC void | 2131 | STATIC void |
| 2144 | xfs_freeze( | 2132 | xfs_freeze( |
| 2145 | bhv_desc_t *bdp) | 2133 | xfs_mount_t *mp) |
| 2146 | { | 2134 | { |
| 2147 | xfs_mount_t *mp = XFS_BHVTOM(bdp); | ||
| 2148 | |||
| 2149 | xfs_attr_quiesce(mp); | 2135 | xfs_attr_quiesce(mp); |
| 2150 | xfs_fs_log_dummy(mp); | 2136 | xfs_fs_log_dummy(mp); |
| 2151 | } | 2137 | } |
| 2152 | |||
| 2153 | |||
| 2154 | bhv_vfsops_t xfs_vfsops = { | ||
| 2155 | BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS), | ||
| 2156 | .vfs_parseargs = xfs_parseargs, | ||
| 2157 | .vfs_showargs = xfs_showargs, | ||
| 2158 | .vfs_mount = xfs_mount, | ||
| 2159 | .vfs_unmount = xfs_unmount, | ||
| 2160 | .vfs_mntupdate = xfs_mntupdate, | ||
| 2161 | .vfs_root = xfs_root, | ||
| 2162 | .vfs_statvfs = xfs_statvfs, | ||
| 2163 | .vfs_sync = xfs_sync, | ||
| 2164 | .vfs_vget = xfs_vget, | ||
| 2165 | .vfs_quotactl = (vfs_quotactl_t)fs_nosys, | ||
| 2166 | .vfs_init_vnode = xfs_initialize_vnode, | ||
| 2167 | .vfs_force_shutdown = xfs_do_force_shutdown, | ||
| 2168 | .vfs_freeze = xfs_freeze, | ||
| 2169 | }; | ||
diff --git a/fs/xfs/xfs_vfsops.h b/fs/xfs/xfs_vfsops.h new file mode 100644 index 000000000000..994502eac19a --- /dev/null +++ b/fs/xfs/xfs_vfsops.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #ifndef _XFS_VFSOPS_H | ||
| 2 | #define _XFS_VFSOPS_H 1 | ||
| 3 | |||
| 4 | struct cred; | ||
| 5 | struct fid; | ||
| 6 | struct inode; | ||
| 7 | struct kstatfs; | ||
| 8 | struct xfs_mount; | ||
| 9 | struct xfs_mount_args; | ||
| 10 | |||
| 11 | int xfs_mount(struct xfs_mount *mp, struct xfs_mount_args *args, | ||
| 12 | struct cred *credp); | ||
| 13 | int xfs_unmount(struct xfs_mount *mp, int flags, struct cred *credp); | ||
| 14 | int xfs_mntupdate(struct xfs_mount *mp, int *flags, | ||
| 15 | struct xfs_mount_args *args); | ||
| 16 | int xfs_root(struct xfs_mount *mp, bhv_vnode_t **vpp); | ||
| 17 | int xfs_statvfs(struct xfs_mount *mp, struct kstatfs *statp, | ||
| 18 | bhv_vnode_t *vp); | ||
| 19 | int xfs_sync(struct xfs_mount *mp, int flags); | ||
| 20 | int xfs_vget(struct xfs_mount *mp, bhv_vnode_t **vpp, struct fid *fidp); | ||
| 21 | int xfs_parseargs(struct xfs_mount *mp, char *options, | ||
| 22 | struct xfs_mount_args *args, int update); | ||
| 23 | int xfs_showargs(struct xfs_mount *mp, struct seq_file *m); | ||
| 24 | void xfs_freeze(struct xfs_mount *mp); | ||
| 25 | void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname, | ||
| 26 | int lnnum); | ||
| 27 | struct inode *xfs_get_inode(struct xfs_mount *mp, xfs_ino_t ino, int flags); | ||
| 28 | void xfs_initialize_vnode(struct xfs_mount *mp, bhv_vnode_t *vp, | ||
| 29 | struct xfs_inode *ip, int unlock); | ||
| 30 | |||
| 31 | #endif /* _XFS_VFSOPS_H */ | ||
diff --git a/fs/xfs/xfs_vfsops_bhv.c b/fs/xfs/xfs_vfsops_bhv.c new file mode 100644 index 000000000000..764b2aefb6bc --- /dev/null +++ b/fs/xfs/xfs_vfsops_bhv.c | |||
| @@ -0,0 +1,145 @@ | |||
| 1 | |||
| 2 | #include "xfs_linux.h" | ||
| 3 | #include "xfs_vfsops.h" | ||
| 4 | |||
| 5 | #include "xfs_inum.h" | ||
| 6 | #include "xfs_dmapi.h" | ||
| 7 | #include "xfs_sb.h" | ||
| 8 | #include "xfs_log.h" | ||
| 9 | #include "xfs_trans.h" | ||
| 10 | #include "xfs_ag.h" | ||
| 11 | #include "xfs_mount.h" | ||
| 12 | |||
| 13 | |||
| 14 | STATIC int | ||
| 15 | xfs_bhv_mount( | ||
| 16 | struct bhv_desc *bhvp, | ||
| 17 | struct xfs_mount_args *args, | ||
| 18 | cred_t *credp) | ||
| 19 | { | ||
| 20 | return xfs_mount(XFS_BHVTOM(bhvp), args, credp); | ||
| 21 | } | ||
| 22 | |||
| 23 | STATIC int | ||
| 24 | xfs_bhv_unmount( | ||
| 25 | bhv_desc_t *bdp, | ||
| 26 | int flags, | ||
| 27 | cred_t *credp) | ||
| 28 | { | ||
| 29 | return xfs_unmount(XFS_BHVTOM(bdp), flags, credp); | ||
| 30 | } | ||
| 31 | |||
| 32 | STATIC int | ||
| 33 | xfs_bhv_mntupdate( | ||
| 34 | bhv_desc_t *bdp, | ||
| 35 | int *flags, | ||
| 36 | struct xfs_mount_args *args) | ||
| 37 | { | ||
| 38 | return xfs_mntupdate(XFS_BHVTOM(bdp), flags, args); | ||
| 39 | } | ||
| 40 | |||
| 41 | STATIC int | ||
| 42 | xfs_bhv_root( | ||
| 43 | bhv_desc_t *bdp, | ||
| 44 | bhv_vnode_t **vpp) | ||
| 45 | { | ||
| 46 | return xfs_root(XFS_BHVTOM(bdp), vpp); | ||
| 47 | } | ||
| 48 | |||
| 49 | STATIC int | ||
| 50 | xfs_bhv_statvfs( | ||
| 51 | bhv_desc_t *bdp, | ||
| 52 | bhv_statvfs_t *statp, | ||
| 53 | bhv_vnode_t *vp) | ||
| 54 | { | ||
| 55 | return xfs_statvfs(XFS_BHVTOM(bdp), statp, vp); | ||
| 56 | } | ||
| 57 | |||
| 58 | STATIC int | ||
| 59 | xfs_bhv_sync( | ||
| 60 | bhv_desc_t *bdp, | ||
| 61 | int flags, | ||
| 62 | cred_t *credp) | ||
| 63 | { | ||
| 64 | return xfs_sync(XFS_BHVTOM(bdp), flags); | ||
| 65 | } | ||
| 66 | |||
| 67 | STATIC int | ||
| 68 | xfs_bhv_vget( | ||
| 69 | bhv_desc_t *bdp, | ||
| 70 | bhv_vnode_t **vpp, | ||
| 71 | fid_t *fidp) | ||
| 72 | { | ||
| 73 | return xfs_vget(XFS_BHVTOM(bdp), vpp, fidp); | ||
| 74 | } | ||
| 75 | |||
| 76 | STATIC int | ||
| 77 | xfs_bhv_parseargs( | ||
| 78 | struct bhv_desc *bhv, | ||
| 79 | char *options, | ||
| 80 | struct xfs_mount_args *args, | ||
| 81 | int update) | ||
| 82 | { | ||
| 83 | return xfs_parseargs(XFS_BHVTOM(bhv), options, args, update); | ||
| 84 | } | ||
| 85 | |||
| 86 | STATIC int | ||
| 87 | xfs_bhv_showargs( | ||
| 88 | struct bhv_desc *bhv, | ||
| 89 | struct seq_file *m) | ||
| 90 | { | ||
| 91 | return xfs_showargs(XFS_BHVTOM(bhv), m); | ||
| 92 | } | ||
| 93 | |||
| 94 | STATIC void | ||
| 95 | xfs_bhv_freeze( | ||
| 96 | bhv_desc_t *bdp) | ||
| 97 | { | ||
| 98 | return xfs_freeze(XFS_BHVTOM(bdp)); | ||
| 99 | } | ||
| 100 | |||
| 101 | STATIC void | ||
| 102 | xfs_bhv_force_shutdown( | ||
| 103 | bhv_desc_t *bdp, | ||
| 104 | int flags, | ||
| 105 | char *fname, | ||
| 106 | int lnnum) | ||
| 107 | { | ||
| 108 | return xfs_do_force_shutdown(XFS_BHVTOM(bdp), flags, fname, lnnum); | ||
| 109 | } | ||
| 110 | |||
| 111 | STATIC struct inode * | ||
| 112 | xfs_bhv_get_inode( | ||
| 113 | bhv_desc_t *bdp, | ||
| 114 | xfs_ino_t ino, | ||
| 115 | int flags) | ||
| 116 | { | ||
| 117 | return xfs_get_inode(XFS_BHVTOM(bdp), ino, flags); | ||
| 118 | } | ||
| 119 | |||
| 120 | STATIC void | ||
| 121 | xfs_bhv_initialize_vnode( | ||
| 122 | bhv_desc_t *bdp, | ||
| 123 | bhv_vnode_t *vp, | ||
| 124 | struct xfs_inode *ip, | ||
| 125 | int unlock) | ||
| 126 | { | ||
| 127 | return xfs_initialize_vnode(XFS_BHVTOM(bdp), vp, ip, unlock); | ||
| 128 | } | ||
| 129 | |||
| 130 | bhv_vfsops_t xfs_vfsops = { | ||
| 131 | BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS), | ||
| 132 | .vfs_parseargs = xfs_bhv_parseargs, | ||
| 133 | .vfs_showargs = xfs_bhv_showargs, | ||
| 134 | .vfs_mount = xfs_bhv_mount, | ||
| 135 | .vfs_unmount = xfs_bhv_unmount, | ||
| 136 | .vfs_mntupdate = xfs_bhv_mntupdate, | ||
| 137 | .vfs_root = xfs_bhv_root, | ||
| 138 | .vfs_statvfs = xfs_bhv_statvfs, | ||
| 139 | .vfs_sync = xfs_bhv_sync, | ||
| 140 | .vfs_vget = xfs_bhv_vget, | ||
| 141 | .vfs_get_inode = xfs_bhv_get_inode, | ||
| 142 | .vfs_init_vnode = xfs_bhv_initialize_vnode, | ||
| 143 | .vfs_force_shutdown = xfs_bhv_force_shutdown, | ||
| 144 | .vfs_freeze = xfs_bhv_freeze, | ||
| 145 | }; | ||
