Source-Changes-HG archive

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

[src/netbsd-6]: src/sys Pull up following revision(s) (requested by manu in t...



details:   https://anonhg.NetBSD.org/src/rev/af97a48a8d0b
branches:  netbsd-6
changeset: 774125:af97a48a8d0b
user:      riz <riz%NetBSD.org@localhost>
date:      Sat May 19 15:03:31 2012 +0000

description:
Pull up following revision(s) (requested by manu in ticket #260):
        sys/kern/vfs_xattr.c: revision 1.31
        sys/ufs/ufs/ufs_extattr.c: revision 1.39
Return ENODATA when no attribute is found, like Linux does. After
all we decided to adopt the Linux API, therefore there is rationale
to stick to it.
No standard tells us what to do, and our extended attribute API has not
been used in a release, therefore we do not break anything, and we get
more easily compatible with programs using the Linux extended attribute
API.
Note that FreeBSD and MacOS X return ENOATTR. FreeBSD has its own API
and MacOS X has a Linux-like API. How did the world get so complicated?

diffstat:

 sys/kern/vfs_xattr.c      |   6 +++---
 sys/ufs/ufs/ufs_extattr.c |  18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diffs (108 lines):

diff -r 4a1ce0db5d97 -r af97a48a8d0b sys/kern/vfs_xattr.c
--- a/sys/kern/vfs_xattr.c      Sat May 19 15:01:35 2012 +0000
+++ b/sys/kern/vfs_xattr.c      Sat May 19 15:03:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_xattr.c,v 1.29 2011/11/09 18:29:28 drochner Exp $  */
+/*     $NetBSD: vfs_xattr.c,v 1.29.6.1 2012/05/19 15:03:31 riz 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.29 2011/11/09 18:29:28 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.29.6.1 2012/05/19 15:03:31 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -230,7 +230,7 @@
                                       &attrlen, l->l_cred);
 
                switch (error) {
-               case ENOATTR:
+               case ENODATA:
                        if (flag & XATTR_REPLACE)
                                goto done;
                        break;
diff -r 4a1ce0db5d97 -r af97a48a8d0b sys/ufs/ufs/ufs_extattr.c
--- a/sys/ufs/ufs/ufs_extattr.c Sat May 19 15:01:35 2012 +0000
+++ b/sys/ufs/ufs/ufs_extattr.c Sat May 19 15:03:31 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_extattr.c,v 1.36 2012/01/27 19:22:49 para Exp $    */
+/*     $NetBSD: ufs_extattr.c,v 1.36.2.1 2012/05/19 15:03:31 riz Exp $ */
 
 /*-
  * Copyright (c) 1999-2002 Robert N. M. Watson
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.36 2012/01/27 19:22:49 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.36.2.1 2012/05/19 15:03:31 riz Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ffs.h"
@@ -834,7 +834,7 @@
 
        uele = ufs_extattr_find_attr(ump, attrnamespace, attrname);
        if (!uele)
-               return (ENOATTR);
+               return (ENODATA);
 
        LIST_REMOVE(uele, uele_entries);
 
@@ -981,7 +981,7 @@
 
        /* Defined? */
        if ((ueh->ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0)
-               return ENOATTR;
+               return ENODATA;
 
        /* Valid for the current inode generation? */
        if (ueh->ueh_i_gen != ip->i_gen) {
@@ -994,7 +994,7 @@
                printf("%s (%s): inode gen inconsistency (%u, %jd)\n",
                       __func__,  mp->mnt_stat.f_mntonname, ueh->ueh_i_gen,
                       (intmax_t)ip->i_gen);
-               return ENOATTR;
+               return ENODATA;
        }
 
        /* Local size consistency check. */
@@ -1066,7 +1066,7 @@
 
        attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
        if (!attribute)
-               return (ENOATTR);
+               return (ENODATA);
 
        /*
         * Allow only offsets of zero to encourage the read/replace
@@ -1185,7 +1185,7 @@
                        continue;
 
                error = ufs_extattr_get_header(vp, uele, &ueh, NULL);
-               if (error == ENOATTR)
+               if (error == ENODATA)
                        continue;       
                if (error != 0)
                        return error;
@@ -1348,7 +1348,7 @@
                attribute =  ufs_extattr_autocreate_attr(vp, attrnamespace, 
                                                         name, l);
                if  (!attribute)
-                       return (ENOATTR);
+                       return (ENODATA);
        }
 
        /*
@@ -1457,7 +1457,7 @@
 
        attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
        if (!attribute)
-               return (ENOATTR);
+               return (ENODATA);
 
        /*
         * Don't need to get a lock on the backing file if the getattr is



Home | Main Index | Thread Index | Old Index