CERROR("bad inode\n");
iput(inode);
inode = ERR_PTR(-ENOENT);
- } else if (inode->i_generation != id->oii_gen &&
- id->oii_gen != OSD_GEN_IGNORE) {
+ } else if (inode->i_generation != id->oii_gen) {
CERROR("stale inode\n");
iput(inode);
inode = ERR_PTR(-ESTALE);
LASSERT(obj->oo_inode->i_sb == osd_sb(dev));
result = 0;
} else
+ /*
+ * If fid wasn't found in oi, inode-less object is
+ * created, for which lu_object_exists() returns
+ * false. This is used in a (frequent) case when
+ * objects are created as locking anchors or
+ * place holders for objects yet to be created.
+ */
result = PTR_ERR(inode);
} else if (result == -ENOENT)
result = 0;
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* license text for more details.
*/
+/*
+ * oi uses two mechanisms to implement fid->cookie mapping:
+ *
+ * - persistent index, where cookie is a record and fid is a key, and
+ *
+ * - algorithmic mapping for "igif" fids.
+ *
+ */
#ifndef EXPORT_SYMTAB
# define EXPORT_SYMTAB
struct dt_device *dev;
struct osd_inode_id *id;
- LASSERT(oi->oi_boot == NULL);
+ if (lu_fid_is_igif(fid))
+ return 0;
idx = oi->oi_dir;
dev = lu2dt_dev(idx->do_lu.lo_dev);
struct dt_object *idx;
struct dt_device *dev;
- LASSERT(oi->oi_boot == NULL);
+ if (lu_fid_is_igif(fid))
+ return 0;
idx = oi->oi_dir;
dev = lu2dt_dev(idx->do_lu.lo_dev);
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* license text for more details.
*/
+/*
+ * Object Index (oi) service runs in the bottom layer of server stack. In
+ * translates fid local to this service to the storage cookie that uniquely
+ * and efficiently identifies object (inode) of the underlying file system.
+ */
#ifndef _OSD_OI_H
#define _OSD_OI_H
struct lu_site;
struct thandle;
-struct oi_boot_rec;
struct osd_device;
+/*
+ * Object Index (oi) instance.
+ */
struct osd_oi {
+ /*
+ * underlying index object, where fid->id mapping in stored.
+ */
struct dt_object *oi_dir;
+ /*
+ * semaphore, synchronizing access to oi.
+ */
struct rw_semaphore oi_lock;
- struct oi_boot_rec *oi_boot;
};
+/*
+ * Storage cookie. Datum uniquely identifying inode on the underlying file
+ * system.
+ *
+ * XXX Currently this is ext2/ext3/ldiskfs specific thing. In the future this
+ * should be generalized to work with other local file systems.
+ */
struct osd_inode_id {
- __u64 oii_ino;
- __u32 oii_gen;
- __u32 oii_pad;
-};
-
-enum {
- OSD_GEN_IGNORE = (__u32)~0
+ __u64 oii_ino; /* inode number */
+ __u32 oii_gen; /* inode generation */
+ __u32 oii_pad; /* alignment padding */
};
int osd_oi_init(struct osd_thread_info *info,