1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * lustre/osd/osd_internal.h
5 * Shared definitions and declarations for osd module
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 #ifndef _OSD_INTERNAL_H
30 #define _OSD_INTERNAL_H
32 #if defined(__KERNEL__)
34 /* struct rw_semaphore */
35 #include <linux/rwsem.h>
36 /* handle_t, journal_start(), journal_stop() */
37 #include <linux/jbd.h>
38 /* struct dx_hash_info */
39 #include <linux/ldiskfs_fs.h>
41 #include <linux/dcache.h>
42 #include <linux/lustre_iam.h>
46 /* class_register_type(), class_unregister_type(), class_get_type() */
47 #include <obd_class.h>
48 #include <lustre_disk.h>
50 #include <dt_object.h>
55 #define OSD_COUNTERS (0)
62 struct dt_device od_dt_dev;
63 /* information about underlying file system */
64 struct lustre_mount_info *od_mount;
68 * XXX temporary stuff for object index: directory where every object
69 * is named by its fid.
71 struct dentry *od_obj_area;
73 /* Environment for transaction commit callback.
74 * Currently, OSD is based on ext3/JBD. Transaction commit in ext3/JBD
75 * is serialized, that is there is no more than one transaction commit
76 * at a time (JBD journal_commit_transaction() is serialized).
77 * This means that it's enough to have _one_ lu_context.
79 struct lu_env od_env_for_commit;
84 unsigned int od_fl_capa:1;
85 unsigned long od_capa_timeout;
87 struct lustre_capa_key *od_capa_keys;
88 struct hlist_head *od_capa_hash;
90 cfs_proc_dir_entry_t *od_proc_entry;
91 struct lprocfs_stats *od_stats;
93 * statfs optimization: we cache a bit.
95 cfs_time_t od_osfs_age;
96 struct kstatfs od_kstatfs;
97 spinlock_t od_osfs_lock;
101 struct osd_thread_info {
102 const struct lu_env *oti_env;
104 struct lu_fid oti_fid;
105 struct osd_inode_id oti_id;
107 * XXX temporary: for ->i_op calls.
110 struct txn_param oti_txn;
112 * XXX temporary: fake dentry used by xattr calls.
114 struct dentry oti_dentry;
115 struct timespec oti_time;
117 * XXX temporary: for capa operations.
119 struct lustre_capa_key oti_capa_key;
120 struct lustre_capa oti_capa;
122 struct lu_fid_pack oti_pack;
124 char oti_ipd[DX_IPD_MAX_SIZE];
134 void lprocfs_osd_init_vars(struct lprocfs_static_vars *lvars);
135 int osd_procfs_init(struct osd_device *osd, const char *name);
136 int osd_procfs_fini(struct osd_device *osd);
137 void osd_lprocfs_time_start(const struct lu_env *env);
138 void osd_lprocfs_time_end(const struct lu_env *env,
139 struct osd_device *osd, int op);
141 int osd_statfs(const struct lu_env *env, struct dt_device *dev,
142 struct kstatfs *sfs);
144 #endif /* __KERNEL__ */
145 #endif /* _OSD_INTERNAL_H */