* Copyright (c) 1989 The Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* @(#)mfs_vfsops.c 7.2 (Berkeley) %G%
#include "../ufs/ufsmount.h"
#include "../ufs/inode.h"
extern struct vnodeops mfs_vnodeops
;
struct vfsops mfs_vfsops
= {
mfs_mount(mp
, path
, data
, ndp
)
if (error
= copyin(data
, (caddr_t
)&args
, sizeof (struct mfs_args
)))
if ((error
= bdevvp(NODEV
, &devvp
)) != 0)
devvp
->v_op
= &mfs_vnodeops
;
devvp
->v_rdev
= makedev(255, mfs_minor
++);
VTOI(devvp
)->i_diroff
= (long)args
.base
;
VTOI(devvp
)->i_endoff
= args
.size
;
error
= mountfs(devvp
, mp
);
(void) copyinstr(path
, fs
->fs_fsmnt
, sizeof(fs
->fs_fsmnt
) - 1, &size
);
bzero(fs
->fs_fsmnt
+ size
, sizeof(fs
->fs_fsmnt
) - size
);
(void) copyinstr(args
.name
, ump
->um_mntname
, MNAMELEN
- 1, &size
);
bzero(ump
->um_mntname
+ size
, MNAMELEN
- size
);
* Used to grab the process and keep it in the kernel to service
* memory filesystem I/O requests.
* Loop servicing I/O requests.
* Copy the requested data into or out of the memory filesystem
register struct vnode
*vp
= VFSTOUFS(mp
)->um_devvp
;
register struct inode
*ip
= VTOI(vp
);
sleep((caddr_t
)vp
, PRIBIO
);
base
= (caddr_t
)ip
->i_diroff
;
while (bp
= (struct buf
*)ip
->i_spare
[0]) {
sleep((caddr_t
)vp
, PRIBIO
);