aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
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/linux-2.6
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/linux-2.6')
-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
6 files changed, 8 insertions, 253 deletions
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;