Date: Fri, 13 Oct 2000 20:02:31 -0700 (PDT) From: Adrian Chadd <adrian@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/conf files options src/sys/i386/conf NOTES src/sys/ufs/ffs ffs_extern.h ffs_vfsops.c ffs_vnops.c src/sys/ufs/ifs README ifs_extern.h ifs_lookup.c ifs_subr.c ifs_vfsops.c ifs_vnops.c Message-ID: <200010140302.UAA08046@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
adrian 2000/10/13 20:02:31 PDT Modified files: sys/conf files options sys/i386/conf NOTES sys/ufs/ffs ffs_extern.h ffs_vfsops.c ffs_vnops.c Added files: sys/ufs/ifs README ifs_extern.h ifs_lookup.c ifs_subr.c ifs_vfsops.c ifs_vnops.c Log: 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! Revision Changes Path 1.427 +13 -1 src/sys/conf/files 1.231 +2 -1 src/sys/conf/options 1.838 +4 -1 src/sys/i386/conf/NOTES 1.35 +3 -1 src/sys/ufs/ffs/ffs_extern.h 1.132 +4 -6 src/sys/ufs/ffs/ffs_vfsops.c 1.72 +3 -3 src/sys/ufs/ffs/ffs_vnops.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010140302.UAA08046>