summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_vfsops.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2000-10-14 03:02:30 +0000
committeradrian <adrian@FreeBSD.org>2000-10-14 03:02:30 +0000
commit0458054c4e405cc6f262b0fb171dc3d049bc7513 (patch)
tree5d8132a94f833d46795e30aa5296a893b2e5637c /sys/ufs/ffs/ffs_vfsops.c
parentee143d47ad6c41a3590bdb5ed28c7bd5bf6ffff8 (diff)
downloadFreeBSD-src-0458054c4e405cc6f262b0fb171dc3d049bc7513.zip
FreeBSD-src-0458054c4e405cc6f262b0fb171dc3d049bc7513.tar.gz
Initial commit of IFS - a inode-namespaced FFS. Here is a short
description: How it works: -- Basically ifs is a copy of ffs, overriding some vfs/vnops. (Yes, hack.) I didn't see the need in duplicating all of sys/ufs/ffs to get this off the ground. File creation is done through a special file - 'newfile' . When newfile is called, the system allocates and returns an inode. Note that newfile is done in a cloning fashion: fd = open("newfile", O_CREAT|O_RDWR, 0644); fstat(fd, &st); printf("new file is %d\n", (int)st.st_ino); Once you have created a file, you can open() and unlink() it by its returned inode number retrieved from the stat call, ie: fd = open("5", O_RDWR); The creation permissions depend entirely if you have write access to the root directory of the filesystem. To get the list of currently allocated inodes, VOP_READDIR has been added which returns a directory listing of those currently allocated. -- What this entails: * patching conf/files and conf/options to include IFS as a new compile option (and since ifs depends upon FFS, include the FFS routines) * An entry in i386/conf/NOTES indicating IFS exists and where to go for an explanation * Unstaticize a couple of routines in src/sys/ufs/ffs/ which the IFS routines require (ffs_mount() and ffs_reload()) * a new bunch of routines in src/sys/ufs/ifs/ which implement the IFS routines. IFS replaces some of the vfsops, and a handful of vnops - most notably are VFS_VGET(), VOP_LOOKUP(), VOP_UNLINK() and VOP_READDIR(). Any other directory operation is marked as invalid. What this results in: * an IFS partition's create permissions are controlled by the perm/ownership of the root mount point, just like a normal directory * Each inode has perm and ownership too * IFS does *NOT* mean an FFS partition can be opened per inode. This is a completely seperate filesystem here * Softupdates doesn't work with IFS, and really I don't think it needs it. Besides, fsck's are FAST. (Try it :-) * Inodes 0 and 1 aren't allocatable because they are special (dump/swap IIRC). Inode 2 isn't allocatable since UFS/FFS locks all inodes in the system against this particular inode, and unravelling THAT code isn't trivial. Therefore, useful inodes start at 3. Enjoy, and feedback is definitely appreciated!
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 80610a3..fd3fd5d 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -68,10 +68,8 @@
static MALLOC_DEFINE(M_FFSNODE, "FFS node", "FFS vnode private part");
static int ffs_sbupdate __P((struct ufsmount *, int));
-static int ffs_reload __P((struct mount *,struct ucred *,struct proc *));
+int ffs_reload __P((struct mount *,struct ucred *,struct proc *));
static int ffs_oldfscompat __P((struct fs *));
-static int ffs_mount __P((struct mount *, char *, caddr_t,
- struct nameidata *, struct proc *));
static int ffs_init __P((struct vfsconf *));
static struct vfsops ufs_vfsops = {
@@ -134,7 +132,7 @@ VFS_SET(ufs_vfsops, ufs, 0);
* system call will fail with EFAULT in copyinstr in
* namei() if it is a genuine NULL from the user.
*/
-static int
+int
ffs_mount(mp, path, data, ndp, p)
struct mount *mp; /* mount struct pointer*/
char *path; /* path to mount point*/
@@ -359,7 +357,7 @@ ffs_mount(mp, path, data, ndp, p)
* 5) invalidate all cached file data.
* 6) re-read inode data for all active vnodes.
*/
-static int
+int
ffs_reload(mp, cred, p)
register struct mount *mp;
struct ucred *cred;
OpenPOWER on IntegriCloud