ACPI / button: remove pointer to old lid_sysfs on unbind
[cascardo/linux.git] / drivers / staging / lustre / lustre / include / lustre_lite.h
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; If not, see
18  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
19  *
20  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21  * CA 95054 USA or visit www.sun.com if you need additional information or
22  * have any questions.
23  *
24  * GPL HEADER END
25  */
26 /*
27  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28  * Use is subject to license terms.
29  *
30  * Copyright (c) 2011, 2012, Intel Corporation.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  */
36
37 #ifndef _LL_H
38 #define _LL_H
39
40 /** \defgroup lite lite
41  *
42  * @{
43  */
44
45 #include "linux/lustre_lite.h"
46
47 #include "obd_class.h"
48 #include "lustre_net.h"
49 #include "lustre_mds.h"
50 #include "lustre_ha.h"
51
52 /* 4UL * 1024 * 1024 */
53 #define LL_MAX_BLKSIZE_BITS     (22)
54 #define LL_MAX_BLKSIZE    (1UL<<LL_MAX_BLKSIZE_BITS)
55
56 /*
57  * This is embedded into llite super-blocks to keep track of
58  * connect flags (capabilities) supported by all imports given mount is
59  * connected to.
60  */
61 struct lustre_client_ocd {
62         /*
63          * This is conjunction of connect_flags across all imports (LOVs) this
64          * mount is connected to. This field is updated by cl_ocd_update()
65          * under ->lco_lock.
66          */
67         __u64         lco_flags;
68         struct mutex       lco_lock;
69         struct obd_export *lco_md_exp;
70         struct obd_export *lco_dt_exp;
71 };
72
73 /*
74  * Chain of hash overflow pages.
75  */
76 struct ll_dir_chain {
77         /* XXX something. Later */
78 };
79
80 static inline void ll_dir_chain_init(struct ll_dir_chain *chain)
81 {
82 }
83
84 static inline void ll_dir_chain_fini(struct ll_dir_chain *chain)
85 {
86 }
87
88 static inline unsigned long hash_x_index(__u64 hash, int hash64)
89 {
90         if (BITS_PER_LONG == 32 && hash64)
91                 hash >>= 32;
92         /* save hash 0 as index 0 because otherwise we'll save it at
93          * page index end (~0UL) and it causes truncate_inode_pages_range()
94          * to loop forever.
95          */
96         return ~0UL - (hash + !hash);
97 }
98
99 /** @} lite */
100
101 #endif