1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
7 * Copyright (c) 2006 Cluster File Systems, Inc.
8 * Author: Nikita Danilov <nikita@clusterfs.com>
10 * This file is part of the Lustre file system, http://www.lustre.org
11 * Lustre is a trademark of Cluster File Systems, Inc.
13 * You may have signed or agreed to another license before downloading
14 * this software. If so, you are bound by the terms and conditions
15 * of that agreement, and the following does not apply to you. See the
16 * LICENSE file included with this distribution for more information.
18 * If you did not agree to a different license, then this copy of Lustre
19 * is open source software; you can redistribute it and/or modify it
20 * under the terms of version 2 of the GNU General Public License as
21 * published by the Free Software Foundation.
23 * In either case, Lustre is distributed in the hope that it will be
24 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
25 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * license text for more details.
29 * Object Index (oi) service runs in the bottom layer of server stack. In
30 * translates fid local to this service to the storage cookie that uniquely
31 * and efficiently identifies object (inode) of the underlying file system.
37 #if defined(__KERNEL__)
39 /* struct rw_semaphore */
40 #include <linux/rwsem.h>
41 #include <lu_object.h>
44 struct osd_thread_info;
57 * Object Index (oi) instance.
61 * underlying index object, where fid->id mapping in stored.
63 struct dt_object *oi_dir[OSD_OI_FID_NR];
67 * Storage cookie. Datum uniquely identifying inode on the underlying file
70 * XXX Currently this is ext2/ext3/ldiskfs specific thing. In the future this
71 * should be generalized to work with other local file systems.
74 __u32 oii_ino; /* inode number */
75 __u32 oii_gen; /* inode generation */
78 int osd_oi_init(struct osd_thread_info *info,
79 struct osd_oi *oi, struct dt_device *dev);
80 void osd_oi_fini(struct osd_thread_info *info, struct osd_oi *oi);
82 int osd_oi_lookup(struct osd_thread_info *info, struct osd_oi *oi,
83 const struct lu_fid *fid, struct osd_inode_id *id);
84 int osd_oi_insert(struct osd_thread_info *info, struct osd_oi *oi,
85 const struct lu_fid *fid, const struct osd_inode_id *id,
87 int osd_oi_delete(struct osd_thread_info *info,
88 struct osd_oi *oi, const struct lu_fid *fid,
91 #endif /* __KERNEL__ */
92 #endif /* _OSD_OI_H */