2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
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.
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.
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
23 #include "xfs_trans.h"
28 #include "xfs_alloc.h"
29 #include "xfs_dmapi.h"
30 #include "xfs_mount.h"
31 #include "xfs_quota.h"
36 struct xfs_mount_args *args,
39 struct bhv_desc *next = bdp;
42 while (! (bhvtovfsops(next))->vfs_mount)
43 next = BHV_NEXT(next);
44 return ((*bhvtovfsops(next)->vfs_mount)(next, args, cr));
51 struct xfs_mount_args *args,
54 struct bhv_desc *next = bdp;
57 while (! (bhvtovfsops(next))->vfs_parseargs)
58 next = BHV_NEXT(next);
59 return ((*bhvtovfsops(next)->vfs_parseargs)(next, s, args, f));
67 struct bhv_desc *next = bdp;
70 while (! (bhvtovfsops(next))->vfs_showargs)
71 next = BHV_NEXT(next);
72 return ((*bhvtovfsops(next)->vfs_showargs)(next, m));
81 struct bhv_desc *next = bdp;
84 while (! (bhvtovfsops(next))->vfs_unmount)
85 next = BHV_NEXT(next);
86 return ((*bhvtovfsops(next)->vfs_unmount)(next, fl, cr));
93 struct xfs_mount_args *args)
95 struct bhv_desc *next = bdp;
98 while (! (bhvtovfsops(next))->vfs_mntupdate)
99 next = BHV_NEXT(next);
100 return ((*bhvtovfsops(next)->vfs_mntupdate)(next, fl, args));
105 struct bhv_desc *bdp,
108 struct bhv_desc *next = bdp;
111 while (! (bhvtovfsops(next))->vfs_root)
112 next = BHV_NEXT(next);
113 return ((*bhvtovfsops(next)->vfs_root)(next, vpp));
118 struct bhv_desc *bdp,
119 bhv_statvfs_t *statp,
122 struct bhv_desc *next = bdp;
125 while (! (bhvtovfsops(next))->vfs_statvfs)
126 next = BHV_NEXT(next);
127 return ((*bhvtovfsops(next)->vfs_statvfs)(next, statp, vp));
132 struct bhv_desc *bdp,
136 struct bhv_desc *next = bdp;
139 while (! (bhvtovfsops(next))->vfs_sync)
140 next = BHV_NEXT(next);
141 return ((*bhvtovfsops(next)->vfs_sync)(next, fl, cr));
146 struct bhv_desc *bdp,
150 struct bhv_desc *next = bdp;
153 while (! (bhvtovfsops(next))->vfs_vget)
154 next = BHV_NEXT(next);
155 return ((*bhvtovfsops(next)->vfs_vget)(next, vpp, fidp));
160 struct bhv_desc *bdp,
162 struct xfs_inode *ip,
165 struct bhv_desc *next = bdp;
168 while (! (bhvtovfsops(next))->vfs_init_vnode)
169 next = BHV_NEXT(next);
170 ((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, ip, unlock));
175 struct bhv_desc *bdp,
180 struct bhv_desc *next = bdp;
183 while (! (bhvtovfsops(next))->vfs_force_shutdown)
184 next = BHV_NEXT(next);
185 ((*bhvtovfsops(next)->vfs_force_shutdown)(next, fl, file, line));
190 struct bhv_desc *bdp)
192 struct bhv_desc *next = bdp;
195 while (! (bhvtovfsops(next))->vfs_freeze)
196 next = BHV_NEXT(next);
197 ((*bhvtovfsops(next)->vfs_freeze)(next));
202 struct super_block *sb)
204 struct bhv_vfs *vfsp;
206 vfsp = kmem_zalloc(sizeof(bhv_vfs_t), KM_SLEEP);
207 INIT_LIST_HEAD(&vfsp->vfs_sync_list);
208 spin_lock_init(&vfsp->vfs_sync_lock);
209 init_waitqueue_head(&vfsp->vfs_wait_single_sync_task);
211 vfsp->vfs_super = sb;
212 sb->s_fs_info = vfsp;
219 struct super_block *sb)
221 return (bhv_vfs_t *)sb->s_fs_info;
226 struct bhv_vfs *vfsp)
228 kmem_free(vfsp, sizeof(bhv_vfs_t));