X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_quota_fmt.c;h=9cc5c7cb035a746b7091bd8f9af0040e6f0d43a4;hb=423bdae48e1a0ed602f524ba41a2c83c67f4716a;hp=482f817acfc9823a59fa08bac525a62e46a4c80e;hpb=2b294992edce5af7b79d4300ed3aa1ea6a8db850;p=fs%2Flustre-release.git diff --git a/lustre/osd-ldiskfs/osd_quota_fmt.c b/lustre/osd-ldiskfs/osd_quota_fmt.c index 482f817..9cc5c7c 100644 --- a/lustre/osd-ldiskfs/osd_quota_fmt.c +++ b/lustre/osd-ldiskfs/osd_quota_fmt.c @@ -21,7 +21,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2012, 2014, Intel Corporation. + * Copyright (c) 2012, 2016, Intel Corporation. * Use is subject to license terms. * * Lustre administrative quota format. @@ -64,28 +64,8 @@ static ssize_t quota_read_blk(const struct lu_env *env, ENTRY; memset(buf, 0, LUSTRE_DQBLKSIZE); - -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) - /* type is set as -1 when reading old admin quota file */ - if (type != USRQUOTA && type != GRPQUOTA) { - struct lu_buf lu_buffer; - loff_t pos; - - lu_buffer.lb_buf = buf; - lu_buffer.lb_len = LUSTRE_DQBLKSIZE; - pos = blk << LUSTRE_DQBLKSIZE_BITS; - - ret = dt_record_read(env, &obj->oo_dt, &lu_buffer, &pos); - - if (ret == 0) - ret = LUSTRE_DQBLKSIZE; - else if (ret == -EBADR || ret == -EFAULT) - ret = 0; - RETURN(ret); - } -#else -#warning "remove old quota compatibility code" -#endif + LASSERTF((type == USRQUOTA || type == GRPQUOTA || type == PRJQUOTA), + "type=%d\n", type); ret = sb->s_op->quota_read(sb, type, buf, LUSTRE_DQBLKSIZE, blk << LUSTRE_DQBLKSIZE_BITS); @@ -307,12 +287,10 @@ int walk_tree_dqentry(const struct lu_env *env, struct osd_object *obj, depth + 1, 0, it); else ret = walk_block_dqentry(env, obj, type, blk, 0, it); - } - if (ret == 0) { /* Entry found */ - it->oiq_blk[depth + 1] = blk; - it->oiq_index[depth] = index; } + it->oiq_blk[depth + 1] = blk; + it->oiq_index[depth] = index; out_buf: freedqbuf(buf);