Whamcloud - gitweb
LU-5772 osd-zfs: irrelevant comment over __osd_xattr_load 50/12350/3
authorIsaac Huang <he.huang@intel.com>
Mon, 20 Oct 2014 19:32:20 +0000 (13:32 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 9 Dec 2014 08:10:48 +0000 (08:10 +0000)
Moved comment over __osd_xattr_load() to __osd_xattr_get(),
where it really belongs, and converted it to Doxygen format.
Added a few other minor cleanups as well.

Signed-off-by: Isaac Huang <he.huang@intel.com>
Change-Id: If73048d046419eaa4e23cbc5acde32c09b588996
Reviewed-on: http://review.whamcloud.com/12350
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_io.c
lustre/osd-zfs/osd_object.c
lustre/osd-zfs/osd_oi.c
lustre/osd-zfs/osd_xattr.c

index 284e886..9b05c72 100644 (file)
@@ -869,4 +869,3 @@ struct dt_body_operations osd_body_ops = {
        .dbo_declare_punch              = osd_declare_punch,
        .dbo_punch                      = osd_punch,
 };
-
index e66d2e0..bc28b55 100644 (file)
@@ -1797,4 +1797,3 @@ static struct dt_object_operations osd_obj_otable_it_ops = {
         .do_attr_get    = osd_otable_it_attr_get,
         .do_index_try   = osd_index_try,
 };
-
index 371c442..279dfb0 100644 (file)
@@ -860,5 +860,3 @@ int osd_options_init(void)
 
        return 0;
 }
-
-
index 0d783aa..b20a2aa 100644 (file)
 
 #include <linux/posix_acl_xattr.h>
 
-/*
- * Copy an extended attribute into the buffer provided, or compute the
- * required buffer size.
- *
- * If buf is NULL, it computes the required buffer size.
- *
- * Returns 0 on success or a negative error number on failure.
- * On success, the number of bytes used / required is stored in 'size'.
- *
- * No locking is done here.
- */
+
 int __osd_xattr_load(struct osd_device *osd, uint64_t dnode, nvlist_t **sa)
 {
        sa_handle_t *sa_hdl;
@@ -126,8 +116,9 @@ static inline int __osd_xattr_cache(const struct lu_env *env,
                                &obj->oo_sa_xattr);
 }
 
-int __osd_sa_xattr_get(const struct lu_env *env, struct osd_object *obj,
-                      const struct lu_buf *buf, const char *name, int *sizep)
+static int
+__osd_sa_xattr_get(const struct lu_env *env, struct osd_object *obj,
+                  const struct lu_buf *buf, const char *name, int *sizep)
 {
        uchar_t *nv_value;
        int      rc;
@@ -218,6 +209,23 @@ out_rele:
        return rc;
 }
 
+/**
+ * Copy an extended attribute into the buffer provided, or compute
+ * the required buffer size if \a buf is NULL.
+ *
+ * On success, the number of bytes used or required is stored in \a sizep.
+ *
+ * Note that no locking is done here.
+ *
+ * \param[in] env      execution environment
+ * \param[in] obj      object for which to retrieve xattr
+ * \param[out] buf     buffer to store xattr value in
+ * \param[in] name     name of xattr to copy
+ * \param[out] sizep   bytes used or required to store xattr
+ *
+ * \retval 0           on success
+ * \retval negative    negated errno on failure
+ */
 int __osd_xattr_get(const struct lu_env *env, struct osd_object *obj,
                    struct lu_buf *buf, const char *name, int *sizep)
 {
@@ -228,10 +236,8 @@ int __osd_xattr_get(const struct lu_env *env, struct osd_object *obj,
        if (rc != -ENOENT)
                return rc;
 
-       rc = __osd_xattr_get_large(env, osd_obj2dev(obj), obj->oo_xattr,
-                                  buf, name, sizep);
-
-       return rc;
+       return __osd_xattr_get_large(env, osd_obj2dev(obj), obj->oo_xattr,
+                                    buf, name, sizep);
 }
 
 int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
@@ -856,5 +862,3 @@ out:
        RETURN(rc);
 
 }
-
-