1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
8 #define OAP_MAGIC 8675309
10 struct osc_async_page {
13 struct list_head oap_pending_item;
14 struct list_head oap_urgent_item;
15 struct list_head oap_rpc_item;
20 obd_flag oap_brw_flags;
21 enum async_flags oap_async_flags;
23 unsigned long oap_interrupted:1;
24 struct oig_callback_context oap_occ;
25 struct page *oap_page;
26 struct obd_io_group *oap_oig;
27 struct ptlrpc_request *oap_request;
28 struct client_obd *oap_cli;
29 struct lov_oinfo *oap_loi;
31 struct obd_async_page_ops *oap_caller_ops;
32 void *oap_caller_data;
35 #define OAP_FROM_COOKIE(c) \
36 (LASSERT(((struct osc_async_page *)(c))->oap_magic == OAP_MAGIC), \
37 (struct osc_async_page *)(c))
39 struct osc_cache_waiter {
40 struct list_head ocw_entry;
41 wait_queue_head_t ocw_waitq;
42 struct osc_async_page *ocw_oap;
46 #define OSCC_FLAG_RECOVERING 0x01
47 #define OSCC_FLAG_CREATING 0x02
48 #define OSCC_FLAG_NOSPC 0x04 /* can't create more objects on OST */
49 #define OSCC_FLAG_SYNC_IN_PROGRESS 0x08 /* only allow one thread to sync */
50 #define OSCC_FLAG_LOW 0x10
51 #define OSCC_FLAG_EXITING 0x20
53 int osc_create(struct obd_export *exp, struct obdo *oa,
54 struct lov_stripe_md **ea, struct obd_trans_info *oti);
55 int osc_real_create(struct obd_export *exp, struct obdo *oa,
56 struct lov_stripe_md **ea, struct obd_trans_info *oti);
57 void oscc_init(struct obd_device *obd);
58 void osc_wake_cache_waiters(struct client_obd *cli);
60 #ifdef HAVE_QUOTA_SUPPORT
61 int osc_get_quota_flag(struct client_obd *cli, unsigned int uid,
63 int osc_set_quota_flag(struct client_obd *cli,
64 unsigned int uid, unsigned int gid,
65 obd_flag valid, obd_flag flags);
66 int osc_qinfo_cleanup(struct client_obd *cli);
67 int osc_qinfo_init(void);
68 void osc_qinfo_exit(void);
69 int osc_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl);
70 int osc_poll_quotacheck(struct obd_export *exp, struct if_quotacheck *qchk);
71 int osc_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl);
73 static inline int osc_get_quota_flag(struct client_obd *cli,
74 unsigned int uid, unsigned int gid)
78 static inline int osc_set_quota_flag(struct client_obd *cli,
79 unsigned int uid, unsigned int gid,
80 obd_flag valid, obd_flag flags)
84 static inline int osc_qinfo_cleanup(struct client_obd *cli)
88 static inline int osc_qinfo_init(void)
92 static inline void osc_qinfo_exit(void) {}
93 static inline int osc_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl)
97 static inline int osc_poll_quotacheck(struct obd_export *exp, struct if_quotacheck *qchk)
101 static inline int osc_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl)
108 int lproc_osc_attach_seqstat(struct obd_device *dev);
110 static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {return 0;}
113 #endif /* OSC_INTERNAL_H */