Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 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 |
Oleg Drokin | 6a5b99a | 2016-06-14 23:33:40 -0400 | [diff] [blame] | 18 | * http://www.gnu.org/licenses/gpl-2.0.html |
Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 19 | * |
Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 20 | * GPL HEADER END |
| 21 | */ |
| 22 | /* |
| 23 | * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. |
| 24 | * Use is subject to license terms. |
| 25 | * |
| 26 | * Copyright (c) 2011, 2012, Intel Corporation. |
| 27 | */ |
| 28 | /* |
| 29 | * This file is part of Lustre, http://www.lustre.org/ |
| 30 | * Lustre is a trademark of Sun Microsystems, Inc. |
| 31 | */ |
| 32 | |
| 33 | #ifndef _LL_H |
| 34 | #define _LL_H |
| 35 | |
| 36 | /** \defgroup lite lite |
| 37 | * |
| 38 | * @{ |
| 39 | */ |
| 40 | |
Greg Kroah-Hartman | 1accaad | 2014-07-11 21:34:24 -0700 | [diff] [blame] | 41 | #include "linux/lustre_lite.h" |
Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 42 | |
Greg Kroah-Hartman | 1accaad | 2014-07-11 21:34:24 -0700 | [diff] [blame] | 43 | #include "obd_class.h" |
Greg Kroah-Hartman | 1accaad | 2014-07-11 21:34:24 -0700 | [diff] [blame] | 44 | #include "lustre_net.h" |
| 45 | #include "lustre_mds.h" |
| 46 | #include "lustre_ha.h" |
Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 47 | |
| 48 | /* 4UL * 1024 * 1024 */ |
| 49 | #define LL_MAX_BLKSIZE_BITS (22) |
| 50 | #define LL_MAX_BLKSIZE (1UL<<LL_MAX_BLKSIZE_BITS) |
| 51 | |
Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 52 | /* |
Oleg Drokin | 85f552d | 2016-02-26 01:49:56 -0500 | [diff] [blame] | 53 | * This is embedded into llite super-blocks to keep track of |
Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 54 | * connect flags (capabilities) supported by all imports given mount is |
| 55 | * connected to. |
| 56 | */ |
| 57 | struct lustre_client_ocd { |
| 58 | /* |
| 59 | * This is conjunction of connect_flags across all imports (LOVs) this |
| 60 | * mount is connected to. This field is updated by cl_ocd_update() |
| 61 | * under ->lco_lock. |
| 62 | */ |
| 63 | __u64 lco_flags; |
| 64 | struct mutex lco_lock; |
| 65 | struct obd_export *lco_md_exp; |
| 66 | struct obd_export *lco_dt_exp; |
| 67 | }; |
| 68 | |
| 69 | /* |
| 70 | * Chain of hash overflow pages. |
| 71 | */ |
| 72 | struct ll_dir_chain { |
| 73 | /* XXX something. Later */ |
| 74 | }; |
| 75 | |
| 76 | static inline void ll_dir_chain_init(struct ll_dir_chain *chain) |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | static inline void ll_dir_chain_fini(struct ll_dir_chain *chain) |
| 81 | { |
| 82 | } |
| 83 | |
| 84 | static inline unsigned long hash_x_index(__u64 hash, int hash64) |
| 85 | { |
| 86 | if (BITS_PER_LONG == 32 && hash64) |
| 87 | hash >>= 32; |
Peng Tao | 363090e | 2013-10-21 23:18:23 +0800 | [diff] [blame] | 88 | /* save hash 0 as index 0 because otherwise we'll save it at |
| 89 | * page index end (~0UL) and it causes truncate_inode_pages_range() |
| 90 | * to loop forever. |
| 91 | */ |
| 92 | return ~0UL - (hash + !hash); |
Peng Tao | d7e09d0 | 2013-05-02 16:46:55 +0800 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | /** @} lite */ |
| 96 | |
| 97 | #endif |