aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-30 03:21:30 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 22:17:27 -0400
commitb267ce9952374c51099f21d6c3a59c78fa0d7586 (patch)
treebb91ddce70fb9868217cb4f622e2c471ed4946b7 /fs/xfs
parent743944967021f3759d3540b0dfbc7ee7215bc4b0 (diff)
[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: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/Makefile-linux-2.61
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c15
-rw-r--r--fs/xfs/linux-2.6/xfs_super.h3
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.c226
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h14
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h1
-rw-r--r--fs/xfs/xfs_fsops.c5
-rw-r--r--fs/xfs/xfs_iget.c2
-rw-r--r--fs/xfs/xfs_iocore.c4
-rw-r--r--fs/xfs/xfs_mount.c11
-rw-r--r--fs/xfs/xfs_mount.h47
-rw-r--r--fs/xfs/xfs_trans.c4
-rw-r--r--fs/xfs/xfs_vfsops.c16
14 files changed, 39 insertions, 312 deletions
diff --git a/fs/xfs/Makefile-linux-2.6 b/fs/xfs/Makefile-linux-2.6
index 85b0de65bd9b..d1491aa7a0e2 100644
--- a/fs/xfs/Makefile-linux-2.6
+++ b/fs/xfs/Makefile-linux-2.6
@@ -107,7 +107,6 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \
107 xfs_iops.o \ 107 xfs_iops.o \
108 xfs_lrw.o \ 108 xfs_lrw.o \
109 xfs_super.o \ 109 xfs_super.o \
110 xfs_vfs.o \
111 xfs_vnode.o) 110 xfs_vnode.o)
112 111
113# Objects in support/ 112# Objects in support/
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 5b95a7297fd1..5d284403b411 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -621,7 +621,7 @@ xfs_write(
621 io = &xip->i_iocore; 621 io = &xip->i_iocore;
622 mp = io->io_mount; 622 mp = io->io_mount;
623 623
624 vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_WRITE); 624 xfs_wait_for_freeze(mp, SB_FREEZE_WRITE);
625 625
626 if (XFS_FORCED_SHUTDOWN(mp)) 626 if (XFS_FORCED_SHUTDOWN(mp))
627 return -EIO; 627 return -EIO;
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 3ce9426f57d8..a1e3f3ea334b 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -511,7 +511,7 @@ xfs_flush_device_work(
511 void *arg) 511 void *arg)
512{ 512{
513 struct inode *inode = arg; 513 struct inode *inode = arg;
514 sync_blockdev(mp->m_vfsp->vfs_super->s_bdev); 514 sync_blockdev(mp->m_super->s_bdev);
515 iput(inode); 515 iput(inode);
516} 516}
517 517
@@ -593,7 +593,6 @@ STATIC void
593xfs_fs_put_super( 593xfs_fs_put_super(
594 struct super_block *sb) 594 struct super_block *sb)
595{ 595{
596 bhv_vfs_t *vfsp = vfs_from_sb(sb);
597 struct xfs_mount *mp = XFS_M(sb); 596 struct xfs_mount *mp = XFS_M(sb);
598 int error; 597 int error;
599 598
@@ -601,12 +600,8 @@ xfs_fs_put_super(
601 600
602 xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI); 601 xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI);
603 error = xfs_unmount(mp, 0, NULL); 602 error = xfs_unmount(mp, 0, NULL);
604 if (error) { 603 if (error)
605 printk("XFS: unmount got error=%d\n", error); 604 printk("XFS: unmount got error=%d\n", error);
606 printk("%s: vfs=0x%p left dangling!\n", __FUNCTION__, vfsp);
607 } else {
608 vfs_deallocate(vfsp);
609 }
610} 605}
611 606
612STATIC void 607STATIC void
@@ -764,7 +759,6 @@ xfs_fs_fill_super(
764 int silent) 759 int silent)
765{ 760{
766 struct inode *rootvp; 761 struct inode *rootvp;
767 struct bhv_vfs *vfsp = vfs_allocate(sb);
768 struct xfs_mount *mp = NULL; 762 struct xfs_mount *mp = NULL;
769 struct xfs_mount_args *args = xfs_args_allocate(sb, silent); 763 struct xfs_mount_args *args = xfs_args_allocate(sb, silent);
770 struct kstatfs statvfs; 764 struct kstatfs statvfs;
@@ -776,8 +770,8 @@ xfs_fs_fill_super(
776 spin_lock_init(&mp->m_sync_lock); 770 spin_lock_init(&mp->m_sync_lock);
777 init_waitqueue_head(&mp->m_wait_single_sync_task); 771 init_waitqueue_head(&mp->m_wait_single_sync_task);
778 772
779 mp->m_vfsp = vfsp; 773 mp->m_super = sb;
780 vfsp->vfs_mount = mp; 774 sb->s_fs_info = mp;
781 775
782 if (sb->s_flags & MS_RDONLY) 776 if (sb->s_flags & MS_RDONLY)
783 mp->m_flags |= XFS_MOUNT_RDONLY; 777 mp->m_flags |= XFS_MOUNT_RDONLY;
@@ -847,7 +841,6 @@ fail_unmount:
847 xfs_unmount(mp, 0, NULL); 841 xfs_unmount(mp, 0, NULL);
848 842
849fail_vfsop: 843fail_vfsop:
850 vfs_deallocate(vfsp);
851 kmem_free(args, sizeof(*args)); 844 kmem_free(args, sizeof(*args));
852 return -error; 845 return -error;
853} 846}
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h
index 529ada86f2c9..c78c23310fe8 100644
--- a/fs/xfs/linux-2.6/xfs_super.h
+++ b/fs/xfs/linux-2.6/xfs_super.h
@@ -120,7 +120,6 @@ extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
120 120
121extern struct export_operations xfs_export_operations; 121extern struct export_operations xfs_export_operations;
122 122
123#define XFS_M(sb) \ 123#define XFS_M(sb) ((struct xfs_mount *)((sb)->s_fs_info))
124 XFS_VFSTOM(vfs_from_sb(sb))
125 124
126#endif /* __XFS_SUPER_H__ */ 125#endif /* __XFS_SUPER_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_vfs.c b/fs/xfs/linux-2.6/xfs_vfs.c
deleted file mode 100644
index 97ce2eab69b0..000000000000
--- a/fs/xfs/linux-2.6/xfs_vfs.c
+++ /dev/null
@@ -1,226 +0,0 @@
1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#include "xfs.h"
19#include "xfs_fs.h"
20#include "xfs_inum.h"
21#include "xfs_log.h"
22#include "xfs_clnt.h"
23#include "xfs_trans.h"
24#include "xfs_sb.h"
25#include "xfs_ag.h"
26#include "xfs_dir2.h"
27#include "xfs_imap.h"
28#include "xfs_alloc.h"
29#include "xfs_dmapi.h"
30#include "xfs_mount.h"
31#include "xfs_quota.h"
32
33int
34vfs_mount(
35 struct bhv_desc *bdp,
36 struct xfs_mount_args *args,
37 struct cred *cr)
38{
39 struct bhv_desc *next = bdp;
40
41 ASSERT(next);
42 while (! (bhvtovfsops(next))->vfs_mount)
43 next = BHV_NEXT(next);
44 return ((*bhvtovfsops(next)->vfs_mount)(next, args, cr));
45}
46
47int
48vfs_parseargs(
49 struct bhv_desc *bdp,
50 char *s,
51 struct xfs_mount_args *args,
52 int f)
53{
54 struct bhv_desc *next = bdp;
55
56 ASSERT(next);
57 while (! (bhvtovfsops(next))->vfs_parseargs)
58 next = BHV_NEXT(next);
59 return ((*bhvtovfsops(next)->vfs_parseargs)(next, s, args, f));
60}
61
62int
63vfs_showargs(
64 struct bhv_desc *bdp,
65 struct seq_file *m)
66{
67 struct bhv_desc *next = bdp;
68
69 ASSERT(next);
70 while (! (bhvtovfsops(next))->vfs_showargs)
71 next = BHV_NEXT(next);
72 return ((*bhvtovfsops(next)->vfs_showargs)(next, m));
73}
74
75int
76vfs_unmount(
77 struct bhv_desc *bdp,
78 int fl,
79 struct cred *cr)
80{
81 struct bhv_desc *next = bdp;
82
83 ASSERT(next);
84 while (! (bhvtovfsops(next))->vfs_unmount)
85 next = BHV_NEXT(next);
86 return ((*bhvtovfsops(next)->vfs_unmount)(next, fl, cr));
87}
88
89int
90vfs_mntupdate(
91 struct bhv_desc *bdp,
92 int *fl,
93 struct xfs_mount_args *args)
94{
95 struct bhv_desc *next = bdp;
96
97 ASSERT(next);
98 while (! (bhvtovfsops(next))->vfs_mntupdate)
99 next = BHV_NEXT(next);
100 return ((*bhvtovfsops(next)->vfs_mntupdate)(next, fl, args));
101}
102
103int
104vfs_root(
105 struct bhv_desc *bdp,
106 bhv_vnode_t **vpp)
107{
108 struct bhv_desc *next = bdp;
109
110 ASSERT(next);
111 while (! (bhvtovfsops(next))->vfs_root)
112 next = BHV_NEXT(next);
113 return ((*bhvtovfsops(next)->vfs_root)(next, vpp));
114}
115
116int
117vfs_statvfs(
118 struct bhv_desc *bdp,
119 bhv_statvfs_t *statp,
120 bhv_vnode_t *vp)
121{
122 struct bhv_desc *next = bdp;
123
124 ASSERT(next);
125 while (! (bhvtovfsops(next))->vfs_statvfs)
126 next = BHV_NEXT(next);
127 return ((*bhvtovfsops(next)->vfs_statvfs)(next, statp, vp));
128}
129
130int
131vfs_sync(
132 struct bhv_desc *bdp,
133 int fl,
134 struct cred *cr)
135{
136 struct bhv_desc *next = bdp;
137
138 ASSERT(next);
139 while (! (bhvtovfsops(next))->vfs_sync)
140 next = BHV_NEXT(next);
141 return ((*bhvtovfsops(next)->vfs_sync)(next, fl, cr));
142}
143
144int
145vfs_vget(
146 struct bhv_desc *bdp,
147 bhv_vnode_t **vpp,
148 struct fid *fidp)
149{
150 struct bhv_desc *next = bdp;
151
152 ASSERT(next);
153 while (! (bhvtovfsops(next))->vfs_vget)
154 next = BHV_NEXT(next);
155 return ((*bhvtovfsops(next)->vfs_vget)(next, vpp, fidp));
156}
157
158void
159vfs_init_vnode(
160 struct bhv_desc *bdp,
161 bhv_vnode_t *vp,
162 struct xfs_inode *ip,
163 int unlock)
164{
165 struct bhv_desc *next = bdp;
166
167 ASSERT(next);
168 while (! (bhvtovfsops(next))->vfs_init_vnode)
169 next = BHV_NEXT(next);
170 ((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, ip, unlock));
171}
172
173void
174vfs_force_shutdown(
175 struct bhv_desc *bdp,
176 int fl,
177 char *file,
178 int line)
179{
180 struct bhv_desc *next = bdp;
181
182 ASSERT(next);
183 while (! (bhvtovfsops(next))->vfs_force_shutdown)
184 next = BHV_NEXT(next);
185 ((*bhvtovfsops(next)->vfs_force_shutdown)(next, fl, file, line));
186}
187
188void
189vfs_freeze(
190 struct bhv_desc *bdp)
191{
192 struct bhv_desc *next = bdp;
193
194 ASSERT(next);
195 while (! (bhvtovfsops(next))->vfs_freeze)
196 next = BHV_NEXT(next);
197 ((*bhvtovfsops(next)->vfs_freeze)(next));
198}
199
200bhv_vfs_t *
201vfs_allocate(
202 struct super_block *sb)
203{
204 struct bhv_vfs *vfsp;
205
206 vfsp = kmem_zalloc(sizeof(bhv_vfs_t), KM_SLEEP);
207
208 vfsp->vfs_super = sb;
209 sb->s_fs_info = vfsp;
210
211 return vfsp;
212}
213
214bhv_vfs_t *
215vfs_from_sb(
216 struct super_block *sb)
217{
218 return (bhv_vfs_t *)sb->s_fs_info;
219}
220
221void
222vfs_deallocate(
223 struct bhv_vfs *vfsp)
224{
225 kmem_free(vfsp, sizeof(bhv_vfs_t));
226}
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index 51906192e70a..4da03a4e3520 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -21,7 +21,6 @@
21#include <linux/vfs.h> 21#include <linux/vfs.h>
22#include "xfs_fs.h" 22#include "xfs_fs.h"
23 23
24struct bhv_vfs;
25struct inode; 24struct inode;
26 25
27struct fid; 26struct fid;
@@ -41,11 +40,6 @@ typedef struct bhv_vfs_sync_work {
41 void (*w_syncer)(struct xfs_mount *, void *); 40 void (*w_syncer)(struct xfs_mount *, void *);
42} bhv_vfs_sync_work_t; 41} bhv_vfs_sync_work_t;
43 42
44typedef struct bhv_vfs {
45 struct xfs_mount *vfs_mount;
46 struct super_block *vfs_super; /* generic superblock pointer */
47} bhv_vfs_t;
48
49#define SYNC_ATTR 0x0001 /* sync attributes */ 43#define SYNC_ATTR 0x0001 /* sync attributes */
50#define SYNC_CLOSE 0x0002 /* close file system down */ 44#define SYNC_CLOSE 0x0002 /* close file system down */
51#define SYNC_DELWRI 0x0004 /* look at delayed writes */ 45#define SYNC_DELWRI 0x0004 /* look at delayed writes */
@@ -78,11 +72,7 @@ typedef struct bhv_vfs {
78#define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */ 72#define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */
79#define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */ 73#define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */
80 74
81#define vfs_test_for_freeze(vfs) ((vfs)->vfs_super->s_frozen) 75#define xfs_test_for_freeze(mp) ((mp)->m_super->s_frozen)
82#define vfs_wait_for_freeze(vfs,l) vfs_check_frozen((vfs)->vfs_super, (l)) 76#define xfs_wait_for_freeze(mp,l) vfs_check_frozen((mp)->m_super, (l))
83
84extern bhv_vfs_t *vfs_allocate(struct super_block *);
85extern bhv_vfs_t *vfs_from_sb(struct super_block *);
86extern void vfs_deallocate(bhv_vfs_t *);
87 77
88#endif /* __XFS_VFS_H__ */ 78#endif /* __XFS_VFS_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 4682c617f3a4..55fb46948589 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -19,7 +19,6 @@
19#define __XFS_VNODE_H__ 19#define __XFS_VNODE_H__
20 20
21struct file; 21struct file;
22struct bhv_vfs;
23struct bhv_vattr; 22struct bhv_vattr;
24struct xfs_iomap; 23struct xfs_iomap;
25struct attrlist_cursor_kern; 24struct attrlist_cursor_kern;
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 3d27909770ea..94bd9f2d9d77 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -174,7 +174,7 @@ xfs_growfs_data_private(
174 memset(&mp->m_perag[oagcount], 0, 174 memset(&mp->m_perag[oagcount], 0,
175 (nagcount - oagcount) * sizeof(xfs_perag_t)); 175 (nagcount - oagcount) * sizeof(xfs_perag_t));
176 mp->m_flags |= XFS_MOUNT_32BITINODES; 176 mp->m_flags |= XFS_MOUNT_32BITINODES;
177 nagimax = xfs_initialize_perag(XFS_MTOVFS(mp), mp, nagcount); 177 nagimax = xfs_initialize_perag(mp, nagcount);
178 up_write(&mp->m_peraglock); 178 up_write(&mp->m_peraglock);
179 } 179 }
180 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); 180 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS);
@@ -626,8 +626,7 @@ xfs_fs_goingdown(
626{ 626{
627 switch (inflags) { 627 switch (inflags) {
628 case XFS_FSOP_GOING_FLAGS_DEFAULT: { 628 case XFS_FSOP_GOING_FLAGS_DEFAULT: {
629 struct bhv_vfs *vfsp = XFS_MTOVFS(mp); 629 struct super_block *sb = freeze_bdev(mp->m_super->s_bdev);
630 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev);
631 630
632 if (sb && !IS_ERR(sb)) { 631 if (sb && !IS_ERR(sb)) {
633 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); 632 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT);
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 772bbc7a8ac9..488836e204a3 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -369,7 +369,7 @@ xfs_iget(
369 XFS_STATS_INC(xs_ig_attempts); 369 XFS_STATS_INC(xs_ig_attempts);
370 370
371retry: 371retry:
372 inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino); 372 inode = iget_locked(mp->m_super, ino);
373 if (inode) { 373 if (inode) {
374 xfs_inode_t *ip; 374 xfs_inode_t *ip;
375 375
diff --git a/fs/xfs/xfs_iocore.c b/fs/xfs/xfs_iocore.c
index 81548ec72ba6..b27b5d5be841 100644
--- a/fs/xfs/xfs_iocore.c
+++ b/fs/xfs/xfs_iocore.c
@@ -57,11 +57,11 @@ xfs_size_fn(
57 57
58STATIC int 58STATIC int
59xfs_ioinit( 59xfs_ioinit(
60 struct bhv_vfs *vfsp, 60 struct xfs_mount *mp,
61 struct xfs_mount_args *mntargs, 61 struct xfs_mount_args *mntargs,
62 int flags) 62 int flags)
63{ 63{
64 return xfs_mountfs(vfsp, XFS_VFSTOM(vfsp), flags); 64 return xfs_mountfs(mp, flags);
65} 65}
66 66
67xfs_ioops_t xfs_iocore_xfs = { 67xfs_ioops_t xfs_iocore_xfs = {
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 6b1aa7d6f434..ba8df2f0dd4f 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -341,7 +341,6 @@ xfs_initialize_perag_icache(
341 341
342xfs_agnumber_t 342xfs_agnumber_t
343xfs_initialize_perag( 343xfs_initialize_perag(
344 bhv_vfs_t *vfs,
345 xfs_mount_t *mp, 344 xfs_mount_t *mp,
346 xfs_agnumber_t agcount) 345 xfs_agnumber_t agcount)
347{ 346{
@@ -748,7 +747,6 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount)
748 */ 747 */
749int 748int
750xfs_mountfs( 749xfs_mountfs(
751 bhv_vfs_t *vfsp,
752 xfs_mount_t *mp, 750 xfs_mount_t *mp,
753 int mfsi_flags) 751 int mfsi_flags)
754{ 752{
@@ -1025,7 +1023,7 @@ xfs_mountfs(
1025 mp->m_perag = 1023 mp->m_perag =
1026 kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP); 1024 kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP);
1027 1025
1028 mp->m_maxagi = xfs_initialize_perag(vfsp, mp, sbp->sb_agcount); 1026 mp->m_maxagi = xfs_initialize_perag(mp, sbp->sb_agcount);
1029 1027
1030 /* 1028 /*
1031 * log's mount-time initialization. Perform 1st part recovery if needed 1029 * log's mount-time initialization. Perform 1st part recovery if needed
@@ -1192,7 +1190,6 @@ xfs_mountfs(
1192int 1190int
1193xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) 1191xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1194{ 1192{
1195 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
1196 __uint64_t resblks; 1193 __uint64_t resblks;
1197 1194
1198 /* 1195 /*
@@ -1258,7 +1255,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1258#if defined(DEBUG) || defined(INDUCE_IO_ERROR) 1255#if defined(DEBUG) || defined(INDUCE_IO_ERROR)
1259 xfs_errortag_clearall(mp, 0); 1256 xfs_errortag_clearall(mp, 0);
1260#endif 1257#endif
1261 XFS_IODONE(vfsp); 1258 XFS_IODONE(mp);
1262 xfs_mount_free(mp); 1259 xfs_mount_free(mp);
1263 return 0; 1260 return 0;
1264} 1261}
@@ -1286,9 +1283,7 @@ xfs_unmountfs_wait(xfs_mount_t *mp)
1286int 1283int
1287xfs_fs_writable(xfs_mount_t *mp) 1284xfs_fs_writable(xfs_mount_t *mp)
1288{ 1285{
1289 bhv_vfs_t *vfsp = XFS_MTOVFS(mp); 1286 return !(xfs_test_for_freeze(mp) || XFS_FORCED_SHUTDOWN(mp) ||
1290
1291 return !(vfs_test_for_freeze(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
1292 (mp->m_flags & XFS_MOUNT_RDONLY)); 1287 (mp->m_flags & XFS_MOUNT_RDONLY));
1293} 1288}
1294 1289
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 94f73c523e5f..7f671f8269b4 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -54,7 +54,6 @@ typedef struct xfs_trans_reservations {
54#else 54#else
55struct cred; 55struct cred;
56struct log; 56struct log;
57struct bhv_vfs;
58struct xfs_mount_args; 57struct xfs_mount_args;
59struct xfs_inode; 58struct xfs_inode;
60struct xfs_iocore; 59struct xfs_iocore;
@@ -79,13 +78,13 @@ typedef int (*xfs_send_data_t)(int, bhv_vnode_t *,
79 xfs_off_t, size_t, int, bhv_vrwlock_t *); 78 xfs_off_t, size_t, int, bhv_vrwlock_t *);
80typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); 79typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
81typedef int (*xfs_send_destroy_t)(bhv_vnode_t *, dm_right_t); 80typedef int (*xfs_send_destroy_t)(bhv_vnode_t *, dm_right_t);
82typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct bhv_vfs *, 81typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *,
83 bhv_vnode_t *, 82 bhv_vnode_t *,
84 dm_right_t, bhv_vnode_t *, dm_right_t, 83 dm_right_t, bhv_vnode_t *, dm_right_t,
85 char *, char *, mode_t, int, int); 84 char *, char *, mode_t, int, int);
86typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t, 85typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t,
87 char *, char *); 86 char *, char *);
88typedef void (*xfs_send_unmount_t)(struct bhv_vfs *, bhv_vnode_t *, 87typedef void (*xfs_send_unmount_t)(struct xfs_mount *, bhv_vnode_t *,
89 dm_right_t, mode_t, int, int); 88 dm_right_t, mode_t, int, int);
90 89
91typedef struct xfs_dmops { 90typedef struct xfs_dmops {
@@ -105,12 +104,12 @@ typedef struct xfs_dmops {
105 (*(mp)->m_dm_ops->xfs_send_destroy)(vp,right) 104 (*(mp)->m_dm_ops->xfs_send_destroy)(vp,right)
106#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ 105#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
107 (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) 106 (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl)
108#define XFS_SEND_PREUNMOUNT(mp, vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ 107#define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
109 (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) 108 (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r2,n1,n2,mode,rval,fl)
110#define XFS_SEND_MOUNT(mp,right,path,name) \ 109#define XFS_SEND_MOUNT(mp,right,path,name) \
111 (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name) 110 (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name)
112#define XFS_SEND_UNMOUNT(mp, vfsp,vp,right,mode,rval,fl) \ 111#define XFS_SEND_UNMOUNT(mp, vp,right,mode,rval,fl) \
113 (*(mp)->m_dm_ops->xfs_send_unmount)(vfsp,vp,right,mode,rval,fl) 112 (*(mp)->m_dm_ops->xfs_send_unmount)(mp,vp,right,mode,rval,fl)
114 113
115 114
116/* 115/*
@@ -202,7 +201,7 @@ typedef struct xfs_qmops {
202 * Prototypes and functions for I/O core modularization. 201 * Prototypes and functions for I/O core modularization.
203 */ 202 */
204 203
205typedef int (*xfs_ioinit_t)(struct bhv_vfs *, 204typedef int (*xfs_ioinit_t)(struct xfs_mount *,
206 struct xfs_mount_args *, int); 205 struct xfs_mount_args *, int);
207typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *, 206typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *,
208 xfs_fileoff_t, xfs_filblks_t, int, 207 xfs_fileoff_t, xfs_filblks_t, int,
@@ -232,7 +231,7 @@ typedef void (*xfs_lock_demote_t)(void *, uint);
232typedef int (*xfs_lock_nowait_t)(void *, uint); 231typedef int (*xfs_lock_nowait_t)(void *, uint);
233typedef void (*xfs_unlk_t)(void *, unsigned int); 232typedef void (*xfs_unlk_t)(void *, unsigned int);
234typedef xfs_fsize_t (*xfs_size_t)(void *); 233typedef xfs_fsize_t (*xfs_size_t)(void *);
235typedef xfs_fsize_t (*xfs_iodone_t)(struct bhv_vfs *); 234typedef xfs_fsize_t (*xfs_iodone_t)(struct xfs_mount *);
236typedef int (*xfs_swap_extents_t)(void *, void *, 235typedef int (*xfs_swap_extents_t)(void *, void *,
237 struct xfs_swapext*); 236 struct xfs_swapext*);
238 237
@@ -255,8 +254,8 @@ typedef struct xfs_ioops {
255 xfs_swap_extents_t xfs_swap_extents_func; 254 xfs_swap_extents_t xfs_swap_extents_func;
256} xfs_ioops_t; 255} xfs_ioops_t;
257 256
258#define XFS_IOINIT(vfsp, args, flags) \ 257#define XFS_IOINIT(mp, args, flags) \
259 (*(mp)->m_io_ops.xfs_ioinit)(vfsp, args, flags) 258 (*(mp)->m_io_ops.xfs_ioinit)(mp, args, flags)
260#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \ 259#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \
261 (*(mp)->m_io_ops.xfs_bmapi_func) \ 260 (*(mp)->m_io_ops.xfs_bmapi_func) \
262 (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta) 261 (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta)
@@ -290,8 +289,8 @@ typedef struct xfs_ioops {
290 (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode) 289 (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode)
291#define XFS_SIZE(mp, io) \ 290#define XFS_SIZE(mp, io) \
292 (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj) 291 (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
293#define XFS_IODONE(vfsp) \ 292#define XFS_IODONE(mp) \
294 (*(mp)->m_io_ops.xfs_iodone)(vfsp) 293 (*(mp)->m_io_ops.xfs_iodone)(mp)
295#define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \ 294#define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \
296 (*(mp)->m_io_ops.xfs_swap_extents_func) \ 295 (*(mp)->m_io_ops.xfs_swap_extents_func) \
297 ((io)->io_obj, (tio)->io_obj, sxp) 296 ((io)->io_obj, (tio)->io_obj, sxp)
@@ -328,7 +327,7 @@ extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int);
328#endif 327#endif
329 328
330typedef struct xfs_mount { 329typedef struct xfs_mount {
331 struct bhv_vfs *m_vfsp; 330 struct super_block *m_super;
332 xfs_tid_t m_tid; /* next unused tid for fs */ 331 xfs_tid_t m_tid; /* next unused tid for fs */
333 AIL_LOCK_T m_ail_lock; /* fs AIL mutex */ 332 AIL_LOCK_T m_ail_lock; /* fs AIL mutex */
334 xfs_ail_entry_t m_ail; /* fs active log item list */ 333 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/* XFS_MFSI_CONVERT_SUNIT */ 547/* XFS_MFSI_CONVERT_SUNIT */
549#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */ 548#define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */
550 549
551/*
552 * Macros for getting from mount to vfs and back.
553 */
554#define XFS_MTOVFS(mp) xfs_mtovfs(mp)
555static inline struct bhv_vfs *xfs_mtovfs(xfs_mount_t *mp)
556{
557 return mp->m_vfsp;
558}
559
560#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
561static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
562{
563 return vfs->vfs_mount;
564}
565
566#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) 550#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d)
567static inline xfs_agnumber_t 551static inline xfs_agnumber_t
568xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d) 552xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d)
@@ -633,7 +617,7 @@ extern xfs_mount_t *xfs_mount_init(void);
633extern void xfs_mod_sb(xfs_trans_t *, __int64_t); 617extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
634extern int xfs_log_sbcount(xfs_mount_t *, uint); 618extern int xfs_log_sbcount(xfs_mount_t *, uint);
635extern void xfs_mount_free(xfs_mount_t *mp); 619extern void xfs_mount_free(xfs_mount_t *mp);
636extern int xfs_mountfs(struct bhv_vfs *, xfs_mount_t *mp, int); 620extern int xfs_mountfs(xfs_mount_t *mp, int);
637extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); 621extern void xfs_mountfs_check_barriers(xfs_mount_t *mp);
638 622
639extern int xfs_unmountfs(xfs_mount_t *, struct cred *); 623extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
@@ -651,8 +635,7 @@ extern void xfs_freesb(xfs_mount_t *);
651extern int xfs_fs_writable(xfs_mount_t *); 635extern int xfs_fs_writable(xfs_mount_t *);
652extern int xfs_syncsub(xfs_mount_t *, int, int *); 636extern int xfs_syncsub(xfs_mount_t *, int, int *);
653extern int xfs_sync_inodes(xfs_mount_t *, int, int *); 637extern int xfs_sync_inodes(xfs_mount_t *, int, int *);
654extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *, 638extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t);
655 xfs_agnumber_t);
656extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); 639extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *);
657extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); 640extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t);
658extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); 641extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t);
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 668996aae36d..8878322ee793 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -234,7 +234,7 @@ xfs_trans_alloc(
234 xfs_mount_t *mp, 234 xfs_mount_t *mp,
235 uint type) 235 uint type)
236{ 236{
237 vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_TRANS); 237 xfs_wait_for_freeze(mp, SB_FREEZE_TRANS);
238 return _xfs_trans_alloc(mp, type); 238 return _xfs_trans_alloc(mp, type);
239} 239}
240 240
@@ -628,7 +628,7 @@ xfs_trans_apply_sb_deltas(
628 offsetof(xfs_dsb_t, sb_frextents) + 628 offsetof(xfs_dsb_t, sb_frextents) +
629 sizeof(sbp->sb_frextents) - 1); 629 sizeof(sbp->sb_frextents) - 1);
630 630
631 XFS_MTOVFS(tp->t_mountp)->vfs_super->s_dirt = 1; 631 tp->t_mountp->m_super->s_dirt = 1;
632} 632}
633 633
634/* 634/*
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index febfd8367e13..3bba1a6aba8b 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -211,7 +211,6 @@ xfs_cleanup(void)
211 */ 211 */
212STATIC int 212STATIC int
213xfs_start_flags( 213xfs_start_flags(
214 struct bhv_vfs *vfs,
215 struct xfs_mount_args *ap, 214 struct xfs_mount_args *ap,
216 struct xfs_mount *mp) 215 struct xfs_mount *mp)
217{ 216{
@@ -336,7 +335,6 @@ xfs_start_flags(
336 */ 335 */
337STATIC int 336STATIC int
338xfs_finish_flags( 337xfs_finish_flags(
339 struct bhv_vfs *vfs,
340 struct xfs_mount_args *ap, 338 struct xfs_mount_args *ap,
341 struct xfs_mount *mp) 339 struct xfs_mount *mp)
342{ 340{
@@ -438,11 +436,10 @@ xfs_mount(
438 struct xfs_mount_args *args, 436 struct xfs_mount_args *args,
439 cred_t *credp) 437 cred_t *credp)
440{ 438{
441 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
442 struct block_device *ddev, *logdev, *rtdev; 439 struct block_device *ddev, *logdev, *rtdev;
443 int flags = 0, error; 440 int flags = 0, error;
444 441
445 ddev = vfsp->vfs_super->s_bdev; 442 ddev = mp->m_super->s_bdev;
446 logdev = rtdev = NULL; 443 logdev = rtdev = NULL;
447 444
448 error = xfs_dmops_get(mp, args); 445 error = xfs_dmops_get(mp, args);
@@ -510,13 +507,13 @@ xfs_mount(
510 /* 507 /*
511 * Setup flags based on mount(2) options and then the superblock 508 * Setup flags based on mount(2) options and then the superblock
512 */ 509 */
513 error = xfs_start_flags(vfsp, args, mp); 510 error = xfs_start_flags(args, mp);
514 if (error) 511 if (error)
515 goto error1; 512 goto error1;
516 error = xfs_readsb(mp, flags); 513 error = xfs_readsb(mp, flags);
517 if (error) 514 if (error)
518 goto error1; 515 goto error1;
519 error = xfs_finish_flags(vfsp, args, mp); 516 error = xfs_finish_flags(args, mp);
520 if (error) 517 if (error)
521 goto error2; 518 goto error2;
522 519
@@ -547,7 +544,7 @@ xfs_mount(
547 if ((error = xfs_filestream_mount(mp))) 544 if ((error = xfs_filestream_mount(mp)))
548 goto error2; 545 goto error2;
549 546
550 error = XFS_IOINIT(vfsp, args, flags); 547 error = XFS_IOINIT(mp, args, flags);
551 if (error) 548 if (error)
552 goto error2; 549 goto error2;
553 550
@@ -577,7 +574,6 @@ xfs_unmount(
577 int flags, 574 int flags,
578 cred_t *credp) 575 cred_t *credp)
579{ 576{
580 bhv_vfs_t *vfsp = XFS_MTOVFS(mp);
581 xfs_inode_t *rip; 577 xfs_inode_t *rip;
582 bhv_vnode_t *rvp; 578 bhv_vnode_t *rvp;
583 int unmount_event_wanted = 0; 579 int unmount_event_wanted = 0;
@@ -590,7 +586,7 @@ xfs_unmount(
590 586
591#ifdef HAVE_DMAPI 587#ifdef HAVE_DMAPI
592 if (mp->m_flags & XFS_MOUNT_DMAPI) { 588 if (mp->m_flags & XFS_MOUNT_DMAPI) {
593 error = XFS_SEND_PREUNMOUNT(mp, vfsp, 589 error = XFS_SEND_PREUNMOUNT(mp,
594 rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, 590 rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
595 NULL, NULL, 0, 0, 591 NULL, NULL, 0, 0,
596 (mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))? 592 (mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))?
@@ -647,7 +643,7 @@ out:
647 /* Note: mp structure must still exist for 643 /* Note: mp structure must still exist for
648 * XFS_SEND_UNMOUNT() call. 644 * XFS_SEND_UNMOUNT() call.
649 */ 645 */
650 XFS_SEND_UNMOUNT(mp, vfsp, error == 0 ? rvp : NULL, 646 XFS_SEND_UNMOUNT(mp, error == 0 ? rvp : NULL,
651 DM_RIGHT_NULL, 0, error, unmount_event_flags); 647 DM_RIGHT_NULL, 0, error, unmount_event_flags);
652 } 648 }
653 if (xfs_unmountfs_needed) { 649 if (xfs_unmountfs_needed) {