/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012 Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#define D_CONSOLE 0x02000000
#define D_QUOTA 0x04000000
#define D_SEC 0x08000000
+#define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */
/* keep these in sync with lnet/{utils,libcfs}/debug.c */
#define D_HSM D_TRACE
}
int osd_compat_spec_lookup(struct osd_thread_info *info,
- struct osd_device *osd, const struct lu_fid *fid,
- struct osd_inode_id *id)
+ struct osd_device *osd, const struct lu_fid *fid,
+ struct osd_inode_id *id)
{
- struct dentry *dentry;
- char *name;
- int rc = -ERESTART;
-
- ENTRY;
+ struct dentry *dentry;
+ char *name;
+ int rc = -ENOENT;
+ ENTRY;
- name = oid2name(fid_oid(fid));
- if (name == NULL || strlen(name) == 0)
- return -ERESTART;
+ name = oid2name(fid_oid(fid));
+ if (name == NULL || strlen(name) == 0)
+ RETURN(-ENOENT);
dentry = ll_lookup_one_len(name, osd_sb(osd)->s_root, strlen(name));
if (!IS_ERR(dentry)) {
id->oii_ino = inode->i_ino;
id->oii_gen = inode->i_generation;
} else {
- if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) {
- rc = osd_compat_spec_lookup(info, osd, fid, id);
- if (rc == 0 || rc != -ERESTART)
- goto out;
- }
+ if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
+ return osd_compat_spec_lookup(info, osd, fid, id);
fid_cpu_to_be(oi_fid, fid);
key = (struct dt_key *)oi_fid;
rc = -ENOENT;
}
}
-
-out:
return rc;
}
}
int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
- const struct lu_fid *fid, const struct osd_inode_id *id0,
- struct thandle *th, int ignore_quota)
+ const struct lu_fid *fid, const struct osd_inode_id *id0,
+ struct thandle *th, int ignore_quota)
{
- struct lu_fid *oi_fid = &info->oti_fid;
- struct osd_inode_id *id;
- const struct dt_key *key;
+ struct lu_fid *oi_fid = &info->oti_fid;
+ struct osd_inode_id *id;
+ const struct dt_key *key;
- if (fid_is_igif(fid))
- return 0;
+ if (fid_is_igif(fid) || unlikely(fid_seq(fid) == FID_SEQ_DOT_LUSTRE))
+ return 0;
- if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)
- return osd_compat_objid_insert(info, osd, fid, id0, th);
+ if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)
+ return osd_compat_objid_insert(info, osd, fid, id0, th);
- /* notice we don't return immediately, but continue to get into OI */
- if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
- osd_compat_spec_insert(info, osd, fid, id0, th);
+ /* Server mount should not depends on OI files */
+ if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
+ return osd_compat_spec_insert(info, osd, fid, id0, th);
fid_cpu_to_be(oi_fid, fid);
key = (struct dt_key *)oi_fid;
struct lu_fid *oi_fid = &info->oti_fid;
const struct dt_key *key;
- if (!fid_is_norm(fid))
- return 0;
-
LASSERT(fid_seq(fid) != FID_SEQ_LOCAL_FILE);
if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)