4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2012, 2017, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
30 * Lustre is a trademark of Sun Microsystems, Inc.
36 * Author: Nikita Danilov <nikita@clusterfs.com>
39 #define DEBUG_SUBSYSTEM S_OSD
41 #include <linux/module.h>
44 * struct OBD_{ALLOC,FREE}*()
48 #include <obd_support.h>
51 #include <lustre_fid.h>
52 #include <dt_object.h>
53 #include <lustre_scrub.h>
56 /* osd_lookup(), struct osd_thread_info */
57 #include "osd_internal.h"
59 unsigned int osd_oi_count = OSD_OI_FID_NR;
60 module_param(osd_oi_count, int, 0444);
61 MODULE_PARM_DESC(osd_oi_count, "Number of Object Index containers to be created, it's only valid for new filesystem.");
63 static struct dt_index_features oi_feat = {
64 .dif_flags = DT_IND_UPDATE,
65 .dif_recsize_min = sizeof(struct osd_inode_id),
66 .dif_recsize_max = sizeof(struct osd_inode_id),
70 #define OSD_OI_NAME_BASE "oi.16"
72 static void osd_oi_table_put(struct osd_thread_info *info,
73 struct osd_oi **oi_table, unsigned int oi_count)
75 struct iam_container *bag;
78 for (i = 0; i < oi_count; i++) {
79 if (oi_table[i] == NULL)
82 LASSERT(oi_table[i]->oi_inode != NULL);
84 bag = &(oi_table[i]->oi_dir.od_container);
85 if (bag->ic_object == oi_table[i]->oi_inode)
86 iam_container_fini(bag);
87 iput(oi_table[i]->oi_inode);
88 oi_table[i]->oi_inode = NULL;
89 OBD_FREE_PTR(oi_table[i]);
94 static int osd_oi_index_create_one(struct osd_thread_info *info,
95 struct osd_device *osd, const char *name,
96 struct dt_index_features *feat)
98 const struct lu_env *env = info->oti_env;
99 struct osd_inode_id *id = &info->oti_id;
100 struct buffer_head *bh;
102 struct ldiskfs_dir_entry_2 *de;
103 struct dentry *dentry;
104 struct super_block *sb = osd_sb(osd);
105 struct inode *dir = sb->s_root->d_inode;
109 dentry = osd_child_dentry_by_inode(env, dir, name, strlen(name));
110 bh = osd_ldiskfs_find_entry(dir, &dentry->d_name, &de, NULL, NULL);
112 osd_id_gen(id, le32_to_cpu(de->inode), OSD_OII_NOGEN);
114 inode = osd_iget(info, osd, id);
115 if (!IS_ERR(inode)) {
117 inode = ERR_PTR(-EEXIST);
119 return PTR_ERR(inode);
122 if (osd->od_dt_dev.dd_rdonly)
125 jh = osd_journal_start_sb(sb, LDISKFS_HT_MISC, 100);
129 inode = ldiskfs_create_inode(jh, dir, (S_IFREG | S_IRUGO | S_IWUSR),
132 ldiskfs_journal_stop(jh);
133 return PTR_ERR(inode);
136 ldiskfs_set_inode_state(inode, LDISKFS_STATE_LUSTRE_NOSCRUB);
137 unlock_new_inode(inode);
139 if (feat->dif_flags & DT_IND_VARKEY)
140 rc = iam_lvar_create(inode, feat->dif_keysize_max,
141 feat->dif_ptrsize, feat->dif_recsize_max,
144 rc = iam_lfix_create(inode, feat->dif_keysize_max,
145 feat->dif_ptrsize, feat->dif_recsize_max,
147 dentry = osd_child_dentry_by_inode(env, dir, name, strlen(name));
148 rc = osd_ldiskfs_add_entry(info, osd, jh, dentry, inode, NULL);
149 ldiskfs_journal_stop(jh);
154 static struct inode *osd_oi_index_open(struct osd_thread_info *info,
155 struct osd_device *osd,
157 struct dt_index_features *f,
160 struct dentry *dentry;
164 dentry = osd_lookup_one_len_unlocked(osd, name, osd_sb(osd)->s_root,
167 return ERR_CAST(dentry);
169 if (dentry->d_inode) {
170 LASSERT(!is_bad_inode(dentry->d_inode));
171 inode = dentry->d_inode;
172 atomic_inc(&inode->i_count);
179 shrink_dcache_parent(osd_sb(osd)->s_root);
181 return ERR_PTR(-ENOENT);
183 rc = osd_oi_index_create_one(info, osd, name, f);
187 dentry = osd_lookup_one_len_unlocked(osd, name, osd_sb(osd)->s_root,
190 return ERR_CAST(dentry);
192 if (dentry->d_inode) {
193 LASSERT(!is_bad_inode(dentry->d_inode));
194 inode = dentry->d_inode;
195 atomic_inc(&inode->i_count);
200 return ERR_PTR(-ENOENT);
204 * Open an OI(Ojbect Index) container.
206 * \param name Name of OI container
207 * \param objp Pointer of returned OI
210 * \retval -ve failure
212 static int osd_oi_open(struct osd_thread_info *info, struct osd_device *osd,
213 char *name, struct osd_oi **oi_slot, bool create)
215 struct osd_directory *dir;
216 struct iam_container *bag;
223 oi_feat.dif_keysize_min = sizeof(struct lu_fid);
224 oi_feat.dif_keysize_max = sizeof(struct lu_fid);
226 inode = osd_oi_index_open(info, osd, name, &oi_feat, create);
228 RETURN(PTR_ERR(inode));
229 ldiskfs_set_inode_state(inode, LDISKFS_STATE_IAM);
231 if (!osd->od_dt_dev.dd_rdonly) {
232 /* 'What the @fid is' is not imporatant, because these objects
233 * have no OI mappings, and only are visible inside the OSD.
235 lu_igif_build(&info->oti_fid, inode->i_ino,
236 inode->i_generation);
237 rc = osd_ea_fid_set(info, inode, &info->oti_fid,
245 GOTO(out_inode, rc = -ENOMEM);
247 oi->oi_inode = inode;
250 bag = &dir->od_container;
251 rc = iam_container_init(bag, &dir->od_descr, inode);
255 rc = iam_container_setup(bag);
257 GOTO(out_container, rc);
263 iam_container_fini(bag);
272 * Open OI(Object Index) table.
273 * If \a oi_count is zero, which means caller doesn't know how many OIs there
274 * will be, this function can either return 0 for new filesystem, or number
275 * of OIs on existed filesystem.
277 * If \a oi_count is non-zero, which means caller does know number of OIs on
278 * filesystem, this function should return the exactly same number on
279 * success, or error code in failure.
281 * \param oi_count Number of expected OI containers
282 * \param create Create OIs if doesn't exist
284 * \retval +ve number of opened OI containers
285 * \retval 0 no OI containers found
286 * \retval -ve failure
289 osd_oi_table_open(struct osd_thread_info *info, struct osd_device *osd,
290 struct osd_oi **oi_table, unsigned int oi_count, bool create)
292 struct scrub_file *sf = &osd->od_scrub.os_scrub.os_file;
298 /* NB: oi_count != 0 means that we have already created/known all OIs
299 * and have known exact number of OIs.
301 LASSERT(oi_count <= OSD_OI_FID_NR_MAX);
303 for (i = 0; i < (oi_count != 0 ? oi_count : OSD_OI_FID_NR_MAX); i++) {
304 char name[sizeof(OSD_OI_NAME_BASE) + 3 * sizeof(i) + 1];
306 if (oi_table[i] != NULL) {
311 snprintf(name, sizeof(name), "%s.%d", OSD_OI_NAME_BASE, i);
312 rc = osd_oi_open(info, osd, name, &oi_table[i], create);
318 if (rc == -ENOENT && create == false) {
323 ldiskfs_set_bit(i, sf->sf_oi_bitmap);
327 CERROR("%s: can't open %s: rc = %d\n",
328 osd_dev2name(osd), name, rc);
330 CERROR("%s: expect to open total %d OI files.\n",
331 osd_dev2name(osd), oi_count);
336 osd_oi_table_put(info, oi_table, oi_count > 0 ? oi_count : i);
343 static int osd_remove_oi_one(struct osd_device *osd, struct dentry *parent,
344 const char *name, int namelen)
346 struct dentry *child;
349 child = osd_lookup_one_len_unlocked(osd, name, parent, namelen);
353 rc = ll_vfs_unlink(parent->d_inode, child);
357 return rc == -ENOENT ? 0 : rc;
360 static int osd_remove_ois(struct osd_thread_info *info, struct osd_device *osd)
367 if (osd->od_dt_dev.dd_rdonly)
370 for (i = 0; i < OSD_OI_FID_NR_MAX; i++) {
371 namelen = snprintf(name, sizeof(name), "%s.%d",
372 OSD_OI_NAME_BASE, i);
373 rc = osd_remove_oi_one(osd, osd_sb(osd)->s_root, name, namelen);
376 "%s: fail to remove the stale OI file %s: rc = %d\n",
377 osd_dev2name(osd), name, rc);
382 namelen = snprintf(name, sizeof(name), "%s", OSD_OI_NAME_BASE);
383 rc = osd_remove_oi_one(osd, osd_sb(osd)->s_root, name, namelen);
385 CERROR("%s: fail to remove the stale OI file %s: rc = %d\n",
386 osd_dev2name(osd), name, rc);
391 int osd_oi_init(struct osd_thread_info *info, struct osd_device *osd,
394 struct lustre_scrub *scrub = &osd->od_scrub.os_scrub;
395 struct scrub_file *sf = &scrub->os_file;
401 if (unlikely(sf->sf_oi_count & (sf->sf_oi_count - 1)) != 0) {
402 LCONSOLE_WARN("%s: Invalid OI count in scrub file %d\n",
403 osd_dev2name(osd), sf->sf_oi_count);
408 rc = osd_remove_ois(info, osd);
413 OBD_ALLOC_PTR_ARRAY(oi, OSD_OI_FID_NR_MAX);
417 /* try to open existing multiple OIs first */
418 count = osd_oi_table_open(info, osd, oi, sf->sf_oi_count, false);
420 GOTO(out, rc = count);
423 if (count == sf->sf_oi_count)
424 GOTO(out, rc = count);
426 if (sf->sf_oi_count == 0) {
427 if (likely((count & (count - 1)) == 0))
428 GOTO(out, rc = count);
431 "%s: invalid oi count %d, remove them, then set it to %d\n",
432 osd_dev2name(osd), count, osd_oi_count);
433 osd_oi_table_put(info, oi, count);
434 rc = osd_remove_ois(info, osd);
438 sf->sf_oi_count = osd_oi_count;
441 scrub_file_reset(scrub, osd->od_uuid, SF_RECREATED);
442 count = sf->sf_oi_count;
446 /* if previous failed then try found single OI from old filesystem */
447 rc = osd_oi_open(info, osd, OSD_OI_NAME_BASE, &oi[0], false);
448 if (rc == 0) { /* found single OI from old filesystem */
450 ldiskfs_clear_bit(0, sf->sf_oi_bitmap);
451 if (sf->sf_success_count == 0)
452 /* XXX: There is one corner case that if the OI_scrub
453 * file crashed or lost and we regard it upgrade,
454 * then we allow IGIF lookup to bypass OI files.
456 * The risk is that osd_fid_lookup() may found
457 * a wrong inode with the given IGIF especially
458 * when the MDT has performed file-level backup
459 * and restored after former upgrading from 1.8
460 * to 2.x. Fortunately, the osd_fid_lookup()can
461 * verify the inode to decrease the risk.
463 scrub_file_reset(scrub, osd->od_uuid, SF_UPGRADE);
465 } else if (rc != -ENOENT) {
466 CERROR("%s: can't open %s: rc = %d\n",
467 osd_dev2name(osd), OSD_OI_NAME_BASE, rc);
471 if (sf->sf_oi_count > 0) {
474 count = sf->sf_oi_count;
475 memset(sf->sf_oi_bitmap, 0, SCRUB_OI_BITMAP_SIZE);
476 for (i = 0; i < count; i++)
477 ldiskfs_set_bit(i, sf->sf_oi_bitmap);
478 scrub_file_reset(scrub, osd->od_uuid, SF_RECREATED);
480 count = sf->sf_oi_count = osd_oi_count;
484 rc = scrub_file_store(info->oti_env, scrub);
486 osd_oi_table_put(info, oi, count);
490 /* No OIs exist, new filesystem, create OI objects */
491 rc = osd_oi_table_open(info, osd, oi, count, true);
492 LASSERT(ergo(rc >= 0, rc == count));
498 OBD_FREE_PTR_ARRAY(oi, OSD_OI_FID_NR_MAX);
500 LASSERTF((rc & (rc - 1)) == 0, "Invalid OI count %d\n", rc);
502 osd->od_oi_table = oi;
503 osd->od_oi_count = rc;
504 if (sf->sf_oi_count != rc) {
505 sf->sf_oi_count = rc;
506 rc = scrub_file_store(info->oti_env, scrub);
508 osd_oi_table_put(info, oi, count);
509 OBD_FREE_PTR_ARRAY(oi, OSD_OI_FID_NR_MAX);
519 void osd_oi_fini(struct osd_thread_info *info, struct osd_device *osd)
521 if (unlikely(!osd->od_oi_table))
524 osd_oi_table_put(info, osd->od_oi_table, osd->od_oi_count);
526 OBD_FREE_PTR_ARRAY(osd->od_oi_table, OSD_OI_FID_NR_MAX);
527 osd->od_oi_table = NULL;
530 static inline int fid_is_fs_root(const struct lu_fid *fid)
532 /* Map root inode to special local object FID */
533 return (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE &&
534 fid_oid(fid) == OSD_FS_ROOT_OID));
537 static int osd_oi_iam_lookup(struct osd_thread_info *oti,
538 struct osd_oi *oi, struct dt_rec *rec,
539 const struct dt_key *key)
541 struct iam_container *bag;
542 struct iam_iterator *it = &oti->oti_idx_it;
543 struct iam_path_descr *ipd;
548 LASSERT(oi->oi_inode);
550 bag = &oi->oi_dir.od_container;
551 ipd = osd_idx_ipd_get(oti->oti_env, bag);
555 /* got ipd now we can start iterator. */
556 iam_it_init(it, bag, 0, ipd);
558 rc = iam_it_get(it, (struct iam_key *)key);
560 iam_reccpy(&it->ii_path.ip_leaf, (struct iam_rec *)rec);
563 osd_ipd_put(oti->oti_env, bag, ipd);
565 LINVRNT(osd_invariant(obj));
570 int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
571 const struct lu_fid *fid, enum oi_check_flags flags)
573 struct lu_seq_range *range = &info->oti_seq_range;
577 if (flags & OI_KNOWN_ON_OST)
580 if (unlikely(fid_is_local_file(fid) || fid_is_igif(fid) ||
581 fid_is_llog(fid)) || fid_is_name_llog(fid) ||
585 if (fid_is_idif(fid) || fid_is_last_id(fid))
588 if (!(flags & OI_CHECK_FLD))
591 if (osd_seq_site(osd)->ss_server_fld == NULL)
594 rc = osd_fld_lookup(info->oti_env, osd, fid_seq(fid), range);
596 /* During upgrade, OST FLDB might not be loaded because
597 * OST FLDB is not created until 2.6, so if some DNE
598 * filesystem upgrade from 2.5 to 2.7/2.8, they will
599 * not be able to find the sequence from local FLDB
600 * cache see fld_index_init().
602 if (rc == -ENOENT && osd->od_is_ost)
606 CERROR("%s: lookup FLD "DFID": rc = %d\n",
607 osd_name(osd), PFID(fid), rc);
611 if (fld_range_is_ost(range))
617 static int __osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
618 const struct lu_fid *fid, struct osd_inode_id *id)
620 struct lu_fid *oi_fid = &info->oti_fid2;
623 fid_cpu_to_be(oi_fid, fid);
624 rc = osd_oi_iam_lookup(info, osd_fid2oi(osd, fid), (struct dt_rec *)id,
625 (const struct dt_key *)oi_fid);
627 osd_id_unpack(id, id);
629 } else if (rc == 0) {
635 int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
636 const struct lu_fid *fid, struct osd_inode_id *id,
637 enum oi_check_flags flags)
639 if (unlikely(fid_is_last_id(fid)))
640 return osd_obj_spec_lookup(info, osd, fid, id, flags);
642 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
643 return osd_obj_map_lookup(info, osd, fid, id);
645 if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) {
648 if (fid_is_fs_root(fid)) {
649 osd_id_gen(id, osd_sb(osd)->s_root->d_inode->i_ino,
650 osd_sb(osd)->s_root->d_inode->i_generation);
653 if (unlikely(fid_is_acct(fid)))
654 return osd_acct_obj_lookup(info, osd, fid, id);
656 /* For other special FIDs, try OI first, then do spec lookup */
657 rc = __osd_oi_lookup(info, osd, fid, id);
659 return osd_obj_spec_lookup(info, osd, fid, id, flags);
663 if (!osd->od_igif_inoi && fid_is_igif(fid)) {
664 osd_id_gen(id, lu_igif_ino(fid), lu_igif_gen(fid));
668 return __osd_oi_lookup(info, osd, fid, id);
671 static int osd_oi_iam_refresh(struct osd_thread_info *oti, struct osd_oi *oi,
672 const struct dt_rec *rec, const struct dt_key *key,
673 handle_t *th, bool insert)
675 struct iam_container *bag;
676 struct iam_path_descr *ipd;
681 LASSERT(oi->oi_inode);
682 dquot_initialize(oi->oi_inode);
684 bag = &oi->oi_dir.od_container;
685 ipd = osd_idx_ipd_get(oti->oti_env, bag);
686 if (unlikely(ipd == NULL))
690 LASSERT(th->h_transaction != NULL);
692 rc = iam_insert(th, bag, (const struct iam_key *)key,
693 (const struct iam_rec *)rec, ipd);
695 rc = iam_update(th, bag, (const struct iam_key *)key,
696 (const struct iam_rec *)rec, ipd);
697 osd_ipd_put(oti->oti_env, bag, ipd);
698 LINVRNT(osd_invariant(obj));
702 int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
703 const struct lu_fid *fid, const struct osd_inode_id *id,
704 handle_t *th, enum oi_check_flags flags, bool *exist)
706 struct lu_fid *oi_fid = &info->oti_fid2;
707 struct osd_inode_id *oi_id = &info->oti_id2;
710 if (unlikely(fid_is_last_id(fid)))
711 return osd_obj_spec_insert(info, osd, fid, id, th);
713 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
714 return osd_obj_map_insert(info, osd, fid, id, th);
716 fid_cpu_to_be(oi_fid, fid);
717 osd_id_pack(oi_id, id);
718 rc = osd_oi_iam_refresh(info, osd_fid2oi(osd, fid),
719 (const struct dt_rec *)oi_id,
720 (const struct dt_key *)oi_fid, th, true);
723 struct lustre_mdt_attrs *lma = &info->oti_ost_attrs.loa_lma;
728 rc = osd_oi_lookup(info, osd, fid, oi_id, 0);
732 if (unlikely(osd_id_eq(id, oi_id)))
735 /* Check whether the mapping for oi_id is valid or not. */
736 inode = osd_iget(info, osd, oi_id);
739 if (rc == -ENOENT || rc == -ESTALE)
744 /* The EA inode should NOT be in OI, old OI scrub may added
745 * such OI mapping by wrong, replace it.
747 if (unlikely(osd_is_ea_inode(inode))) {
752 rc = osd_get_lma(info, inode, &info->oti_obj_dentry,
753 &info->oti_ost_attrs);
761 if (!(lma->lma_compat & LMAC_NOT_IN_OI) &&
762 lu_fid_eq(fid, &lma->lma_self_fid)) {
764 "%s: the FID "DFID" is used by two objects: %u/%u %u/%u\n",
765 osd_dev2name(osd), PFID(fid), oi_id->oii_ino,
766 oi_id->oii_gen, id->oii_ino, id->oii_gen);
771 osd_id_pack(oi_id, id);
772 rc = osd_oi_iam_refresh(info, osd_fid2oi(osd, fid),
773 (const struct dt_rec *)oi_id,
774 (const struct dt_key *)oi_fid, th,
783 if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
784 rc = osd_obj_spec_insert(info, osd, fid, id, th);
788 static int osd_oi_iam_delete(struct osd_thread_info *oti, struct osd_oi *oi,
789 const struct dt_key *key, handle_t *th)
791 struct iam_container *bag;
792 struct iam_path_descr *ipd;
797 LASSERT(oi->oi_inode);
798 dquot_initialize(oi->oi_inode);
800 bag = &oi->oi_dir.od_container;
801 ipd = osd_idx_ipd_get(oti->oti_env, bag);
802 if (unlikely(ipd == NULL))
806 LASSERT(th->h_transaction != NULL);
808 rc = iam_delete(th, bag, (const struct iam_key *)key, ipd);
809 osd_ipd_put(oti->oti_env, bag, ipd);
810 LINVRNT(osd_invariant(obj));
814 int osd_oi_delete(struct osd_thread_info *info,
815 struct osd_device *osd, const struct lu_fid *fid,
816 handle_t *th, enum oi_check_flags flags)
818 struct lu_fid *oi_fid = &info->oti_fid2;
820 /* clear idmap cache */
821 if (lu_fid_eq(fid, &info->oti_cache.oic_fid))
822 fid_zero(&info->oti_cache.oic_fid);
824 if (fid_is_last_id(fid))
827 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
828 return osd_obj_map_delete(info, osd, fid, th);
830 fid_cpu_to_be(oi_fid, fid);
831 return osd_oi_iam_delete(info, osd_fid2oi(osd, fid),
832 (const struct dt_key *)oi_fid, th);
835 int osd_oi_update(struct osd_thread_info *info, struct osd_device *osd,
836 const struct lu_fid *fid, const struct osd_inode_id *id,
837 handle_t *th, enum oi_check_flags flags)
839 struct lu_fid *oi_fid = &info->oti_fid2;
840 struct osd_inode_id *oi_id = &info->oti_id2;
843 if (unlikely(fid_is_last_id(fid)))
844 return osd_obj_spec_update(info, osd, fid, id, th);
846 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
847 return osd_obj_map_update(info, osd, fid, id, th);
849 fid_cpu_to_be(oi_fid, fid);
850 osd_id_pack(oi_id, id);
851 rc = osd_oi_iam_refresh(info, osd_fid2oi(osd, fid),
852 (const struct dt_rec *)oi_id,
853 (const struct dt_key *)oi_fid, th, false);
857 if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
858 rc = osd_obj_spec_update(info, osd, fid, id, th);
862 int osd_oi_mod_init(void)
864 if (osd_oi_count == 0 || osd_oi_count > OSD_OI_FID_NR_MAX)
865 osd_oi_count = OSD_OI_FID_NR;
867 if ((osd_oi_count & (osd_oi_count - 1)) != 0) {
868 LCONSOLE_WARN("Round up oi_count %d to power2 %d\n",
869 osd_oi_count, size_roundup_power2(osd_oi_count));
870 osd_oi_count = size_roundup_power2(osd_oi_count);