*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
struct osd_object *obj)
{
LASSERT(obj->oo_sa_xattr == NULL);
- LASSERT(obj->oo_db != NULL);
+ LASSERT(obj->oo_dn != NULL);
- return __osd_xattr_load(osd_obj2dev(obj), obj->oo_db->db_object,
+ return __osd_xattr_load(osd_obj2dev(obj), obj->oo_dn->dn_object,
&obj->oo_sa_xattr);
}
uint64_t xattr, struct lu_buf *buf,
const char *name, int *sizep)
{
- dmu_buf_t *xa_data_db;
- sa_handle_t *sa_hdl = NULL;
+ dnode_t *xa_data_dn;
+ sa_handle_t *sa_hdl = NULL;
uint64_t xa_data_obj, size;
int rc;
if (rc)
return rc;
- rc = __osd_obj2dbuf(env, osd->od_os, xa_data_obj, &xa_data_db);
+ rc = __osd_obj2dnode(env, osd->od_os, xa_data_obj, &xa_data_dn);
if (rc)
return rc;
goto out;
}
- rc = -dmu_read(osd->od_os, xa_data_db->db_object, 0,
+ rc = -dmu_read(osd->od_os, xa_data_dn->dn_object, 0,
size, buf->lb_buf, DMU_READ_PREFETCH);
out:
sa_handle_destroy(sa_hdl);
out_rele:
- dmu_buf_rele(xa_data_db, FTAG);
+ osd_dnode_rele(xa_data_dn);
return rc;
}
int rc, size = 0;
ENTRY;
- LASSERT(obj->oo_db != NULL);
+ LASSERT(obj->oo_dn != NULL);
LASSERT(osd_invariant(obj));
if (!osd_obj2dev(obj)->od_posix_acl &&
int vallen, const char *name,
struct osd_thandle *oh)
{
- dmu_buf_t *db = obj->oo_db;
- dmu_tx_t *tx = oh->ot_tx;
+ dmu_tx_t *tx = oh->ot_tx;
+ int bonuslen;
if (unlikely(obj->oo_destroyed))
return;
/* XXX: it should be possible to skip spill
* declaration if specific EA is part of
* bonus and doesn't grow */
- dmu_tx_hold_spill(tx, db->db_object);
+ dmu_tx_hold_spill(tx, obj->oo_dn->dn_object);
return;
}
+ bonuslen = osd_obj_bonuslen(obj);
+
/* the object doesn't exist, but we've declared bonus
* in osd_declare_object_create() yet */
- if (obj->oo_ea_in_bonus > DN_MAX_BONUSLEN) {
+ if (obj->oo_ea_in_bonus > bonuslen) {
/* spill has been declared already */
- } else if (obj->oo_ea_in_bonus + vallen > DN_MAX_BONUSLEN) {
+ } else if (obj->oo_ea_in_bonus + vallen > bonuslen) {
/* we're about to exceed bonus, let's declare spill */
dmu_tx_hold_spill(tx, DMU_NEW_OBJECT);
}
*
* No locking is done here.
*/
-static int
-__osd_sa_xattr_update(const struct lu_env *env, struct osd_object *obj,
+int __osd_sa_xattr_update(const struct lu_env *env, struct osd_object *obj,
struct osd_thandle *oh)
{
struct osd_device *osd = osd_obj2dev(obj);
struct osd_thandle *oh)
{
struct osd_device *osd = osd_obj2dev(obj);
- dmu_buf_t *xa_zap_db = NULL;
- dmu_buf_t *xa_data_db = NULL;
+ dnode_t *xa_zap_dn = NULL;
+ dnode_t *xa_data_dn = NULL;
uint64_t xa_data_obj;
sa_handle_t *sa_hdl = NULL;
dmu_tx_t *tx = oh->ot_tx;
la->la_valid = LA_MODE;
la->la_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO;
- rc = __osd_zap_create(env, osd, &xa_zap_db, tx, la, 0);
+ rc = __osd_zap_create(env, osd, &xa_zap_dn, tx, la, 0);
if (rc)
return rc;
- obj->oo_xattr = xa_zap_db->db_object;
+ obj->oo_xattr = xa_zap_dn->dn_object;
rc = osd_object_sa_update(obj, SA_ZPL_XATTR(osd),
&obj->oo_xattr, 8, oh);
if (rc)
* Entry already exists.
* We'll truncate the existing object.
*/
- rc = __osd_obj2dbuf(env, osd->od_os, xa_data_obj,
- &xa_data_db);
+ rc = __osd_obj2dnode(env, osd->od_os, xa_data_obj, &xa_data_dn);
if (rc)
goto out;
if (rc)
goto out_sa;
- rc = -dmu_free_range(osd->od_os, xa_data_db->db_object,
+ rc = -dmu_free_range(osd->od_os, xa_data_dn->dn_object,
0, DMU_OBJECT_END, tx);
if (rc)
goto out_sa;
la->la_valid = LA_MODE;
la->la_mode = S_IFREG | S_IRUGO | S_IWUSR;
- rc = __osd_object_create(env, obj, &xa_data_db, tx, la);
+ rc = __osd_object_create(env, obj, &xa_data_dn, tx, la);
if (rc)
goto out;
- xa_data_obj = xa_data_db->db_object;
+ xa_data_obj = xa_data_dn->dn_object;
rc = -sa_handle_get(osd->od_os, xa_data_obj, NULL,
SA_HDL_PRIVATE, &sa_hdl);
out_sa:
sa_handle_destroy(sa_hdl);
out:
- if (xa_data_db != NULL)
- dmu_buf_rele(xa_data_db, FTAG);
- if (xa_zap_db != NULL)
- dmu_buf_rele(xa_zap_db, FTAG);
+ if (xa_data_dn != NULL)
+ osd_dnode_rele(xa_data_dn);
+ if (xa_zap_dn != NULL)
+ osd_dnode_rele(xa_zap_dn);
return rc;
}
strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
RETURN(-EOPNOTSUPP);
- if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LINKEA_OVERFLOW) &&
- strcmp(name, XATTR_NAME_LINK) == 0)
- RETURN(-ENOSPC);
-
oh = container_of0(handle, struct osd_thandle, ot_super);
down_write(&obj->oo_guard);
oh = container_of0(handle, struct osd_thandle, ot_super);
LASSERT(oh->ot_tx != NULL);
- LASSERT(obj->oo_db != NULL);
+ LASSERT(obj->oo_dn != NULL);
down_read(&obj->oo_guard);
if (likely(dt_object_exists(&obj->oo_dt) && !obj->oo_destroyed))
ENTRY;
LASSERT(handle != NULL);
- LASSERT(obj->oo_db != NULL);
+ LASSERT(obj->oo_dn != NULL);
LASSERT(osd_invariant(obj));
LASSERT(dt_object_exists(dt));
oh = container_of0(handle, struct osd_thandle, ot_super);
rc = -dmu_object_free(osd->od_os, obj->oo_xattr, tx);
if (rc)
- CERROR("%s: free xattr "LPU64" failed: rc = %d\n",
+ CERROR("%s: free xattr %llu failed: rc = %d\n",
osd->od_svname, obj->oo_xattr, rc);
return rc;
int rc, counted;
ENTRY;
- LASSERT(obj->oo_db != NULL);
+ LASSERT(obj->oo_dn != NULL);
LASSERT(osd_invariant(obj));
LASSERT(dt_object_exists(dt));