Whamcloud - gitweb
LU-3963 libcfs: convert include/lclient/ldlm/lfsck cfs_atomic
[fs/lustre-release.git] / lustre / include / obd_target.h
1 /* GPL HEADER START
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 only,
7  * as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License version 2 for more details (a copy is included
13  * in the LICENSE file that accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License
16  * version 2 along with this program; If not, see
17  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
18  *
19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20  * CA 95054 USA or visit www.sun.com if you need additional information or
21  * have any questions.
22  *
23  * GPL HEADER END
24  */
25 /*
26  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
27  * Use is subject to license terms.
28  *
29  * Copyright (c) 2011, 2012, Intel, Inc.
30  */
31 /*
32  * This file is part of Lustre, http://www.lustre.org/
33  * Lustre is a trademark of Sun Microsystems, Inc.
34  */
35
36 #ifndef __OBD_TARGET_H
37 #define __OBD_TARGET_H
38
39 /* server-side individual type definitions */
40
41 #define OBT_MAGIC       0xBDDECEAE
42 /* hold common fields for "target" device */
43 struct obd_device_target {
44         __u32                   obt_magic;
45         __u32                   obt_instance;
46         struct lu_target       *obt_lut;
47         __u64                   obt_mount_count;
48         struct obd_job_stats    obt_jobstats;
49 };
50
51 #define OBJ_SUBDIR_COUNT 32 /* set to zero for no subdirs */
52
53 struct filter_obd {
54         /* NB this field MUST be first */
55         struct obd_device_target        fo_obt;
56         rwlock_t                        fo_sptlrpc_lock;
57         struct sptlrpc_rule_set         fo_sptlrpc_rset;
58
59         /* capability related */
60         unsigned int                    fo_fl_oss_capa;
61         cfs_list_t                      fo_capa_keys;
62         cfs_hlist_head_t               *fo_capa_hash;
63         int                             fo_sec_level;
64 };
65
66 struct echo_obd {
67         struct obd_device_target        eo_obt;
68         struct obdo                     eo_oa;
69         spinlock_t                      eo_lock;
70         __u64                           eo_lastino;
71         struct lustre_handle            eo_nl_lock;
72         atomic_t                        eo_prep;
73 };
74
75 struct ost_obd {
76         struct ptlrpc_service   *ost_service;
77         struct ptlrpc_service   *ost_create_service;
78         struct ptlrpc_service   *ost_io_service;
79         struct ptlrpc_service   *ost_seq_service;
80         struct ptlrpc_service   *ost_out_service;
81         struct mutex             ost_health_mutex;
82 };
83
84 #endif /* __OBD_TARGET_H */