4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
27 * Copyright (c) 2011, 2014, Intel Corporation.
30 * This file is part of Lustre, http://www.lustre.org/
32 * lustre/include/lustre_mdc.h
34 * MDS data structures.
35 * See also lustre_idl.h for wire formats of requests.
47 #include <linux/dcache.h>
48 #ifdef CONFIG_LUSTRE_FS_POSIX_ACL
49 # include <lustre_compat.h>
50 #endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
51 #include <lustre_handles.h>
52 #include <lustre_intent.h>
53 #include <libcfs/libcfs.h>
54 #include <obd_class.h>
55 #include <uapi/linux/lustre/lustre_idl.h>
56 #include <lustre_lib.h>
57 #include <lustre_dlm.h>
58 #include <lustre_export.h>
62 struct ptlrpc_request;
66 * Update the maximum possible easize.
68 * This value is learned from ptlrpc replies sent by the MDT. The
69 * default easize is initialized to the minimum value but allowed to
70 * grow up to a single page in size if required to handle the common
73 * \see client_obd::cl_default_mds_easize
75 * \param[in] exp export for MDC device
76 * \param[in] body body of ptlrpc reply from MDT
79 static inline void mdc_update_max_ea_from_body(struct obd_export *exp,
80 struct mdt_body *body)
82 if (body->mbo_valid & OBD_MD_FLMODEASIZE) {
83 struct client_obd *cli = &exp->exp_obd->u.cli;
86 if (cli->cl_max_mds_easize < body->mbo_max_mdsize)
87 cli->cl_max_mds_easize = body->mbo_max_mdsize;
89 def_easize = min_t(__u32, body->mbo_max_mdsize,
90 OBD_MAX_DEFAULT_EA_SIZE);
91 cli->cl_default_mds_easize = def_easize;
97 int it_open_error(int phase, struct lookup_intent *it);
99 static inline bool cl_is_lov_delay_create(unsigned int flags)
101 return (flags & O_LOV_DELAY_CREATE_1_8) != 0 ||
102 (flags & O_LOV_DELAY_CREATE_MASK) == O_LOV_DELAY_CREATE_MASK;
105 static inline void cl_lov_delay_create_clear(unsigned int *flags)
107 if ((*flags & O_LOV_DELAY_CREATE_1_8) != 0)
108 *flags &= ~O_LOV_DELAY_CREATE_1_8;
109 if ((*flags & O_LOV_DELAY_CREATE_MASK) == O_LOV_DELAY_CREATE_MASK)
110 *flags &= ~O_LOV_DELAY_CREATE_MASK;