X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosd-zfs%2Fosd_internal.h;h=c53ad8bdb57fb25461163163f7603437e2e0139b;hb=8fd6a0829e326935f2b20b150844d8ab07d20e05;hp=43cca114f547c0fc07c9fbff3fba6d19fc161a87;hpb=0443898cd253cea9905727f38dd027d91e614358;p=fs%2Flustre-release.git diff --git a/lustre/osd-zfs/osd_internal.h b/lustre/osd-zfs/osd_internal.h index 43cca11..c53ad8b 100644 --- a/lustre/osd-zfs/osd_internal.h +++ b/lustre/osd-zfs/osd_internal.h @@ -28,7 +28,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2013, Intel Corporation. * Use is subject to license terms. */ /* @@ -47,7 +47,17 @@ #define _OSD_INTERNAL_H #include +#include #include + +#define _SPL_KMEM_H +#include +#define kmem_zalloc(a, b) kzalloc(a, b) +#define kmem_free(ptr, sz) ((void)(sz), kfree(ptr)) +#ifndef KM_SLEEP +#define KM_SLEEP GFP_KERNEL +#endif + #include #include @@ -94,7 +104,7 @@ struct osd_zap_it { * 3 - real records */ unsigned ozi_pos:3; union { - char ozi_name[NAME_MAX + 1]; /* file name for dir */ + char ozi_name[MAXNAMELEN]; /* file name for dir */ __u64 ozi_key; /* binary key for index files */ }; }; @@ -157,7 +167,10 @@ struct osd_thread_info { }; char oti_str[64]; - char oti_key[MAXNAMELEN + 1]; + union { + char oti_key[MAXNAMELEN + 1]; + __u64 oti_key64[(MAXNAMELEN + 1)/sizeof(__u64)]; + }; struct lustre_mdt_attrs oti_mdt_attrs; struct lu_attr oti_la; @@ -235,13 +248,16 @@ struct osd_device { struct lprocfs_stats *od_stats; uint64_t od_root; + uint64_t od_O_id; struct osd_oi **od_oi_table; unsigned int od_oi_count; struct osd_seq_list od_seq_list; unsigned int od_rdonly:1, od_xattr_in_sa:1, - od_quota_iused_est:1; + od_quota_iused_est:1, + od_is_ost:1; + char od_mntdev[128]; char od_svname[128]; @@ -258,11 +274,14 @@ struct osd_device { /* used to debug zerocopy logic: the fields track all * allocated, loaned and referenced buffers in use. * to be removed once the change is tested well. */ - cfs_atomic_t od_zerocopy_alloc; - cfs_atomic_t od_zerocopy_loan; - cfs_atomic_t od_zerocopy_pin; + atomic_t od_zerocopy_alloc; + atomic_t od_zerocopy_loan; + atomic_t od_zerocopy_pin; arc_prune_t *arc_prune_cb; + + /* osd seq instance */ + struct lu_client_seq *od_cl_seq; }; struct osd_object { @@ -290,7 +309,9 @@ struct osd_object { uint64_t oo_xattr; /* record size for index file */ - int oo_recsize; + unsigned char oo_keysize; + unsigned char oo_recsize; + unsigned char oo_recusize; /* unit size */ }; int osd_statfs(const struct lu_env *, struct dt_device *, struct obd_statfs *); @@ -423,12 +444,13 @@ uint64_t osd_get_name_n_idx(const struct lu_env *env, struct osd_device *osd, int osd_options_init(void); int osd_convert_root_to_new_seq(const struct lu_env *env, struct osd_device *o); - +int osd_ost_seq_exists(const struct lu_env *env, struct osd_device *osd, + __u64 seq); /* osd_index.c */ int osd_index_try(const struct lu_env *env, struct dt_object *dt, const struct dt_index_features *feat); int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd, - const struct lu_fid *fid, struct lu_seq_range *range); + obd_seq seq, struct lu_seq_range *range); /* osd_xattr.c */ int __osd_xattr_load(udmu_objset_t *uos, uint64_t dnode, nvlist_t **sa_xattr); @@ -492,4 +514,16 @@ static inline uint32_t attrs_zfs2fs(const uint64_t flags) } #endif + +#ifndef HAVE_DSL_POOL_CONFIG +static inline void dsl_pool_config_enter(dsl_pool_t *dp, char *name) +{ +} + +static inline void dsl_pool_config_exit(dsl_pool_t *dp, char *name) +{ +} + +#endif + #endif /* _OSD_INTERNAL_H */