X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosp%2Fosp_object.c;h=a0489f1a4c2ae0d1d9f4af9b46975786c881c5fe;hb=1d371ca47e67a46492ddcfddd7676662362ce0b7;hp=89bbf9f9f7d0446a937c5d09ba1296bdf076a234;hpb=018e6e44fd52e12c9d4ff78ca1a5345b12577fd2;p=fs%2Flustre-release.git diff --git a/lustre/osp/osp_object.c b/lustre/osp/osp_object.c index 89bbf9f..a0489f1 100644 --- a/lustre/osp/osp_object.c +++ b/lustre/osp/osp_object.c @@ -93,7 +93,7 @@ static int osp_declare_attr_set(const struct lu_env *env, struct dt_object *dt, * * 2) send synchronous truncate RPC with just assigned id */ - LASSERT(attr != NULL); + LASSERT(attr); if (attr->la_valid & LA_SIZE && attr->la_size > 0) { LASSERT(!dt_object_exists(dt)); osp_object_assign_id(env, d, o); @@ -102,6 +102,11 @@ static int osp_declare_attr_set(const struct lu_env *env, struct dt_object *dt, 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); @@ -126,6 +131,15 @@ 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); + } + /* * once transaction is committed put proper command on * the queue going to our OST @@ -252,6 +266,10 @@ 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; + osp_objid_buf_prep(osi, d, d->opd_index); rc = dt_record_write(env, d->opd_last_used_file, &osi->osi_lb, &osi->osi_off, th);