From: Isaac Huang Date: Mon, 20 Oct 2014 19:32:20 +0000 (-0600) Subject: LU-5772 osd-zfs: irrelevant comment over __osd_xattr_load X-Git-Tag: 2.6.92~79 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9dacbee7fe35e7dac5637c8ad5c62ece41d3c8ed LU-5772 osd-zfs: irrelevant comment over __osd_xattr_load 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 Change-Id: If73048d046419eaa4e23cbc5acde32c09b588996 Reviewed-on: http://review.whamcloud.com/12350 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Nathaniel Clark Reviewed-by: Ned Bass Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-zfs/osd_io.c b/lustre/osd-zfs/osd_io.c index 284e886..9b05c72 100644 --- a/lustre/osd-zfs/osd_io.c +++ b/lustre/osd-zfs/osd_io.c @@ -869,4 +869,3 @@ struct dt_body_operations osd_body_ops = { .dbo_declare_punch = osd_declare_punch, .dbo_punch = osd_punch, }; - diff --git a/lustre/osd-zfs/osd_object.c b/lustre/osd-zfs/osd_object.c index e66d2e0..bc28b55 100644 --- a/lustre/osd-zfs/osd_object.c +++ b/lustre/osd-zfs/osd_object.c @@ -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, }; - diff --git a/lustre/osd-zfs/osd_oi.c b/lustre/osd-zfs/osd_oi.c index 371c442..279dfb0 100644 --- a/lustre/osd-zfs/osd_oi.c +++ b/lustre/osd-zfs/osd_oi.c @@ -860,5 +860,3 @@ int osd_options_init(void) return 0; } - - diff --git a/lustre/osd-zfs/osd_xattr.c b/lustre/osd-zfs/osd_xattr.c index 0d783aa..b20a2aa 100644 --- a/lustre/osd-zfs/osd_xattr.c +++ b/lustre/osd-zfs/osd_xattr.c @@ -70,17 +70,7 @@ #include -/* - * 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); } - -