* Use is subject to license terms.
*/
/*
- * Copyright (c) 2011, 2012 Whamcloud, Inc.
+ * Copyright (c) 2012, Intel Corporation.
* Use is subject to license terms.
*/
/*
LASSERT(osd_invariant(obj));
LASSERT(dt_object_exists(dt));
- cfs_down(&obj->oo_guard);
+ down(&obj->oo_guard);
rc = __osd_xattr_get(env, obj, buf, name, &size);
- cfs_up(&obj->oo_guard);
+ up(&obj->oo_guard);
if (rc == -ENOENT)
rc = -ENODATA;
LASSERT(handle != NULL);
oh = container_of0(handle, struct osd_thandle, ot_super);
- cfs_down(&obj->oo_guard);
+ down(&obj->oo_guard);
__osd_xattr_declare_set(env, obj, buf->lb_len, name, oh);
- cfs_up(&obj->oo_guard);
+ up(&obj->oo_guard);
RETURN(0);
}
return rc;
}
-static int
+int
__osd_xattr_set(const struct lu_env *env, struct osd_object *obj,
const struct lu_buf *buf, const char *name, int fl,
struct osd_thandle *oh)
}
int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
- const struct lu_buf *buf, const char *name, int fl,
- struct thandle *handle, struct lustre_capa *capa)
+ const struct lu_buf *buf, const char *name, int fl,
+ struct thandle *handle, struct lustre_capa *capa)
{
struct osd_object *obj = osd_dt_obj(dt);
struct osd_thandle *oh;
oh = container_of0(handle, struct osd_thandle, ot_super);
- cfs_down(&obj->oo_guard);
+ down(&obj->oo_guard);
CDEBUG(D_INODE, "Setting xattr %s with size %d\n",
name, (int)buf->lb_len);
- rc = __osd_sa_xattr_set(env, obj, buf, name, fl, oh);
- /* place xattr in dnode if SA is full */
- if (rc == -EFBIG)
- rc = __osd_xattr_set(env, obj, buf, name, fl, oh);
- cfs_up(&obj->oo_guard);
+ rc = osd_xattr_set_internal(env, obj, buf, name, fl, oh, capa);
+ up(&obj->oo_guard);
RETURN(rc);
}
LASSERT(oh->ot_tx != NULL);
LASSERT(obj->oo_db != NULL);
- cfs_down(&obj->oo_guard);
+ down(&obj->oo_guard);
__osd_xattr_declare_del(env, obj, name, oh);
- cfs_up(&obj->oo_guard);
+ up(&obj->oo_guard);
RETURN(0);
}
oh = container_of0(handle, struct osd_thandle, ot_super);
LASSERT(oh->ot_tx != NULL);
- cfs_down(&obj->oo_guard);
+ down(&obj->oo_guard);
rc = __osd_xattr_del(env, obj, name, oh);
- cfs_up(&obj->oo_guard);
+ up(&obj->oo_guard);
RETURN(rc);
}
LASSERT(osd_invariant(obj));
LASSERT(dt_object_exists(dt));
- cfs_down(&obj->oo_guard);
+ down(&obj->oo_guard);
rc = osd_sa_xattr_list(env, obj, lb);
if (rc < 0)
out_fini:
udmu_zap_cursor_fini(zc);
out:
- cfs_up(&obj->oo_guard);
+ up(&obj->oo_guard);
RETURN(rc);
}