Whamcloud - gitweb
LU-5396 mdc: (and lmv, mgc, osc) make some functions static
[fs/lustre-release.git] / lustre / osp / osp_object.c
index 8d9f51a..f8aa9af 100644 (file)
@@ -627,10 +627,6 @@ static int __osp_attr_set(const struct lu_env *env, struct dt_object *dt,
                RETURN(0);
 
        if (!is_only_remote_trans(th)) {
-               if (o->opo_new)
-                       /* no need in logging for new objects being created */
-                       RETURN(0);
-
                /*
                 * track all UID/GID changes via llog
                 */
@@ -745,9 +741,6 @@ static int osp_attr_set(const struct lu_env *env, struct dt_object *dt,
 
        if (is_only_remote_trans(th)) {
                rc = __osp_attr_set(env, dt, attr, th);
-               if (rc == 0 && o->opo_new)
-                       o->opo_new = 0;
-
                RETURN(rc);
        }
 
@@ -755,15 +748,6 @@ static int osp_attr_set(const struct lu_env *env, struct dt_object *dt,
        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);
-       }
-
        rc = osp_sync_add(env, o, MDS_SETATTR64_REC, th, attr);
        /* XXX: send new uid/gid to OST ASAP? */
 
@@ -1148,7 +1132,7 @@ static int __osp_xattr_set(const struct lu_env *env, struct dt_object *dt,
 
        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)));
 
@@ -1163,7 +1147,7 @@ static int __osp_xattr_set(const struct lu_env *env, struct dt_object *dt,
                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);
@@ -1569,10 +1553,6 @@ static int osp_object_create(const struct lu_env *env, struct dt_object *dt,
                }
        }
 
-       /* 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,
@@ -1995,7 +1975,7 @@ again0:
  * \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;
@@ -2036,8 +2016,8 @@ void osp_it_put(const struct lu_env *env, struct dt_it *di)
 {
 }
 
-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;
@@ -2048,13 +2028,14 @@ struct dt_key *osp_orphan_it_key(const struct lu_env *env,
        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;
@@ -2158,7 +2139,7 @@ static int osp_index_try(const struct lu_env *env,
        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,