X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flod%2Flod_internal.h;h=3c35585f9041dd35a9c1e2d31d6991b7fbf28875;hb=e8214d6bd4ccc3ff386c77904664c60f1848ef11;hp=c3b1bc302afe6e4bc94e929bc96f2af804b0dfdd;hpb=e88992a3b5b9d9ba0a69883671f1b5888514e05d;p=fs%2Flustre-release.git diff --git a/lustre/lod/lod_internal.h b/lustre/lod/lod_internal.h index c3b1bc3..3c35585 100644 --- a/lustre/lod/lod_internal.h +++ b/lustre/lod/lod_internal.h @@ -45,6 +45,16 @@ #define LOV_USES_ASSIGNED_STRIPE 0 #define LOV_USES_DEFAULT_STRIPE 1 +/* Special values to remove LOV EA from disk */ +#define LOVEA_DELETE_VALUES(size, count, offset, pool) \ + ((size) == 0 && (count) == 0 && \ + (offset) == (typeof(offset))(-1) && (pool) == NULL) + +#define LMVEA_DELETE_VALUES(count, offset) \ + ((count) == 0 && (offset) == (typeof(offset))(-1)) + +#define LOV_OFFSET_DEFAULT ((__u16)-1) + struct lod_qos_rr { __u32 lqr_start_idx; /* start index of new inode */ __u32 lqr_offset_idx; /* aliasing for start_idx */ @@ -58,7 +68,7 @@ struct pool_desc { struct ost_pool pool_obds; /* pool members */ atomic_t pool_refcount; struct lod_qos_rr pool_rr; - cfs_hlist_node_t pool_hash; /* access by poolname */ + struct hlist_node pool_hash; /* access by poolname */ struct list_head pool_list; struct proc_dir_entry *pool_proc_entry; struct obd_device *pool_lobd; /* owner */ @@ -136,7 +146,7 @@ struct lod_tgt_descs { /* Size of the lod_tgts array, granted to be a power of 2 */ __u32 ltd_tgts_size; /* number of registered TGTs */ - int ltd_tgtnr; + __u32 ltd_tgtnr; /* bitmap of TGTs available */ cfs_bitmap_t *ltd_tgt_bitmap; /* TGTs scheduled to be deleted */ @@ -153,12 +163,13 @@ struct lod_device { struct dt_device lod_dt_dev; struct obd_export *lod_child_exp; struct dt_device *lod_child; - cfs_proc_dir_entry_t *lod_proc_entry; + struct proc_dir_entry *lod_proc_entry; struct lprocfs_stats *lod_stats; spinlock_t lod_connects_lock; int lod_connects; unsigned int lod_recovery_completed:1, - lod_initialized:1; + lod_initialized:1, + lod_lmv_failout:1; /* lov settings descriptor storing static information */ struct lov_desc lod_desc; @@ -181,15 +192,15 @@ struct lod_device { struct lod_qos lod_qos; /* qos info per lod */ /* OST pool data */ - struct ost_pool lod_pool_info; /* all OSTs in a packed array */ - int lod_pool_count; - cfs_hash_t *lod_pools_hash_body; /* used for key access */ - cfs_list_t lod_pool_list; /* used for sequential access */ - cfs_proc_dir_entry_t *lod_pool_proc_entry; + struct ost_pool lod_pool_info; /* all OSTs in a packed array */ + int lod_pool_count; + cfs_hash_t *lod_pools_hash_body; /* used for key access */ + struct list_head lod_pool_list; /* used for sequential access */ + struct proc_dir_entry *lod_pool_proc_entry; enum lustre_sec_part lod_sp_me; - cfs_proc_dir_entry_t *lod_symlink; + struct proc_dir_entry *lod_symlink; }; #define lod_osts lod_ost_descs.ltd_tgts @@ -260,13 +271,16 @@ struct lod_object { struct lod_it { struct dt_object *lit_obj; /* object from the layer below */ + /* stripe offset of iteration */ + __u32 lit_stripe_index; + __u32 lit_attr; struct dt_it *lit_it; /* iterator from the layer below */ }; struct lod_thread_info { /* per-thread buffer for LOV EA */ void *lti_ea_store; - int lti_ea_store_size; + __u32 lti_ea_store_size; /* per-thread buffer for LMV EA */ struct lu_buf lti_buf; struct ost_id lti_ostid; @@ -275,6 +289,12 @@ struct lod_thread_info { struct lu_attr lti_attr; struct lod_it lti_it; struct ldlm_res_id lti_res_id; + /* used to hold lu_dirent, sizeof(struct lu_dirent) + NAME_MAX */ + char lti_key[sizeof(struct lu_dirent) + NAME_MAX]; + struct dt_object_format lti_format; + struct lu_name lti_name; + struct lu_buf lti_linkea_buf; + struct dt_insert_rec lti_dt_rec; }; extern const struct lu_device_operations lod_lu_ops; @@ -350,6 +370,17 @@ static inline struct lod_thread_info *lod_env_info(const struct lu_env *env) return info; } +static inline struct lu_name * +lod_name_get(const struct lu_env *env, const void *area, int len) +{ + struct lu_name *lname; + + lname = &lod_env_info(env)->lti_name; + lname->ln_name = area; + lname->ln_namelen = len; + return lname; +} + #define lod_foreach_ost(__dev, index) \ if ((__dev)->lod_osts_size > 0) \ cfs_foreach_bit((__dev)->lod_ost_bitmap, (index)) @@ -368,7 +399,8 @@ int lod_del_device(const struct lu_env *env, struct lod_device *lod, unsigned gen, bool for_ost); int lod_fini_tgt(const struct lu_env *env, struct lod_device *lod, struct lod_tgt_descs *ltd, bool for_ost); -int lod_load_striping(const struct lu_env *env, struct lod_object *mo); +int lod_load_striping_locked(const struct lu_env *env, struct lod_object *lo); +int lod_load_striping(const struct lu_env *env, struct lod_object *lo); int lod_get_ea(const struct lu_env *env, struct lod_object *lo, const char *name); @@ -403,12 +435,11 @@ int lod_parse_dir_striping(const struct lu_env *env, struct lod_object *lo, const struct lu_buf *buf); int lod_initialize_objects(const struct lu_env *env, struct lod_object *mo, struct lov_ost_data_v1 *objs); -int lod_store_def_striping(const struct lu_env *env, struct dt_object *dt, - struct thandle *th); -int lod_verify_striping(struct lod_device *d, const struct lu_buf *buf, int specific); +int lod_verify_striping(struct lod_device *d, const struct lu_buf *buf, + bool is_from_disk); int lod_generate_and_set_lovea(const struct lu_env *env, struct lod_object *mo, struct thandle *th); -int lod_ea_store_resize(struct lod_thread_info *info, int size); +int lod_ea_store_resize(struct lod_thread_info *info, size_t size); /* lod_pool.c */ int lod_ost_pool_add(struct ost_pool *op, __u32 idx, unsigned int min_count); int lod_ost_pool_remove(struct ost_pool *op, __u32 idx); @@ -432,11 +463,12 @@ int qos_add_tgt(struct lod_device*, struct lod_tgt_desc *); int qos_del_tgt(struct lod_device *, struct lod_tgt_desc *); /* lproc_lod.c */ -void lprocfs_lod_init_vars(struct lprocfs_static_vars *lvars); int lod_procfs_init(struct lod_device *lod); void lod_procfs_fini(struct lod_device *lod); /* lod_object.c */ +int lod_load_lmv_shards(const struct lu_env *env, struct lod_object *lo, + struct lu_buf *buf, bool resize); int lod_object_set_pool(struct lod_object *o, char *pool); int lod_declare_striped_object(const struct lu_env *env, struct dt_object *dt, struct lu_attr *attr,