Whamcloud - gitweb
4b7fa15d9339dd996e4db5a6de2771fc78fe275b
[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 /* bug 1578: negotiate BRW_MAX_SIZE with the OST, instead of hard-coding it */
16 #define OSC_BRW_MAX_SIZE PTL_MTU
17 #define OSC_BRW_MAX_IOV PTL_MD_MAX_PAGES
18
19 #define OAP_MAGIC 8675309
20
21 struct osc_async_page {
22         int                     oap_magic;
23         struct list_head        oap_pending_item;
24         struct list_head        oap_urgent_item;
25         struct list_head        oap_rpc_item;
26         struct page             *oap_page;
27         int                     oap_cmd;
28
29         obd_off                 oap_obj_off;
30         obd_off                 oap_page_off;
31         int                     oap_count;
32         obd_flag                oap_brw_flags;
33         enum async_flags        oap_async_flags;
34
35         struct obd_sync_io_container *oap_osic;
36
37         struct obd_async_page_ops *oap_caller_ops;
38         void                   *oap_caller_data;
39 };
40
41 #define OSCC_FLAG_RECOVERING 1
42 #define OSCC_FLAG_CREATING   2
43 #define OSCC_FLAG_NOSPC      4 /* can't create more objects on this OST */
44
45 int osc_create(struct obd_export *exp, struct obdo *oa,
46                struct lov_stripe_md **ea, struct obd_trans_info *oti);
47 int osc_real_create(struct obd_export *exp, struct obdo *oa,
48                struct lov_stripe_md **ea, struct obd_trans_info *oti);
49 void oscc_init(struct obd_export *exp);
50
51 extern atomic_t osc_max_rpcs_in_flight;
52 extern atomic_t osc_max_pages_per_rpc;
53
54 #ifdef __KERNEL__
55
56 int lproc_osc_attach_seqstat(struct obd_device *dev);
57 void lproc_osc_hist(struct osc_histogram *oh, unsigned int value);
58 void lproc_osc_hist_pow2(struct osc_histogram *oh, unsigned int value);
59
60 #else /* !__KERNEL__ */
61
62 #define lproc_osc_attach_seqstat(dev) (0)
63 #define lproc_osc_hist(o,v) do{}while(0)
64 #define lproc_osc_hist_pow2(o, v) do{}while(0)
65
66 #endif
67
68 #endif /* OSC_INTERNAL_H */