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/
35 * Author: Nikita Danilov <nikita@clusterfs.com>
38 #define DEBUG_SUBSYSTEM S_OSD
40 #include <linux/module.h>
43 * struct OBD_{ALLOC,FREE}*()
46 #include <obd_support.h>
47 #include <libcfs/libcfs.h>
50 #include <lustre_fid.h>
51 #include <dt_object.h>
52 #include <lustre_scrub.h>
55 /* osd_lookup(), struct osd_thread_info */
56 #include "osd_internal.h"
58 unsigned int osd_oi_count = OSD_OI_FID_NR;
59 module_param(osd_oi_count, int, 0444);
60 MODULE_PARM_DESC(osd_oi_count, "Number of Object Index containers to be created, it's only valid for new filesystem.");
62 static struct dt_index_features oi_feat = {
63 .dif_flags = DT_IND_UPDATE,
64 .dif_recsize_min = sizeof(struct osd_inode_id),
65 .dif_recsize_max = sizeof(struct osd_inode_id),
69 #define OSD_OI_NAME_BASE "oi.16"
71 static void osd_oi_table_put(struct osd_thread_info *info,
72 struct osd_oi **oi_table, unsigned int oi_count)
74 struct iam_container *bag;
77 for (i = 0; i < oi_count; i++) {
78 if (oi_table[i] == NULL)
81 LASSERT(oi_table[i]->oi_inode != NULL);
83 bag = &(oi_table[i]->oi_dir.od_container);
84 if (bag->ic_object == oi_table[i]->oi_inode)
85 iam_container_fini(bag);
86 iput(oi_table[i]->oi_inode);
87 oi_table[i]->oi_inode = NULL;
88 OBD_FREE_PTR(oi_table[i]);
93 static int osd_oi_index_create_one(struct osd_thread_info *info,
94 struct osd_device *osd, const char *name,
95 struct dt_index_features *feat)
97 const struct lu_env *env = info->oti_env;
98 struct osd_inode_id *id = &info->oti_id;
99 struct buffer_head *bh;
101 struct ldiskfs_dir_entry_2 *de;
102 struct dentry *dentry;
103 struct super_block *sb = osd_sb(osd);
104 struct inode *dir = sb->s_root->d_inode;
108 dentry = osd_child_dentry_by_inode(env, dir, name, strlen(name));
109 bh = osd_ldiskfs_find_entry(dir, &dentry->d_name, &de, NULL, NULL);
111 osd_id_gen(id, le32_to_cpu(de->inode), OSD_OII_NOGEN);
113 inode = osd_iget(info, osd, id);
114 if (!IS_ERR(inode)) {
116 inode = ERR_PTR(-EEXIST);
118 return PTR_ERR(inode);
121 if (osd->od_dt_dev.dd_rdonly)
124 jh = osd_journal_start_sb(sb, LDISKFS_HT_MISC, 100);
128 inode = ldiskfs_create_inode(jh, dir, (S_IFREG | S_IRUGO | S_IWUSR),
131 ldiskfs_journal_stop(jh);
132 return PTR_ERR(inode);
135 ldiskfs_set_inode_state(inode, LDISKFS_STATE_LUSTRE_NOSCRUB);
136 unlock_new_inode(inode);
138 if (feat->dif_flags & DT_IND_VARKEY)
139 rc = iam_lvar_create(inode, feat->dif_keysize_max,
140 feat->dif_ptrsize, feat->dif_recsize_max,
143 rc = iam_lfix_create(inode, feat->dif_keysize_max,
144 feat->dif_ptrsize, feat->dif_recsize_max,
146 dentry = osd_child_dentry_by_inode(env, dir, name, strlen(name));
147 rc = osd_ldiskfs_add_entry(info, osd, jh, dentry, inode, NULL);
148 ldiskfs_journal_stop(jh);
153 static struct inode *osd_oi_index_open(struct osd_thread_info *info,
154 struct osd_device *osd,
156 struct dt_index_features *f,
159 struct dentry *dentry;
163 dentry = osd_lookup_one_len_unlocked(osd, name, osd_sb(osd)->s_root,
166 return ERR_CAST(dentry);
168 if (dentry->d_inode) {
169 LASSERT(!is_bad_inode(dentry->d_inode));
170 inode = dentry->d_inode;
171 atomic_inc(&inode->i_count);
178 shrink_dcache_parent(osd_sb(osd)->s_root);
180 return ERR_PTR(-ENOENT);
182 rc = osd_oi_index_create_one(info, osd, name, f);
186 dentry = osd_lookup_one_len_unlocked(osd, name, osd_sb(osd)->s_root,
189 return ERR_CAST(dentry);
191 if (dentry->d_inode) {
192 LASSERT(!is_bad_inode(dentry->d_inode));
193 inode = dentry->d_inode;
194 atomic_inc(&inode->i_count);
199 return ERR_PTR(-ENOENT);
203 * Open an OI(Ojbect Index) container.
205 * \param name Name of OI container
206 * \param objp Pointer of returned OI
209 * \retval -ve failure
211 static int osd_oi_open(struct osd_thread_info *info, struct osd_device *osd,
212 char *name, struct osd_oi **oi_slot, bool create)
214 struct osd_directory *dir;
215 struct iam_container *bag;
222 oi_feat.dif_keysize_min = sizeof(struct lu_fid);
223 oi_feat.dif_keysize_max = sizeof(struct lu_fid);
225 inode = osd_oi_index_open(info, osd, name, &oi_feat, create);
227 RETURN(PTR_ERR(inode));
228 ldiskfs_set_inode_state(inode, LDISKFS_STATE_IAM);
230 if (!osd->od_dt_dev.dd_rdonly) {
231 /* 'What the @fid is' is not imporatant, because these objects
232 * have no OI mappings, and only are visible inside the OSD.
234 lu_igif_build(&info->oti_fid, inode->i_ino,
235 inode->i_generation);
236 rc = osd_ea_fid_set(info, inode, &info->oti_fid,
244 GOTO(out_inode, rc = -ENOMEM);
246 oi->oi_inode = inode;
249 bag = &dir->od_container;
250 rc = iam_container_init(bag, &dir->od_descr, inode);
254 rc = iam_container_setup(bag);
256 GOTO(out_container, rc);
262 iam_container_fini(bag);
271 * Open OI(Object Index) table.
272 * If \a oi_count is zero, which means caller doesn't know how many OIs there
273 * will be, this function can either return 0 for new filesystem, or number
274 * of OIs on existed filesystem.
276 * If \a oi_count is non-zero, which means caller does know number of OIs on
277 * filesystem, this function should return the exactly same number on
278 * success, or error code in failure.
280 * \param oi_count Number of expected OI containers
281 * \param create Create OIs if doesn't exist
283 * \retval +ve number of opened OI containers
284 * \retval 0 no OI containers found
285 * \retval -ve failure
288 osd_oi_table_open(struct osd_thread_info *info, struct osd_device *osd,
289 struct osd_oi **oi_table, unsigned int oi_count, bool create)
291 struct scrub_file *sf = &osd->od_scrub.os_scrub.os_file;
297 /* NB: oi_count != 0 means that we have already created/known all OIs
298 * and have known exact number of OIs.
300 LASSERT(oi_count <= OSD_OI_FID_NR_MAX);
302 for (i = 0; i < (oi_count != 0 ? oi_count : OSD_OI_FID_NR_MAX); i++) {
303 char name[sizeof(OSD_OI_NAME_BASE) + 3 * sizeof(i) + 1];
305 if (oi_table[i] != NULL) {
310 snprintf(name, sizeof(name), "%s.%d", OSD_OI_NAME_BASE, i);
311 rc = osd_oi_open(info, osd, name, &oi_table[i], create);
317 if (rc == -ENOENT && create == false) {
322 ldiskfs_set_bit(i, sf->sf_oi_bitmap);
326 CERROR("%s: can't open %s: rc = %d\n",
327 osd_dev2name(osd), name, rc);
329 CERROR("%s: expect to open total %d OI files.\n",
330 osd_dev2name(osd), oi_count);
335 osd_oi_table_put(info, oi_table, oi_count > 0 ? oi_count : i);
342 static int osd_remove_oi_one(struct osd_device *osd, struct dentry *parent,
343 const char *name, int namelen)
345 struct dentry *child;
348 child = osd_lookup_one_len_unlocked(osd, name, parent, namelen);
352 rc = vfs_unlink(&nop_mnt_idmap, parent->d_inode, child);
356 return rc == -ENOENT ? 0 : rc;
359 static int osd_remove_ois(struct osd_thread_info *info, struct osd_device *osd)
366 if (osd->od_dt_dev.dd_rdonly)
369 for (i = 0; i < OSD_OI_FID_NR_MAX; i++) {
370 namelen = scnprintf(name, sizeof(name), "%s.%d",
371 OSD_OI_NAME_BASE, i);
372 rc = osd_remove_oi_one(osd, osd_sb(osd)->s_root, name, namelen);
375 "%s: fail to remove the stale OI file %s: rc = %d\n",
376 osd_dev2name(osd), name, rc);
381 namelen = scnprintf(name, sizeof(name), "%s", OSD_OI_NAME_BASE);
382 rc = osd_remove_oi_one(osd, osd_sb(osd)->s_root, name, namelen);
384 CERROR("%s: fail to remove the stale OI file %s: rc = %d\n",
385 osd_dev2name(osd), name, rc);
390 int osd_oi_init(struct osd_thread_info *info, struct osd_device *osd,
393 struct lustre_scrub *scrub = &osd->od_scrub.os_scrub;
394 struct scrub_file *sf = &scrub->os_file;
400 if (unlikely((sf->sf_oi_count & (sf->sf_oi_count - 1)) != 0 ||
401 sf->sf_oi_count > OSD_OI_FID_NR_MAX)) {
402 LCONSOLE_WARN("%s: invalid OI count %u in scrub file, reset it\n",
403 osd_dev2name(osd), sf->sf_oi_count);
408 LCONSOLE_WARN("%s: reset Object Index mappings\n",
410 rc = osd_remove_ois(info, osd);
415 OBD_ALLOC_PTR_ARRAY(oi, OSD_OI_FID_NR_MAX);
419 /* try to open existing multiple OIs first */
420 count = osd_oi_table_open(info, osd, oi, sf->sf_oi_count, false);
422 GOTO(out, rc = count);
425 if (count == sf->sf_oi_count)
426 GOTO(out, rc = count);
428 /* Trust the counted number of OI files if it is sane */
429 if ((count & (count - 1)) != 0) {
430 LCONSOLE_WARN("%s: invalid oi count %d, remove them, then set it to %d\n",
431 osd_dev2name(osd), count, osd_oi_count);
432 osd_oi_table_put(info, oi, count);
433 rc = osd_remove_ois(info, osd);
437 count = osd_oi_count;
440 scrub_file_reset(scrub, osd->od_uuid, SF_RECREATED);
441 sf->sf_oi_count = count;
445 /* if previous failed then try found single OI from old filesystem */
446 rc = osd_oi_open(info, osd, OSD_OI_NAME_BASE, &oi[0], false);
447 if (rc == 0) { /* found single OI from old filesystem */
449 ldiskfs_clear_bit(0, sf->sf_oi_bitmap);
450 if (sf->sf_success_count == 0)
451 /* XXX: There is one corner case that if the OI_scrub
452 * file crashed or lost and we regard it upgrade,
453 * then we allow IGIF lookup to bypass OI files.
455 * The risk is that osd_fid_lookup() may found
456 * a wrong inode with the given IGIF especially
457 * when the MDT has performed file-level backup
458 * and restored after former upgrading from 1.8
459 * to 2.x. Fortunately, the osd_fid_lookup()can
460 * verify the inode to decrease the risk.
462 scrub_file_reset(scrub, osd->od_uuid, SF_UPGRADE);
464 } else if (rc != -ENOENT) {
465 CERROR("%s: can't open %s: rc = %d\n",
466 osd_dev2name(osd), OSD_OI_NAME_BASE, rc);
470 if (sf->sf_oi_count > 0) {
473 count = sf->sf_oi_count;
474 memset(sf->sf_oi_bitmap, 0, SCRUB_OI_BITMAP_SIZE);
475 for (i = 0; i < count; i++)
476 ldiskfs_set_bit(i, sf->sf_oi_bitmap);
477 scrub_file_reset(scrub, osd->od_uuid, SF_RECREATED);
479 count = sf->sf_oi_count = osd_oi_count;
483 rc = scrub_file_store(info->oti_env, scrub);
485 osd_oi_table_put(info, oi, count);
489 /* No OIs exist, new filesystem, create OI objects */
490 rc = osd_oi_table_open(info, osd, oi, count, true);
491 LASSERT(ergo(rc >= 0, rc == count));
497 OBD_FREE_PTR_ARRAY(oi, OSD_OI_FID_NR_MAX);
499 LASSERTF((rc & (rc - 1)) == 0, "Invalid OI count %d\n", rc);
501 osd->od_oi_table = oi;
502 osd->od_oi_count = rc;
503 if (sf->sf_oi_count != rc) {
504 sf->sf_oi_count = rc;
505 rc = scrub_file_store(info->oti_env, scrub);
507 osd_oi_table_put(info, oi, count);
508 OBD_FREE_PTR_ARRAY(oi, OSD_OI_FID_NR_MAX);
518 void osd_oi_fini(struct osd_thread_info *info, struct osd_device *osd)
520 if (unlikely(!osd->od_oi_table))
523 osd_oi_table_put(info, osd->od_oi_table, osd->od_oi_count);
525 OBD_FREE_PTR_ARRAY(osd->od_oi_table, OSD_OI_FID_NR_MAX);
526 osd->od_oi_table = NULL;
529 static inline int fid_is_fs_root(const struct lu_fid *fid)
531 /* Map root inode to special local object FID */
532 return (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE &&
533 fid_oid(fid) == OSD_FS_ROOT_OID));
536 static int osd_oi_iam_lookup(struct osd_thread_info *oti,
537 struct osd_oi *oi, struct dt_rec *rec,
538 const struct dt_key *key)
540 struct iam_container *bag;
541 struct iam_iterator *it = &oti->oti_idx_it;
542 struct iam_path_descr *ipd;
547 LASSERT(oi->oi_inode);
549 bag = &oi->oi_dir.od_container;
550 ipd = osd_idx_ipd_get(oti->oti_env, bag);
554 /* got ipd now we can start iterator. */
555 iam_it_init(it, bag, 0, ipd);
557 rc = iam_it_get(it, (struct iam_key *)key);
559 iam_reccpy(&it->ii_path.ip_leaf, (struct iam_rec *)rec);
562 osd_ipd_put(oti->oti_env, bag, ipd);
564 LINVRNT(osd_invariant(obj));
569 int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
570 const struct lu_fid *fid, enum oi_check_flags flags)
572 struct lu_seq_range *range = &info->oti_seq_range;
576 if (flags & OI_KNOWN_ON_OST)
579 if (unlikely(fid_is_local_file(fid) || fid_is_igif(fid) ||
580 fid_is_llog(fid)) || fid_is_name_llog(fid) ||
584 if (fid_is_idif(fid) || fid_is_last_id(fid))
587 if (!(flags & OI_CHECK_FLD))
590 if (osd_seq_site(osd)->ss_server_fld == NULL)
593 rc = osd_fld_lookup(info->oti_env, osd, fid_seq(fid), range);
595 /* During upgrade, OST FLDB might not be loaded because
596 * OST FLDB is not created until 2.6, so if some DNE
597 * filesystem upgrade from 2.5 to 2.7/2.8, they will
598 * not be able to find the sequence from local FLDB
599 * cache see fld_index_init().
601 if (rc == -ENOENT && osd->od_is_ost)
605 CERROR("%s: lookup FLD "DFID": rc = %d\n",
606 osd_name(osd), PFID(fid), rc);
610 if (fld_range_is_ost(range))
616 static int __osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
617 const struct lu_fid *fid, struct osd_inode_id *id)
619 struct lu_fid *oi_fid = &info->oti_fid2;
622 fid_cpu_to_be(oi_fid, fid);
623 rc = osd_oi_iam_lookup(info, osd_fid2oi(osd, fid), (struct dt_rec *)id,
624 (const struct dt_key *)oi_fid);
626 osd_id_unpack(id, id);
628 } else if (rc == 0) {
634 int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
635 const struct lu_fid *fid, struct osd_inode_id *id,
636 enum oi_check_flags flags)
638 if (unlikely(fid_is_last_id(fid)))
639 return osd_obj_spec_lookup(info, osd, fid, id, flags);
641 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
642 return osd_obj_map_lookup(info, osd, fid, id);
644 if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) {
647 if (fid_is_fs_root(fid)) {
648 osd_id_gen(id, osd_sb(osd)->s_root->d_inode->i_ino,
649 osd_sb(osd)->s_root->d_inode->i_generation);
652 if (unlikely(fid_is_acct(fid)))
653 return osd_acct_obj_lookup(info, osd, fid, id);
655 /* For other special FIDs, try OI first, then do spec lookup */
656 rc = __osd_oi_lookup(info, osd, fid, id);
658 return osd_obj_spec_lookup(info, osd, fid, id, flags);
662 if (!osd->od_igif_inoi && fid_is_igif(fid)) {
663 osd_id_gen(id, lu_igif_ino(fid), lu_igif_gen(fid));
667 return __osd_oi_lookup(info, osd, fid, id);
670 static int osd_oi_iam_refresh(struct osd_thread_info *oti, struct osd_oi *oi,
671 const struct dt_rec *rec, const struct dt_key *key,
672 handle_t *th, bool insert)
674 struct iam_container *bag;
675 struct iam_path_descr *ipd;
680 LASSERT(oi->oi_inode);
681 dquot_initialize(oi->oi_inode);
683 bag = &oi->oi_dir.od_container;
684 ipd = osd_idx_ipd_get(oti->oti_env, bag);
685 if (unlikely(ipd == NULL))
689 LASSERT(th->h_transaction != NULL);
691 rc = iam_insert(th, bag, (const struct iam_key *)key,
692 (const struct iam_rec *)rec, ipd);
694 rc = iam_update(th, bag, (const struct iam_key *)key,
695 (const struct iam_rec *)rec, ipd);
696 osd_ipd_put(oti->oti_env, bag, ipd);
697 LINVRNT(osd_invariant(obj));
701 int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
702 const struct lu_fid *fid, const struct osd_inode_id *id,
703 handle_t *th, enum oi_check_flags flags, bool *exist)
705 struct lu_fid *oi_fid = &info->oti_fid2;
706 struct osd_inode_id *oi_id = &info->oti_id2;
709 CDEBUG(D_INODE, "insert OI for "DFID"\n", PFID(fid));
711 if (unlikely(fid_is_last_id(fid)))
712 return osd_obj_spec_insert(info, osd, fid, id, th);
714 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
715 return osd_obj_map_insert(info, osd, fid, id, th);
717 fid_cpu_to_be(oi_fid, fid);
718 osd_id_pack(oi_id, id);
719 rc = osd_oi_iam_refresh(info, osd_fid2oi(osd, fid),
720 (const struct dt_rec *)oi_id,
721 (const struct dt_key *)oi_fid, th, true);
724 struct lustre_mdt_attrs *lma = &info->oti_ost_attrs.loa_lma;
729 rc = osd_oi_lookup(info, osd, fid, oi_id, 0);
733 if (unlikely(osd_id_eq(id, oi_id)))
736 /* Check whether the mapping for oi_id is valid or not. */
737 inode = osd_iget(info, osd, oi_id);
740 if (rc == -ENOENT || rc == -ESTALE)
745 rc = osd_get_lma(info, inode, &info->oti_obj_dentry,
746 &info->oti_ost_attrs);
754 if (!(lma->lma_compat & LMAC_NOT_IN_OI) &&
755 lu_fid_eq(fid, &lma->lma_self_fid)) {
757 "%s: the FID "DFID" is used by two objects: %u/%u %u/%u\n",
758 osd_dev2name(osd), PFID(fid), oi_id->oii_ino,
759 oi_id->oii_gen, id->oii_ino, id->oii_gen);
764 osd_id_pack(oi_id, id);
765 rc = osd_oi_iam_refresh(info, osd_fid2oi(osd, fid),
766 (const struct dt_rec *)oi_id,
767 (const struct dt_key *)oi_fid, th,
776 if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
777 rc = osd_obj_spec_insert(info, osd, fid, id, th);
781 static int osd_oi_iam_delete(struct osd_thread_info *oti, struct osd_oi *oi,
782 const struct dt_key *key, handle_t *th)
784 struct iam_container *bag;
785 struct iam_path_descr *ipd;
790 LASSERT(oi->oi_inode);
791 dquot_initialize(oi->oi_inode);
793 bag = &oi->oi_dir.od_container;
794 ipd = osd_idx_ipd_get(oti->oti_env, bag);
795 if (unlikely(ipd == NULL))
799 LASSERT(th->h_transaction != NULL);
801 rc = iam_delete(th, bag, (const struct iam_key *)key, ipd);
802 osd_ipd_put(oti->oti_env, bag, ipd);
803 LINVRNT(osd_invariant(obj));
807 int osd_oi_delete(struct osd_thread_info *info,
808 struct osd_device *osd, const struct lu_fid *fid,
809 handle_t *th, enum oi_check_flags flags)
811 struct lu_fid *oi_fid = &info->oti_fid2;
813 CDEBUG(D_INODE, "delete OI for "DFID"\n", PFID(fid));
815 /* clear idmap cache */
816 if (lu_fid_eq(fid, &info->oti_cache.oic_fid))
817 fid_zero(&info->oti_cache.oic_fid);
819 if (fid_is_last_id(fid))
822 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
823 return osd_obj_map_delete(info, osd, fid, th);
825 fid_cpu_to_be(oi_fid, fid);
826 return osd_oi_iam_delete(info, osd_fid2oi(osd, fid),
827 (const struct dt_key *)oi_fid, th);
830 int osd_oi_update(struct osd_thread_info *info, struct osd_device *osd,
831 const struct lu_fid *fid, const struct osd_inode_id *id,
832 handle_t *th, enum oi_check_flags flags)
834 struct lu_fid *oi_fid = &info->oti_fid2;
835 struct osd_inode_id *oi_id = &info->oti_id2;
838 CDEBUG(D_INODE, "update OI for "DFID"\n", PFID(fid));
840 if (unlikely(fid_is_last_id(fid)))
841 return osd_obj_spec_update(info, osd, fid, id, th);
843 if (fid_is_llog(fid) || fid_is_on_ost(info, osd, fid, flags))
844 return osd_obj_map_update(info, osd, fid, id, th);
846 fid_cpu_to_be(oi_fid, fid);
847 osd_id_pack(oi_id, id);
848 rc = osd_oi_iam_refresh(info, osd_fid2oi(osd, fid),
849 (const struct dt_rec *)oi_id,
850 (const struct dt_key *)oi_fid, th, false);
854 if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
855 rc = osd_obj_spec_update(info, osd, fid, id, th);
859 int osd_oi_mod_init(void)
861 if (osd_oi_count == 0 || osd_oi_count > OSD_OI_FID_NR_MAX)
862 osd_oi_count = OSD_OI_FID_NR;
864 if ((osd_oi_count & (osd_oi_count - 1)) != 0) {
865 LCONSOLE_WARN("Round up oi_count %d to power2 %d\n",
866 osd_oi_count, size_roundup_power2(osd_oi_count));
867 osd_oi_count = size_roundup_power2(osd_oi_count);