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;
52 * Object Index (oi) instance.
56 * underlying index object, where fid->id mapping in stored.
58 struct dt_object *oi_dir;
60 * semaphore, synchronizing access to oi.
62 struct rw_semaphore oi_lock;
66 * Storage cookie. Datum uniquely identifying inode on the underlying file
69 * XXX Currently this is ext2/ext3/ldiskfs specific thing. In the future this
70 * should be generalized to work with other local file systems.
73 __u64 oii_ino; /* inode number */
74 __u32 oii_gen; /* inode generation */
75 __u32 oii_pad; /* alignment padding */
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 void osd_oi_read_lock(struct osd_oi *oi);
83 void osd_oi_read_unlock(struct osd_oi *oi);
84 void osd_oi_write_lock(struct osd_oi *oi);
85 void osd_oi_write_unlock(struct osd_oi *oi);
87 int osd_oi_lookup(struct osd_thread_info *info, struct osd_oi *oi,
88 const struct lu_fid *fid, struct osd_inode_id *id);
89 int osd_oi_insert(struct osd_thread_info *info, struct osd_oi *oi,
90 const struct lu_fid *fid, const struct osd_inode_id *id,
92 int osd_oi_delete(struct osd_thread_info *info,
93 struct osd_oi *oi, const struct lu_fid *fid,
96 #endif /* __KERNEL__ */
97 #endif /* _OSD_OI_H */