Whamcloud - gitweb
LU-1146 build: batch update copyright messages
[fs/lustre-release.git] / lustre / include / obd_ost.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * GPL HEADER START
5  *
6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 only,
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License version 2 for more details (a copy is included
16  * in the LICENSE file that accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License
19  * version 2 along with this program; If not, see
20  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
21  *
22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23  * CA 95054 USA or visit www.sun.com if you need additional information or
24  * have any questions.
25  *
26  * GPL HEADER END
27  */
28 /*
29  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
30  * Use is subject to license terms.
31  *
32  * Copyright (c) 2012, Whamcloud, Inc.
33  */
34 /*
35  * This file is part of Lustre, http://www.lustre.org/
36  * Lustre is a trademark of Sun Microsystems, Inc.
37  *
38  * lustre/include/obd_ost.h
39  *
40  * Data structures for object storage targets and client: OST & OSC's
41  *
42  * See also lustre_idl.h for wire formats of requests.
43  */
44
45 #ifndef _LUSTRE_OST_H
46 #define _LUSTRE_OST_H
47
48 #include <obd_class.h>
49
50 struct osc_brw_async_args {
51         struct obdo       *aa_oa;
52         int                aa_requested_nob;
53         int                aa_nio_count;
54         obd_count          aa_page_count;
55         int                aa_resends;
56         struct brw_page  **aa_ppga;
57         struct client_obd *aa_cli;
58         cfs_list_t         aa_oaps;
59         struct obd_capa   *aa_ocapa;
60         struct cl_req     *aa_clerq;
61 };
62
63 #define osc_grant_args osc_brw_async_args
64 struct osc_async_args {
65         struct obd_info   *aa_oi;
66 };
67
68 struct osc_setattr_args {
69         struct obdo         *sa_oa;
70         obd_enqueue_update_f sa_upcall;
71         void                *sa_cookie;
72 };
73
74 struct osc_enqueue_args {
75         struct obd_export        *oa_exp;
76         int                      *oa_flags;
77         obd_enqueue_update_f      oa_upcall;
78         void                     *oa_cookie;
79         struct ost_lvb           *oa_lvb;
80         struct lustre_handle     *oa_lockh;
81         struct ldlm_enqueue_info *oa_ei;
82         unsigned int              oa_agl:1;
83 };
84
85 #if 0
86 int osc_extent_blocking_cb(struct ldlm_lock *lock,
87                            struct ldlm_lock_desc *new, void *data,
88                            int flag);
89 #endif
90
91 #define POSTID LPU64":"LPU64
92 /** 
93  * Build DLM resource name from object id & group for osc-ost extent lock.
94  */
95 static inline struct ldlm_res_id *osc_build_res_name(__u64 id, __u64 gr,
96                                                      struct ldlm_res_id *name)
97 {
98         memset(name, 0, sizeof *name);
99         name->name[0] = id;
100         name->name[1] = gr;
101         return name;
102 }
103
104 /**
105  * Return true if the resource is for the object identified by this id & group.
106  */
107 static inline int osc_res_name_eq(__u64 id, __u64 gr, struct ldlm_res_id *name)
108 {
109         return name->name[0] == id && name->name[1] == gr;
110 }
111
112 #endif