*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include "osd_scrub.h"
static unsigned int osd_oi_count = OSD_OI_FID_NR;
-CFS_MODULE_PARM(osd_oi_count, "i", int, 0444,
- "Number of Object Index containers to be created, "
- "it's only valid for new filesystem.");
+module_param(osd_oi_count, int, 0444);
+MODULE_PARM_DESC(osd_oi_count, "Number of Object Index containers to be created, it's only valid for new filesystem.");
/** to serialize concurrent OI index initialization */
static struct mutex oi_init_lock;
dentry = osd_child_dentry_by_inode(env, dir, name, strlen(name));
bh = osd_ldiskfs_find_entry(dir, &dentry->d_name, &de, NULL, NULL);
- if (bh) {
+ if (!IS_ERR(bh)) {
osd_id_gen(id, le32_to_cpu(de->inode), OSD_OII_NOGEN);
brelse(bh);
inode = osd_iget(info, osd, id);
feat->dif_ptrsize, feat->dif_recsize_max,
jh);
dentry = osd_child_dentry_by_inode(env, dir, name, strlen(name));
- rc = osd_ldiskfs_add_entry(info, jh, dentry, inode, NULL);
+ rc = osd_ldiskfs_add_entry(info, osd, jh, dentry, inode, NULL);
ldiskfs_journal_stop(jh);
iput(inode);
return rc;
rc = osd_fld_lookup(info->oti_env, osd, fid_seq(fid), range);
if (rc != 0) {
+ /* During upgrade, OST FLDB might not be loaded because
+ * OST FLDB is not created until 2.6, so if some DNE
+ * filesystem upgrade from 2.5 to 2.7/2.8, they will
+ * not be able to find the sequence from local FLDB
+ * cache see fld_index_init(). */
+ if (rc == -ENOENT && osd->od_is_ost)
+ RETURN(1);
+
if (rc != -ENOENT)
CERROR("%s: lookup FLD "DFID": rc = %d\n",
osd_name(osd), PFID(fid), rc);
int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
const struct lu_fid *fid, const struct osd_inode_id *id,
- handle_t *th, enum oi_check_flags flags)
+ handle_t *th, enum oi_check_flags flags, bool *exist)
{
struct lu_fid *oi_fid = &info->oti_fid2;
struct osd_inode_id *oi_id = &info->oti_id2;
(const struct dt_key *)oi_fid, th, false);
if (rc != 0)
return rc;
+
+ if (exist != NULL)
+ *exist = true;
}
if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))