Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Add tracepoints for extended attribute names and va...



details:   https://anonhg.NetBSD.org/src/rev/177ed35d15dd
branches:  trunk
changeset: 767554:177ed35d15dd
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Jul 22 12:46:18 2011 +0000

description:
Add tracepoints for extended attribute names and values, so that
we can figure what is going on when looking at a ktrace output.

diffstat:

 sys/kern/vfs_xattr.c |  17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (79 lines):

diff -r 82c2fd40a039 -r 177ed35d15dd sys/kern/vfs_xattr.c
--- a/sys/kern/vfs_xattr.c      Fri Jul 22 12:41:52 2011 +0000
+++ b/sys/kern/vfs_xattr.c      Fri Jul 22 12:46:18 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_xattr.c,v 1.27 2011/07/04 08:07:30 manu Exp $      */
+/*     $NetBSD: vfs_xattr.c,v 1.28 2011/07/22 12:46:18 manu Exp $      */
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.27 2011/07/04 08:07:30 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.28 2011/07/22 12:46:18 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -85,6 +85,7 @@
 #include <sys/sysctl.h>
 #include <sys/syscallargs.h>
 #include <sys/kauth.h>
+#include <sys/ktrace.h>
 
 /*
  * Credential check based on process requesting service, and per-attribute
@@ -260,6 +261,9 @@
        auio.uio_vmspace = l->l_proc->p_vmspace;
        cnt = nbytes;
 
+       ktrkuser("xattr-name", (void *)__UNCONST(attrname), strlen(attrname));
+       ktrkuser("xattr-val", __UNCONST(data), nbytes);
+
        error = VOP_SETEXTATTR(vp, attrnamespace, attrname, &auio, l->l_cred);
        cnt -= auio.uio_resid;
        retval[0] = cnt;
@@ -312,12 +316,16 @@
        } else
                sizep = &size;
 
+       ktrkuser("xattr-name", (void *)__UNCONST(attrname), strlen(attrname));
+
        error = VOP_GETEXTATTR(vp, attrnamespace, attrname, auiop, sizep,
            l->l_cred);
 
        if (auiop != NULL) {
                cnt -= auio.uio_resid;
                retval[0] = cnt;
+
+               ktrkuser("xattr-val", data, cnt);
        } else
                retval[0] = size;
 
@@ -339,6 +347,8 @@
 
        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 
+       ktrkuser("xattr-name", (void *)__UNCONST(attrname), strlen(attrname));
+
        error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, l->l_cred);
        if (error == EOPNOTSUPP)
                error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL,
@@ -392,6 +402,8 @@
        if (auiop != NULL) {
                cnt -= auio.uio_resid;
                retval[0] = cnt;
+
+               ktrkuser("xattr-list", data, cnt);
        } else
                retval[0] = size;
 
@@ -1068,7 +1080,6 @@
            list, size, 0, l, &listsize_usr);
        if (error)
                goto out;
-
        if (list)
                list += listsize_usr;
        if (size)



Home | Main Index | Thread Index | Old Index