Whamcloud - gitweb
b=2252
[fs/lustre-release.git] / lustre / osc / osc_internal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2003 Cluster File Systems, Inc.
5  *
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  */
9
10 #ifndef OSC_INTERNAL_H
11 #define OSC_INTERNAL_H
12
13 #include <portals/lib-types.h> /* for PTL_MTU and PTL_MD_MAX_PAGES */
14
15
16 /* bug 1578: negotiate BRW_MAX_SIZE with the OST, instead of hard-coding it */
17 #define OSC_BRW_MAX_SIZE PTL_MTU
18 #define OSC_BRW_MAX_IOV PTL_MD_MAX_PAGES
19
20 #define OAP_MAGIC 8675309
21
22 struct osc_async_page {
23         int                     oap_magic;
24         struct list_head        oap_pending_item;
25         struct list_head        oap_urgent_item;
26         struct list_head        oap_rpc_item;
27         struct page             *oap_page;
28         int                     oap_cmd;
29
30         obd_off                 oap_obj_off;
31         obd_off                 oap_page_off;
32         int                     oap_count;
33         obd_flag                oap_brw_flags;
34         enum async_flags        oap_async_flags;
35
36         struct obd_sync_io_container *oap_osic;
37
38         struct obd_async_page_ops *oap_caller_ops;
39         void                   *oap_caller_data;
40 };
41
42 #define OSCC_FLAG_RECOVERING 1
43 #define OSCC_FLAG_CREATING   2
44 #define OSCC_FLAG_NOSPC      4 /* can't create more objects on this OST */
45
46 int osc_create(struct obd_export *exp, struct obdo *oa,
47                struct lov_stripe_md **ea, struct obd_trans_info *oti);
48 int osc_real_create(struct obd_export *exp, struct obdo *oa,
49                struct lov_stripe_md **ea, struct obd_trans_info *oti);
50 void oscc_init(struct obd_export *exp);
51 void osc_adjust_cache(struct client_obd *cli);
52
53 #ifdef __KERNEL__
54 int lproc_osc_attach_seqstat(struct obd_device *dev);
55 #else
56 static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {}
57 #endif
58
59 #endif /* OSC_INTERNAL_H */