RETURN(rc);
}
- if (o->opo_new)
- /* no need in logging for new objects being created */
- RETURN(0);
-
if (!(attr->la_valid & (LA_UID | LA_GID)))
RETURN(0);
- if (!is_only_remote_trans(th))
+ if (!is_only_remote_trans(th)) {
/*
* track all UID/GID changes via llog
*/
rc = osp_sync_declare_add(env, o, MDS_SETATTR64_REC, th);
- else
+ } else {
/* It is for OST-object attr_set directly without updating
* local MDT-object attribute. It is usually used by LFSCK. */
- rc = osp_md_declare_attr_set(env, dt, attr, th);
+ rc = __osp_md_attr_set(env, dt, attr, th);
+ }
if (rc != 0 || o->opo_ooa == NULL)
RETURN(rc);
if (is_only_remote_trans(th)) {
rc = __osp_attr_set(env, dt, attr, th);
- if (rc != 0)
- RETURN(rc);
+ RETURN(rc);
}
/* we're interested in uid/gid changes only */
if (!(attr->la_valid & (LA_UID | LA_GID)))
RETURN(0);
- /* new object, the very first ->attr_set()
- * initializing attributes needs no logging
- * all subsequent one are subject to the
- * logging and synchronization with OST */
- if (o->opo_new) {
- o->opo_new = 0;
- RETURN(0);
- }
-
- if (!is_only_remote_trans(th))
- /*
- * once transaction is committed put proper command on
- * the queue going to our OST
- */
- rc = osp_sync_add(env, o, MDS_SETATTR64_REC, th, attr);
- /* XXX: send new uid/gid to OST ASAP? */
- else
- /* It is for OST-object attr_set directly without updating
- * local MDT-object attribute. It is usually used by LFSCK. */
- rc = osp_md_attr_set(env, dt, attr, th, capa);
+ rc = osp_sync_add(env, o, MDS_SETATTR64_REC, th, attr);
+ /* XXX: send new uid/gid to OST ASAP? */
RETURN(rc);
}
LASSERT(name != NULL);
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_NETWORK) &&
- osp->opd_index == cfs_fail_val &&
- osp_dev2node(osp) == cfs_fail_val)
- RETURN(-ENOTCONN);
+ osp->opd_index == cfs_fail_val) {
+ if (is_ost_obj(&dt->do_lu)) {
+ if (osp_dev2node(osp) == cfs_fail_val)
+ RETURN(-ENOTCONN);
+ } else {
+ if (strcmp(name, XATTR_NAME_LINK) == 0)
+ RETURN(-ENOTCONN);
+ }
+ }
if (unlikely(obj->opo_non_exist))
RETURN(-ENOENT);
oxe = osp_oac_xattr_find_or_add(o, name, buf->lb_len);
if (oxe == NULL) {
- CWARN("%s: Fail to add xattr (%s) to cache for "DFID,
+ CWARN("%s: cannot cache xattr '%s' of "DFID"\n",
dt->do_lu.lo_dev->ld_obd->obd_name,
name, PFID(lu_object_fid(&dt->do_lu)));
osp_oac_xattr_put(oxe);
oxe = tmp;
if (tmp == NULL) {
- CWARN("%s: Fail to update xattr (%s) to cache for "DFID,
+ CWARN("%s: cannot update cached xattr '%s' of "DFID"\n",
dt->do_lu.lo_dev->ld_obd->obd_name,
name, PFID(lu_object_fid(&dt->do_lu)));
spin_lock(&o->opo_lock);
}
}
- /* new object, the very first ->attr_set()
- * initializing attributes needs no logging */
- o->opo_new = 1;
-
/* Only need update last_used oid file, seq file will only be update
* during seq rollover */
osp_objid_buf_prep(&osi->osi_lb, &osi->osi_off,
it->ooi_pos_ent = -1;
it->ooi_obj = dt;
+ it->ooi_attr = attr;
return (struct dt_it *)it;
}
ii->ii_fid.f_oid = osp->opd_index;
ii->ii_fid.f_ver = 0;
ii->ii_flags = II_FL_NOHASH;
+ ii->ii_attrs = osp_dev2node(osp);
} else {
ii->ii_fid = *lu_object_fid(&it->ooi_obj->do_lu);
ii->ii_flags = II_FL_NOHASH | II_FL_NOKEY | II_FL_VARKEY |
II_FL_VARREC;
+ ii->ii_attrs = it->ooi_attr;
}
ii->ii_magic = IDX_INFO_MAGIC;
ii->ii_count = npages * LU_PAGE_COUNT;
ii->ii_hash_start = it->ooi_next;
- ii->ii_attrs = osp_dev2node(osp);
ptlrpc_at_set_req_timeout(req);
* \param[in] env pointer to the thread context
* \param[in] di pointer to the iteration structure
*
+ * \retval positive for end of the directory
* \retval 0 for success
* \retval negative error number on failure
*/
}
it->ooi_cur_idxpage = NULL;
it->ooi_pos_lu_page++;
+
again1:
if (it->ooi_pos_lu_page < LU_PAGE_COUNT) {
it->ooi_cur_idxpage = (void *)it->ooi_cur_page +
* \param[in] env pointer to the thread context
* \param[in] di pointer to the iteration structure
*
+ * \retval positive for end of the directory
* \retval 0 for success
* \retval negative error number on failure
*/
-int osp_orphan_it_next(const struct lu_env *env, struct dt_it *di)
+static int osp_orphan_it_next(const struct lu_env *env, struct dt_it *di)
{
struct osp_it *it = (struct osp_it *)di;
struct lu_idxpage *idxpage;
{
}
-struct dt_key *osp_orphan_it_key(const struct lu_env *env,
- const struct dt_it *di)
+static struct dt_key *osp_orphan_it_key(const struct lu_env *env,
+ const struct dt_it *di)
{
struct osp_it *it = (struct osp_it *)di;
struct lu_orphan_ent *ent = (struct lu_orphan_ent *)it->ooi_ent;
return NULL;
}
-int osp_orphan_it_key_size(const struct lu_env *env, const struct dt_it *di)
+static int osp_orphan_it_key_size(const struct lu_env *env,
+ const struct dt_it *di)
{
return sizeof(struct lu_fid);
}
-int osp_orphan_it_rec(const struct lu_env *env, const struct dt_it *di,
- struct dt_rec *rec, __u32 attr)
+static int osp_orphan_it_rec(const struct lu_env *env, const struct dt_it *di,
+ struct dt_rec *rec, __u32 attr)
{
struct osp_it *it = (struct osp_it *)di;
struct lu_orphan_ent *ent = (struct lu_orphan_ent *)it->ooi_ent;
return 0;
}
-struct dt_object_operations osp_obj_ops = {
+static struct dt_object_operations osp_obj_ops = {
.do_declare_attr_get = osp_declare_attr_get,
.do_attr_get = osp_attr_get,
.do_declare_attr_set = osp_declare_attr_set,