Deleted Added
full compact
ext2_vfsops.c (132805) ext2_vfsops.c (132902)
1/*
2 * modified for EXT2FS support in Lites 1.1
3 *
4 * Aug 1995, Godmar Back (gback@cs.utah.edu)
5 * University of Utah, Department of Computer Science
6 */
7/*
8 * Copyright (c) 1989, 1991, 1993, 1994

--- 19 unchanged lines hidden (view full) ---

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94
1/*
2 * modified for EXT2FS support in Lites 1.1
3 *
4 * Aug 1995, Godmar Back (gback@cs.utah.edu)
5 * University of Utah, Department of Computer Science
6 */
7/*
8 * Copyright (c) 1989, 1991, 1993, 1994

--- 19 unchanged lines hidden (view full) ---

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94
36 * $FreeBSD: head/sys/gnu/fs/ext2fs/ext2_vfsops.c 132805 2004-07-28 20:21:04Z phk $
36 * $FreeBSD: head/sys/gnu/fs/ext2fs/ext2_vfsops.c 132902 2004-07-30 22:08:52Z phk $
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/namei.h>
42#include <sys/proc.h>
43#include <sys/kernel.h>
44#include <sys/vnode.h>

--- 23 unchanged lines hidden (view full) ---

68static vfs_root_t ext2_root;
69static vfs_statfs_t ext2_statfs;
70static vfs_sync_t ext2_sync;
71static vfs_vget_t ext2_vget;
72static vfs_fhtovp_t ext2_fhtovp;
73static vfs_vptofh_t ext2_vptofh;
74static vfs_init_t ext2_init;
75static vfs_uninit_t ext2_uninit;
37 */
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/namei.h>
42#include <sys/proc.h>
43#include <sys/kernel.h>
44#include <sys/vnode.h>

--- 23 unchanged lines hidden (view full) ---

68static vfs_root_t ext2_root;
69static vfs_statfs_t ext2_statfs;
70static vfs_sync_t ext2_sync;
71static vfs_vget_t ext2_vget;
72static vfs_fhtovp_t ext2_fhtovp;
73static vfs_vptofh_t ext2_vptofh;
74static vfs_init_t ext2_init;
75static vfs_uninit_t ext2_uninit;
76static vfs_nmount_t ext2_mount;
76static vfs_mount_t ext2_mount;
77
78MALLOC_DEFINE(M_EXT2NODE, "EXT2 node", "EXT2 vnode private part");
79static MALLOC_DEFINE(M_EXT2MNT, "EXT2 mount", "EXT2 mount structure");
80
81static struct vfsops ext2fs_vfsops = {
82 .vfs_fhtovp = ext2_fhtovp,
83 .vfs_init = ext2_init,
77
78MALLOC_DEFINE(M_EXT2NODE, "EXT2 node", "EXT2 vnode private part");
79static MALLOC_DEFINE(M_EXT2MNT, "EXT2 mount", "EXT2 mount structure");
80
81static struct vfsops ext2fs_vfsops = {
82 .vfs_fhtovp = ext2_fhtovp,
83 .vfs_init = ext2_init,
84 .vfs_nmount = ext2_mount,
84 .vfs_mount = ext2_mount,
85 .vfs_root = ext2_root, /* root inode via vget */
86 .vfs_statfs = ext2_statfs,
87 .vfs_sync = ext2_sync,
88 .vfs_uninit = ext2_uninit,
89 .vfs_unmount = ext2_unmount,
90 .vfs_vget = ext2_vget,
91 .vfs_vptofh = ext2_vptofh,
92};

--- 68 unchanged lines hidden (view full) ---

161#endif
162
163/*
164 * VFS Operations.
165 *
166 * mount system call
167 */
168static int
85 .vfs_root = ext2_root, /* root inode via vget */
86 .vfs_statfs = ext2_statfs,
87 .vfs_sync = ext2_sync,
88 .vfs_uninit = ext2_uninit,
89 .vfs_unmount = ext2_unmount,
90 .vfs_vget = ext2_vget,
91 .vfs_vptofh = ext2_vptofh,
92};

--- 68 unchanged lines hidden (view full) ---

161#endif
162
163/*
164 * VFS Operations.
165 *
166 * mount system call
167 */
168static int
169ext2_mount(mp, ndp, td)
169ext2_mount(mp, td)
170 struct mount *mp;
170 struct mount *mp;
171 struct nameidata *ndp;
172 struct thread *td;
173{
174 struct export_args *export;
175 struct vfsoptlist *opts;
176 struct vnode *devvp;
177 struct ext2mount *ump = 0;
178 struct ext2_sb_info *fs;
179 char *path, *fspec;
180 size_t size;
181 int error, flags, len;
182 mode_t accessmode;
171 struct thread *td;
172{
173 struct export_args *export;
174 struct vfsoptlist *opts;
175 struct vnode *devvp;
176 struct ext2mount *ump = 0;
177 struct ext2_sb_info *fs;
178 char *path, *fspec;
179 size_t size;
180 int error, flags, len;
181 mode_t accessmode;
182 struct nameidata nd, *ndp = &nd;
183
184 opts = mp->mnt_optnew;
185
186 vfs_getopt(opts, "fspath", (void **)&path, NULL);
187 /* Double-check the length of path.. */
188 if (strlen(path) >= MAXMNTLEN - 1)
189 return (ENAMETOOLONG);
190

--- 20 unchanged lines hidden (view full) ---

211 vfs_unbusy(mp, td);
212 if (!error && fs->s_wasvalid) {
213 fs->s_es->s_state |= EXT2_VALID_FS;
214 ext2_sbupdate(ump, MNT_WAIT);
215 }
216 fs->s_rd_only = 1;
217 }
218 if (!error && (mp->mnt_flag & MNT_RELOAD))
183
184 opts = mp->mnt_optnew;
185
186 vfs_getopt(opts, "fspath", (void **)&path, NULL);
187 /* Double-check the length of path.. */
188 if (strlen(path) >= MAXMNTLEN - 1)
189 return (ENAMETOOLONG);
190

--- 20 unchanged lines hidden (view full) ---

211 vfs_unbusy(mp, td);
212 if (!error && fs->s_wasvalid) {
213 fs->s_es->s_state |= EXT2_VALID_FS;
214 ext2_sbupdate(ump, MNT_WAIT);
215 }
216 fs->s_rd_only = 1;
217 }
218 if (!error && (mp->mnt_flag & MNT_RELOAD))
219 error = ext2_reload(mp, ndp->ni_cnd.cn_cred, td);
219 error = ext2_reload(mp, td->td_ucred, td);
220 if (error)
221 return (error);
222 devvp = ump->um_devvp;
223 if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev,
224 (mp->mnt_kern_flag & MNTK_WANTRDWR) == 0) != 0)
225 return (EPERM);
226 if (fs->s_rd_only && (mp->mnt_kern_flag & MNTK_WANTRDWR)) {
227 /*

--- 1021 unchanged lines hidden ---
220 if (error)
221 return (error);
222 devvp = ump->um_devvp;
223 if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev,
224 (mp->mnt_kern_flag & MNTK_WANTRDWR) == 0) != 0)
225 return (EPERM);
226 if (fs->s_rd_only && (mp->mnt_kern_flag & MNTK_WANTRDWR)) {
227 /*

--- 1021 unchanged lines hidden ---