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;
18 typedef int (*cache_iterate_extents_cb_t)(struct lustre_cache *,
19 struct lustre_handle *,
20 struct osc_async_page *,
22 typedef int (*cache_iterate_locks_cb_t)(struct lustre_cache *,
24 struct lustre_handle *, void *);
27 struct list_head lc_locks_list;
28 spinlock_t lc_locks_list_lock;
29 struct list_head lc_page_removal_callback_list;
30 struct obd_device *lc_obd;
31 obd_pin_extent_cb lc_pin_extent_cb;
34 int cache_add_lock(struct lustre_cache *cache, struct lustre_handle *lockh);
35 int cache_add_extent(struct lustre_cache *cache, struct ldlm_res_id *res,
36 struct osc_async_page *extent,
37 struct lustre_handle *lockh);
38 void cache_remove_extent(struct lustre_cache *, struct osc_async_page *);
39 int cache_add_extent_removal_cb(struct lustre_cache *cache,
40 obd_page_removal_cb_t func_cb,
41 obd_pin_extent_cb pin_cb);
42 int cache_del_extent_removal_cb(struct lustre_cache *cache,
43 obd_page_removal_cb_t func_cb);
44 int cache_iterate_extents(struct lustre_cache *cache, struct lustre_handle *lockh,
45 cache_iterate_extents_cb_t cb_func, void *data);
46 int cache_remove_lock(struct lustre_cache *cache, struct lustre_handle *lockh);
47 int cache_iterate_locks(struct lustre_cache *cache, struct ldlm_res_id *res,
48 cache_iterate_locks_cb_t cb_fun, void *data);
49 struct lustre_cache *cache_create(struct obd_device *obd);
50 int cache_destroy(struct lustre_cache *cache);
53 #endif /* LUSTRE_CACHE_H */