Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Move the rest of the extattr stuff into vfs_xattr.c



details:   https://anonhg.NetBSD.org/src/rev/fdf620e8ec76
branches:  trunk
changeset: 582907:fdf620e8ec76
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Jul 10 22:10:00 2005 +0000

description:
Move the rest of the extattr stuff into vfs_xattr.c

diffstat:

 sys/kern/vfs_subr.c  |  50 ++------------------------------------------------
 sys/kern/vfs_xattr.c |  49 +++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 49 insertions(+), 50 deletions(-)

diffs (148 lines):

diff -r 27903c902d6f -r fdf620e8ec76 sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c       Sun Jul 10 22:05:24 2005 +0000
+++ b/sys/kern/vfs_subr.c       Sun Jul 10 22:10:00 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_subr.c,v 1.250 2005/06/19 18:22:36 elad Exp $      */
+/*     $NetBSD: vfs_subr.c,v 1.251 2005/07/10 22:10:00 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.250 2005/06/19 18:22:36 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.251 2005/07/10 22:10:00 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "opt_ddb.h"
@@ -107,7 +107,6 @@
 #include <sys/sa.h>
 #include <sys/syscallargs.h>
 #include <sys/device.h>
-#include <sys/extattr.h>
 #include <sys/dirent.h>
 #include <sys/filedesc.h>
 
@@ -2968,51 +2967,6 @@
        return 0;
 }
 
-/*
- * Default vfs_extattrctl routine for file systems that do not support
- * it.
- */
-/*ARGSUSED*/
-int
-vfs_stdextattrctl(struct mount *mp, int cmt, struct vnode *vp,
-    int attrnamespace, const char *attrname, struct proc *p)
-{
-
-       if (vp != NULL)
-               VOP_UNLOCK(vp, 0);
-       return (EOPNOTSUPP);
-}
-
-/*
- * Credential check based on process requesting service, and per-attribute
- * permissions.
- *
- * NOTE: Vnode must be locked.
- */
-int
-extattr_check_cred(struct vnode *vp, int attrnamespace,
-    struct ucred *cred, struct proc *p, int access)
-{
-
-       if (cred == NOCRED)
-               return (0);
-
-       switch (attrnamespace) {
-       case EXTATTR_NAMESPACE_SYSTEM:
-               /*
-                * Do we really want to allow this, or just require that
-                * these requests come from kernel code (NOCRED case above)?
-                */
-               return (suser(cred, &p->p_acflag));
-
-       case EXTATTR_NAMESPACE_USER:
-               return (VOP_ACCESS(vp, access, cred, p));
-
-       default:
-               return (EPERM);
-       }
-}
-
 #ifdef DDB
 static const char buf_flagbits[] = BUF_FLAGBITS;
 
diff -r 27903c902d6f -r fdf620e8ec76 sys/kern/vfs_xattr.c
--- a/sys/kern/vfs_xattr.c      Sun Jul 10 22:05:24 2005 +0000
+++ b/sys/kern/vfs_xattr.c      Sun Jul 10 22:10:00 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_xattr.c,v 1.2 2005/07/10 22:04:20 thorpej Exp $    */
+/*     $NetBSD: vfs_xattr.c,v 1.3 2005/07/10 22:10:00 thorpej Exp $    */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.2 2005/07/10 22:04:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.3 2005/07/10 22:10:00 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -94,6 +94,51 @@
 #include <sys/syscallargs.h>
 
 /*
+ * Credential check based on process requesting service, and per-attribute
+ * permissions.
+ *
+ * NOTE: Vnode must be locked.
+ */
+int
+extattr_check_cred(struct vnode *vp, int attrnamespace,
+    struct ucred *cred, struct proc *p, int access)
+{
+
+       if (cred == NOCRED)
+               return (0);
+
+       switch (attrnamespace) {
+       case EXTATTR_NAMESPACE_SYSTEM:
+               /*
+                * Do we really want to allow this, or just require that
+                * these requests come from kernel code (NOCRED case above)?
+                */
+               return (suser(cred, &p->p_acflag));
+
+       case EXTATTR_NAMESPACE_USER:
+               return (VOP_ACCESS(vp, access, cred, p));
+
+       default:
+               return (EPERM);
+       }
+}
+
+/*
+ * Default vfs_extattrctl routine for file systems that do not support
+ * it.
+ */
+/*ARGSUSED*/
+int
+vfs_stdextattrctl(struct mount *mp, int cmt, struct vnode *vp,
+    int attrnamespace, const char *attrname, struct proc *p)
+{
+
+       if (vp != NULL)
+               VOP_UNLOCK(vp, 0);
+       return (EOPNOTSUPP);
+}
+
+/*
  * Push extended attribute configuration information into the file
  * system.
  *



Home | Main Index | Thread Index | Old Index