blob: b16897702559ad006cc1b82891adf3a006a06b67 [file] [log] [blame]
Peng Taod7e09d02013-05-02 16:46:55 +08001/*
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 Drokin6a5b99a2016-06-14 23:33:40 -040018 * http://www.gnu.org/licenses/gpl-2.0.html
Peng Taod7e09d02013-05-02 16:46:55 +080019 *
Peng Taod7e09d02013-05-02 16:46:55 +080020 * 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-Hartman1accaad2014-07-11 21:34:24 -070041#include "linux/lustre_lite.h"
Peng Taod7e09d02013-05-02 16:46:55 +080042
Greg Kroah-Hartman1accaad2014-07-11 21:34:24 -070043#include "obd_class.h"
Greg Kroah-Hartman1accaad2014-07-11 21:34:24 -070044#include "lustre_net.h"
45#include "lustre_mds.h"
46#include "lustre_ha.h"
Peng Taod7e09d02013-05-02 16:46:55 +080047
48/* 4UL * 1024 * 1024 */
49#define LL_MAX_BLKSIZE_BITS (22)
50#define LL_MAX_BLKSIZE (1UL<<LL_MAX_BLKSIZE_BITS)
51
Peng Taod7e09d02013-05-02 16:46:55 +080052/*
Oleg Drokin85f552d2016-02-26 01:49:56 -050053 * This is embedded into llite super-blocks to keep track of
Peng Taod7e09d02013-05-02 16:46:55 +080054 * connect flags (capabilities) supported by all imports given mount is
55 * connected to.
56 */
57struct 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 */
72struct ll_dir_chain {
73 /* XXX something. Later */
74};
75
76static inline void ll_dir_chain_init(struct ll_dir_chain *chain)
77{
78}
79
80static inline void ll_dir_chain_fini(struct ll_dir_chain *chain)
81{
82}
83
84static inline unsigned long hash_x_index(__u64 hash, int hash64)
85{
86 if (BITS_PER_LONG == 32 && hash64)
87 hash >>= 32;
Peng Tao363090e2013-10-21 23:18:23 +080088 /* 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 Taod7e09d02013-05-02 16:46:55 +080093}
94
95/** @} lite */
96
97#endif