X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Flocal_storage.h;h=7ff6faad2a79705e55ebff218b24de4fdbe842e6;hb=8a43201a2f35f6210d7feb7fd02b79233dd6da6b;hp=177ccbead7b78356ec919a62edc15c8fc485a38a;hpb=0d43b8d1b0d68701ac408fe5d131a9dca3a2d25b;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/local_storage.h b/lustre/obdclass/local_storage.h index 177ccbe..7ff6faa 100644 --- a/lustre/obdclass/local_storage.h +++ b/lustre/obdclass/local_storage.h @@ -20,7 +20,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2012 Whamcloud, Inc. + * Copyright (c) 2012, 2014, Intel Corporation. */ /* * lustre/obdclass/local_storage.c @@ -29,6 +29,8 @@ * * Author: Mikhail Pershin */ +#ifndef __LOCAL_STORAGE_H +#define __LOCAL_STORAGE_H #include #include @@ -38,14 +40,14 @@ struct ls_device { struct dt_device ls_top_dev; /* all initialized ls_devices on this node linked by this */ - cfs_list_t ls_linkage; + struct list_head ls_linkage; /* how many handle's reference this local storage */ - cfs_atomic_t ls_refcount; + atomic_t ls_refcount; /* underlaying OSD device */ struct dt_device *ls_osd; /* list of all local OID storages */ - cfs_list_t ls_los_list; - cfs_mutex_t ls_los_mutex; + struct list_head ls_los_list; + struct mutex ls_los_mutex; }; static inline struct ls_device *dt2ls_dev(struct dt_device *d) @@ -65,12 +67,28 @@ static inline struct ls_object *lu2ls_obj(struct lu_object *o) static inline struct dt_object *ls_locate(const struct lu_env *env, struct ls_device *ls, - const struct lu_fid *fid) + const struct lu_fid *fid, + const struct lu_object_conf *conf) { - return dt_locate_at(env, ls->ls_osd, fid, &ls->ls_top_dev.dd_lu_dev); + return dt_locate_at(env, ls->ls_osd, fid, + &ls->ls_top_dev.dd_lu_dev, conf); } struct ls_device *ls_device_get(struct dt_device *dev); void ls_device_put(const struct lu_env *env, struct ls_device *ls); struct local_oid_storage *dt_los_find(struct ls_device *ls, __u64 seq); void dt_los_put(struct local_oid_storage *los); + +/* Lustre 2.3 on-disk structure describing local object OIDs storage + * the structure to be used with any sequence managed by + * local object library. + * Obsoleted since 2.4 but is kept for compatibility reasons, + * see lastid_compat_check() in obdclass/local_storage.c */ +struct los_ondisk { + __u32 lso_magic; + __u32 lso_next_oid; +}; + +#define LOS_MAGIC 0xdecafbee + +#endif