Whamcloud - gitweb
Land b_smallfix onto HEAD (20040223_1817)
[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         unsigned long           oap_interrupted:1;
37         struct obd_io_group      *oap_oig;
38         struct oig_callback_context oap_occ;
39         struct ptlrpc_request   *oap_request;
40         struct client_obd       *oap_cli;
41         struct lov_oinfo        *oap_loi;
42
43         struct obd_async_page_ops *oap_caller_ops;
44         void                   *oap_caller_data;
45 };
46
47 struct osc_cache_waiter {
48         struct list_head        ocw_entry;
49         wait_queue_head_t       ocw_waitq;
50         struct osc_async_page   *ocw_oap;
51         int                     ocw_rc;
52 };
53
54 #define OSCC_FLAG_RECOVERING 1
55 #define OSCC_FLAG_CREATING   2
56 #define OSCC_FLAG_NOSPC      4 /* can't create more objects on this OST */
57
58 int osc_create(struct obd_export *exp, struct obdo *oa,
59                struct lov_stripe_md **ea, struct obd_trans_info *oti);
60 int osc_real_create(struct obd_export *exp, struct obdo *oa,
61                struct lov_stripe_md **ea, struct obd_trans_info *oti);
62 void oscc_init(struct obd_export *exp);
63 void osc_wake_cache_waiters(struct client_obd *cli);
64
65 #ifdef __KERNEL__
66 int lproc_osc_attach_seqstat(struct obd_device *dev);
67 #else
68 static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {return 0;}
69 #endif
70
71 #endif /* OSC_INTERNAL_H */