push_ctxt(save, newctxt);
}
+/**
+ * osd_ios_lookup_one_len - lookup single pathname component
+ *
+ * @name: pathname component to lookup
+ * @base: base directory to lookup from
+ * @len: maximum length @len should be interpreted to
+ *
+ * Treat found dentry with NULL d_inode as an -ENOENT error so LFSCK
+ * can repair the file.
+ */
+struct dentry *osd_ios_lookup_one_len(const char *name, struct dentry *base,
+ int len)
+{
+ struct dentry *dentry;
+
+ dentry = ll_lookup_one_len(name, base, len);
+ if (IS_ERR(dentry)) {
+ int rc = PTR_ERR(dentry);
+
+ if (rc != -ENOENT)
+ CERROR("Fail to find %.*s in %.*s (%lu/%u): rc = %d\n",
+ len, name, base->d_name.len,
+ base->d_name.name, base->d_inode->i_ino,
+ base->d_inode->i_generation, rc);
+
+ return dentry;
+ }
+
+ if (dentry->d_inode == NULL) {
+ dput(dentry);
+ return ERR_PTR(-ENOENT);
+ }
+
+ return dentry;
+}
+
/* utility to make a directory */
static struct dentry *
simple_mkdir(const struct lu_env *env, struct osd_device *osd,
struct osd_inode_id *id);
void osd_scrub_dump(struct seq_file *m, struct osd_device *dev);
+struct dentry *osd_ios_lookup_one_len(const char *name, struct dentry *base,
+ int len);
+
int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd,
u64 seq, struct lu_seq_range *range);
int oifb_items;
};
-static inline struct dentry *
-osd_ios_lookup_one_len(const char *name, struct dentry *parent, int namelen)
-{
- struct dentry *dentry;
-
- dentry = ll_lookup_one_len(name, parent, namelen);
- if (IS_ERR(dentry)) {
- int rc = PTR_ERR(dentry);
-
- if (rc != -ENOENT)
- CERROR("Fail to find %.*s in %.*s (%lu/%u): rc = %d\n",
- namelen, name, parent->d_name.len,
- parent->d_name.name, parent->d_inode->i_ino,
- parent->d_inode->i_generation, rc);
-
- return dentry;
- }
-
- if (dentry->d_inode == NULL) {
- dput(dentry);
- return ERR_PTR(-ENOENT);
- }
-
- return dentry;
-}
-
static int
osd_ios_new_item(struct osd_device *dev, struct dentry *dentry,
scandir_t scandir, filldir_t filldir)