X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosc%2Fosc_create.c;h=daa80490c1da3718d5a93e4214aafd92c5a9a995;hb=090c677210ee2946d99c71412e4ff762bb300f4f;hp=6d3b80ff8b37cdca8a20f5aa660255a6109308db;hpb=ff17cc7e0282d9b1522810e0c5d12171c4d46a2d;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index 6d3b80f..daa8049 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -36,7 +36,8 @@ # include # include # include -# include +# include +# include # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) # include # include @@ -47,13 +48,11 @@ # include #endif -#ifndef __CYGWIN__ -# include -# include -#else +#ifdef __CYGWIN__ # include #endif +# include #include #include "osc_internal.h" @@ -124,7 +123,9 @@ static int oscc_internal_create(struct osc_creator *oscc) spin_lock(&oscc->oscc_lock); body->oa.o_id = oscc->oscc_last_id + oscc->oscc_grow_count; - body->oa.o_valid |= OBD_MD_FLID; + body->oa.o_gr = oscc->oscc_gr; + LASSERT(body->oa.o_gr > 0); + body->oa.o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP; CDEBUG(D_INFO, "preallocating through id "LPU64" (last used "LPU64")\n", body->oa.o_id, oscc->oscc_next_id); spin_unlock(&oscc->oscc_lock); @@ -212,8 +213,13 @@ int osc_create(struct obd_export *exp, struct obdo *oa, ENTRY; LASSERT(oa); LASSERT(ea); + LASSERT(oa->o_valid & OBD_MD_FLGROUP); + LASSERT(oa->o_gr > 0); + + LASSERT(oscc->oscc_gr == 0 || oscc->oscc_gr == oa->o_gr); + oscc->oscc_gr = oa->o_gr; - if ((oa->o_valid & OBD_MD_FLGROUP) && (oa->o_gr != 0)) + if (oa->o_gr == FILTER_GROUP_LLOG || oa->o_gr == FILTER_GROUP_ECHO) RETURN(osc_real_create(exp, oa, ea, oti)); if ((oa->o_valid & OBD_MD_FLFLAGS) && @@ -275,7 +281,9 @@ int osc_create(struct obd_export *exp, struct obdo *oa, if (oscc->oscc_last_id >= oscc->oscc_next_id) { memcpy(oa, &oscc->oscc_oa, sizeof(*oa)); oa->o_id = oscc->oscc_next_id; + oa->o_gr = oscc->oscc_gr; lsm->lsm_object_id = oscc->oscc_next_id; + lsm->lsm_object_gr = oscc->oscc_gr; *ea = lsm; oscc->oscc_next_id++; try_again = 0; @@ -291,7 +299,8 @@ int osc_create(struct obd_export *exp, struct obdo *oa, } if (rc == 0) - CDEBUG(D_INFO, "returning objid "LPU64"\n", lsm->lsm_object_id); + CDEBUG(D_INFO, "returning objid "LPU64"/"LPU64"\n", + lsm->lsm_object_id, lsm->lsm_object_gr); else if (*ea == NULL) obd_free_memmd(exp, &lsm); RETURN(rc);