summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2000-04-15 03:34:27 +0000
committerrwatson <rwatson@FreeBSD.org>2000-04-15 03:34:27 +0000
commita0dd5ab0fdc3b34857eb18eae8dae879d1e5b8cf (patch)
tree4c1ff739a8025b89f8c9ed37caf68cd1a78eaedd /sys/ufs/ffs
parente7f9f3a94cc8b0fedca28cad6fd0d3a6c248d6d8 (diff)
downloadFreeBSD-src-a0dd5ab0fdc3b34857eb18eae8dae879d1e5b8cf.zip
FreeBSD-src-a0dd5ab0fdc3b34857eb18eae8dae879d1e5b8cf.tar.gz
Introduce extended attribute support for FFS, allowing arbitrary
(name, value) pairs to be associated with inodes. This support is used for ACLs, MAC labels, and Capabilities in the TrustedBSD security extensions, which are currently under development. In this implementation, attributes are backed to data vnodes in the style of the quota support in FFS. Support for FFS extended attributes may be enabled using the FFS_EXTATTR kernel option (disabled by default). Userland utilities and man pages will be committed in the next batch. VFS interfaces and man pages have been in the repo since 4.0-RELEASE and are unchanged. o ufs/ufs/extattr.h: UFS-specific extattr defines o ufs/ufs/ufs_extattr.c: bulk of support routines o ufs/{ufs,ffs,mfs}/*.[ch]: hooks and extattr.h includes o contrib/softupdates/ffs_softdep.c: extattr.h includes o conf/options, conf/files, i386/conf/LINT: added FFS_EXTATTR o coda/coda_vfsops.c: XXX required extattr.h due to ufsmount.h (This should not be the case, and will be fixed in a future commit) Currently attributes are not supported in MFS. This will be fixed. Reviewed by: adrian, bp, freebsd-fs, other unthanked souls Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c1
-rw-r--r--sys/ufs/ffs/ffs_inode.c1
-rw-r--r--sys/ufs/ffs/ffs_softdep.c1
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c14
-rw-r--r--sys/ufs/ffs/ffs_vnops.c7
5 files changed, 24 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 361d887..0b06479 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -47,6 +47,7 @@
#include <sys/sysctl.h>
#include <sys/syslog.h>
+#include <ufs/ufs/extattr.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/ufs_extern.h>
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 4081c76..78b8f7e 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -49,6 +49,7 @@
#include <vm/vm.h>
#include <vm/vm_extern.h>
+#include <ufs/ufs/extattr.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/inode.h>
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index a6535cd..4b3807d 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -77,6 +77,7 @@
#include <sys/vnode.h>
#include <sys/conf.h>
#include <ufs/ufs/dir.h>
+#include <ufs/ufs/extattr.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/ufsmount.h>
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 511c827..39a0831 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -34,6 +34,7 @@
* $FreeBSD$
*/
+#include "opt_ffs.h"
#include "opt_quota.h"
#include <sys/param.h>
@@ -49,6 +50,7 @@
#include <sys/disklabel.h>
#include <sys/malloc.h>
+#include <ufs/ufs/extattr.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/inode.h>
@@ -84,7 +86,11 @@ static struct vfsops ufs_vfsops = {
ffs_vptofh,
ffs_init,
vfs_stduninit,
+#ifdef FFS_EXTATTR
+ ufs_extattrctl,
+#else
vfs_stdextattrctl,
+#endif
};
VFS_SET(ufs_vfsops, ufs, 0);
@@ -710,6 +716,9 @@ ffs_mountfs(devvp, mp, p, malloctype)
ump->um_seqinc = fs->fs_frag;
for (i = 0; i < MAXQUOTAS; i++)
ump->um_quotas[i] = NULLVP;
+#ifdef FFS_EXTATTR
+ ufs_extattr_uepm_init(&ump->um_extattr);
+#endif
devvp->v_specmountpoint = mp;
ffs_oldfscompat(fs);
@@ -808,6 +817,11 @@ ffs_unmount(mp, mntflags, p)
if (mntflags & MNT_FORCE) {
flags |= FORCECLOSE;
}
+#ifdef FFS_EXTATTR
+ if ((error = ufs_extattr_stop(mp, p))) {
+ printf("ffs_unmonut: ufs_extattr_stop returned %d\n", error);
+ }
+#endif
if (mp->mnt_flag & MNT_SOFTDEP) {
if ((error = softdep_flushfiles(mp, flags, p)) != 0)
return (error);
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 5a7ce0b..1964a75 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -34,6 +34,8 @@
* $FreeBSD$
*/
+#include "opt_ffs.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/resourcevar.h>
@@ -53,6 +55,7 @@
#include <vm/vm_object.h>
#include <vm/vm_extern.h>
+#include <ufs/ufs/extattr.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/ufsmount.h>
@@ -78,6 +81,10 @@ static struct vnodeopv_entry_desc ffs_vnodeop_entries[] = {
{ &vop_balloc_desc, (vop_t *) ffs_balloc },
{ &vop_reallocblks_desc, (vop_t *) ffs_reallocblks },
{ &vop_write_desc, (vop_t *) ffs_write },
+#ifdef FFS_EXTATTR
+ { &vop_getextattr_desc, (vop_t *) ufs_vop_getextattr },
+ { &vop_setextattr_desc, (vop_t *) ufs_vop_setextattr },
+#endif
{ NULL, NULL }
};
static struct vnodeopv_desc ffs_vnodeop_opv_desc =
OpenPOWER on IntegriCloud