X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_quota_fmt.c;h=a18f388fd5da943c15fd3065ef987f6040c7480e;hb=9edc89c11eb673b0c0da08381a6a779e40ff8ac2;hp=0088d001a3918722b6c9961ad82583eb7d69f2be;hpb=f2a404d1fec2287ef9ffda105727e8cd3f8e0b7b;p=fs%2Flustre-release.git diff --git a/lustre/osd-ldiskfs/osd_quota_fmt.c b/lustre/osd-ldiskfs/osd_quota_fmt.c index 0088d00..a18f388 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, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. * Use is subject to license terms. * * Lustre administrative quota format. @@ -64,28 +64,7 @@ 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,50,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=%d\n", type); ret = sb->s_op->quota_read(sb, type, buf, LUSTRE_DQBLKSIZE, blk << LUSTRE_DQBLKSIZE_BITS); @@ -227,7 +206,7 @@ int walk_block_dqentry(const struct lu_env *env, struct osd_object *obj, ENTRY; /* check if the leaf block has been processed before */ - cfs_list_for_each_entry(leaf, &it->oiq_list, oql_link) { + list_for_each_entry(leaf, &it->oiq_list, oql_link) { if (leaf->oql_blk == blk) RETURN(1); } @@ -244,7 +223,7 @@ int walk_block_dqentry(const struct lu_env *env, struct osd_object *obj, } ret = 1; - if (!le32_to_cpu(dqhead->dqdh_entries)) + if (!le16_to_cpu(dqhead->dqdh_entries)) GOTO(out_buf, ret); ddquot = (struct lustre_disk_dqblk_v2 *)GETENTRIES(buf);