diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
commit | b4b7ff4b08e691656c9d77c758fc355833128ac0 (patch) | |
tree | 82fcb00e6b918026dc9f2d1f05ed8eee83874cc0 /drivers/staging/lustre/lustre/include/lu_object.h | |
parent | 35acfa0fc609f2a2cd95cef4a6a9c3a5c38f1778 (diff) |
Linux-libre 4.4-gnupck-4.4-gnu
Diffstat (limited to 'drivers/staging/lustre/lustre/include/lu_object.h')
-rw-r--r-- | drivers/staging/lustre/lustre/include/lu_object.h | 61 |
1 files changed, 13 insertions, 48 deletions
diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index e1d72a7a5..fa7868974 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -554,9 +554,9 @@ struct fld; struct lu_site_bkt_data { /** - * number of busy object on this bucket + * number of object in this bucket on the lsb_lru list. */ - long lsb_busy; + long lsb_lru_len; /** * LRU list, updated on each access to object. Protected by * bucket lock of lu_site::ls_obj_hash. @@ -584,6 +584,7 @@ enum { LU_SS_CACHE_RACE, LU_SS_CACHE_DEATH_RACE, LU_SS_LRU_PURGED, + LU_SS_LRU_LEN, /* # of objects in lsb_lru lists */ LU_SS_LAST_STAT }; @@ -670,9 +671,6 @@ void lu_object_fini (struct lu_object *o); void lu_object_add_top (struct lu_object_header *h, struct lu_object *o); void lu_object_add (struct lu_object *before, struct lu_object *o); -void lu_dev_add_linkage(struct lu_site *s, struct lu_device *d); -void lu_dev_del_linkage(struct lu_site *s, struct lu_device *d); - /** * Helpers to initialize and finalize device types. */ @@ -709,16 +707,12 @@ static inline int lu_object_is_dying(const struct lu_object_header *h) } void lu_object_put(const struct lu_env *env, struct lu_object *o); -void lu_object_put_nocache(const struct lu_env *env, struct lu_object *o); void lu_object_unhash(const struct lu_env *env, struct lu_object *o); int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr); void lu_site_print(const struct lu_env *env, struct lu_site *s, void *cookie, lu_printer_t printer); -struct lu_object *lu_object_find(const struct lu_env *env, - struct lu_device *dev, const struct lu_fid *f, - const struct lu_object_conf *conf); struct lu_object *lu_object_find_at(const struct lu_env *env, struct lu_device *dev, const struct lu_fid *f, @@ -790,7 +784,7 @@ do { \ \ if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \ lu_object_print(env, &msgdata, lu_cdebug_printer, object);\ - CDEBUG(mask, format , ## __VA_ARGS__); \ + CDEBUG(mask, format, ## __VA_ARGS__); \ } \ } while (0) @@ -805,7 +799,7 @@ do { \ lu_object_header_print(env, &msgdata, lu_cdebug_printer,\ (object)->lo_header); \ lu_cdebug_printer(env, &msgdata, "\n"); \ - CDEBUG(mask, format , ## __VA_ARGS__); \ + CDEBUG(mask, format, ## __VA_ARGS__); \ } \ } while (0) @@ -820,7 +814,6 @@ void lu_object_header_print(const struct lu_env *env, void *cookie, */ int lu_object_invariant(const struct lu_object *o); - /** * Check whether object exists, no matter on local or remote storage. * Note: LOHA_EXISTS will be set once some one created the object, @@ -1125,13 +1118,13 @@ struct lu_context_key { \ CLASSERT(PAGE_CACHE_SIZE >= sizeof (*value)); \ \ - OBD_ALLOC_PTR(value); \ + value = kzalloc(sizeof(*value), GFP_NOFS); \ if (value == NULL) \ value = ERR_PTR(-ENOMEM); \ \ return value; \ } \ - struct __##mod##__dummy_init {;} /* semicolon catcher */ + struct __##mod##__dummy_init {; } /* semicolon catcher */ #define LU_KEY_FINI(mod, type) \ static void mod##_key_fini(const struct lu_context *ctx, \ @@ -1139,9 +1132,9 @@ struct lu_context_key { { \ type *info = data; \ \ - OBD_FREE_PTR(info); \ + kfree(info); \ } \ - struct __##mod##__dummy_fini {;} /* semicolon catcher */ + struct __##mod##__dummy_fini {; } /* semicolon catcher */ #define LU_KEY_INIT_FINI(mod, type) \ LU_KEY_INIT(mod, type); \ @@ -1166,7 +1159,6 @@ void *lu_context_key_get (const struct lu_context *ctx, void lu_context_key_quiesce (struct lu_context_key *key); void lu_context_key_revive (struct lu_context_key *key); - /* * LU_KEY_INIT_GENERIC() has to be a macro to correctly determine an * owning module. @@ -1193,30 +1185,28 @@ void lu_context_key_revive (struct lu_context_key *key); mod##_key_init_generic(__VA_ARGS__, NULL); \ return lu_context_key_register_many(__VA_ARGS__, NULL); \ } \ - struct __##mod##_dummy_type_init {;} + struct __##mod##_dummy_type_init {; } #define LU_TYPE_FINI(mod, ...) \ static void mod##_type_fini(struct lu_device_type *t) \ { \ lu_context_key_degister_many(__VA_ARGS__, NULL); \ } \ - struct __##mod##_dummy_type_fini {;} + struct __##mod##_dummy_type_fini {; } #define LU_TYPE_START(mod, ...) \ static void mod##_type_start(struct lu_device_type *t) \ { \ lu_context_key_revive_many(__VA_ARGS__, NULL); \ } \ - struct __##mod##_dummy_type_start {;} + struct __##mod##_dummy_type_start {; } #define LU_TYPE_STOP(mod, ...) \ static void mod##_type_stop(struct lu_device_type *t) \ { \ lu_context_key_quiesce_many(__VA_ARGS__, NULL); \ } \ - struct __##mod##_dummy_type_stop {;} - - + struct __##mod##_dummy_type_stop {; } #define LU_TYPE_INIT_FINI(mod, ...) \ LU_TYPE_INIT(mod, __VA_ARGS__); \ @@ -1240,14 +1230,6 @@ void lu_context_key_degister_many(struct lu_context_key *k, ...); void lu_context_key_revive_many (struct lu_context_key *k, ...); void lu_context_key_quiesce_many (struct lu_context_key *k, ...); -/* - * update/clear ctx/ses tags. - */ -void lu_context_tags_update(__u32 tags); -void lu_context_tags_clear(__u32 tags); -void lu_session_tags_update(__u32 tags); -void lu_session_tags_clear(__u32 tags); - /** * Environment. */ @@ -1265,7 +1247,6 @@ struct lu_env { int lu_env_init (struct lu_env *env, __u32 tags); void lu_env_fini (struct lu_env *env); int lu_env_refill(struct lu_env *env); -int lu_env_refill_by_tags(struct lu_env *env, __u32 ctags, __u32 stags); /** @} lu_context */ @@ -1318,21 +1299,5 @@ struct lu_kmem_descr { int lu_kmem_init(struct lu_kmem_descr *caches); void lu_kmem_fini(struct lu_kmem_descr *caches); -void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o, - const struct lu_fid *fid); -struct lu_object *lu_object_anon(const struct lu_env *env, - struct lu_device *dev, - const struct lu_object_conf *conf); - -/** null buffer */ -extern struct lu_buf LU_BUF_NULL; - -void lu_buf_free(struct lu_buf *buf); -void lu_buf_alloc(struct lu_buf *buf, int size); -void lu_buf_realloc(struct lu_buf *buf, int size); - -int lu_buf_check_and_grow(struct lu_buf *buf, int len); -struct lu_buf *lu_buf_check_and_alloc(struct lu_buf *buf, int len); - /** @} lu */ #endif /* __LUSTRE_LU_OBJECT_H */ |