1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
8 #include <lustre/lustre_idl.h>
9 #include <lustre_dlm.h>
12 struct osc_async_page;
13 struct page_removal_cb_element {
14 struct list_head prce_list;
15 obd_page_removal_cb_t prce_callback;
19 typedef int (*cache_iterate_extents_cb_t)(struct lustre_cache *,
20 struct lustre_handle *,
21 struct osc_async_page *,
23 typedef int (*cache_iterate_locks_cb_t)(struct lustre_cache *,
25 struct lustre_handle *, void *);
28 struct list_head lc_locks_list;
29 spinlock_t lc_locks_list_lock;
30 struct list_head lc_page_removal_callback_list;
31 rwlock_t lc_page_removal_cb_lock; /* iterate vs modify list */
32 struct obd_device *lc_obd;
33 obd_pin_extent_cb lc_pin_extent_cb;
36 int cache_add_lock(struct lustre_cache *cache, struct lustre_handle *lockh);
37 int cache_add_extent(struct lustre_cache *cache, struct ldlm_res_id *res,
38 struct osc_async_page *extent,
39 struct lustre_handle *lockh);
40 void cache_remove_extent(struct lustre_cache *, struct osc_async_page *);
41 int cache_add_extent_removal_cb(struct lustre_cache *cache,
42 obd_page_removal_cb_t func_cb,
43 obd_pin_extent_cb pin_cb);
44 int cache_del_extent_removal_cb(struct lustre_cache *cache,
45 obd_page_removal_cb_t func_cb);
46 int cache_iterate_extents(struct lustre_cache *cache, struct lustre_handle *lockh,
47 cache_iterate_extents_cb_t cb_func, void *data);
48 int cache_remove_lock(struct lustre_cache *cache, struct lustre_handle *lockh);
49 int cache_iterate_locks(struct lustre_cache *cache, struct ldlm_res_id *res,
50 cache_iterate_locks_cb_t cb_fun, void *data);
51 struct lustre_cache *cache_create(struct obd_device *obd);
52 int cache_destroy(struct lustre_cache *cache);
55 #endif /* LUSTRE_CACHE_H */