X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdc%2Fmdc_internal.h;h=792cdbf18ecdde118e7978c949bb44a7ec3fc7fa;hp=18d300157ec317bd68bdad3a471073a51474f1b1;hb=3e76334402a71e37aed4e9a5166d0141e30af375;hpb=169738e30a7e0b57f27a517d78d2c928b3bb0f5c diff --git a/lustre/mdc/mdc_internal.h b/lustre/mdc/mdc_internal.h index 18d3001..792cdbf 100644 --- a/lustre/mdc/mdc_internal.h +++ b/lustre/mdc/mdc_internal.h @@ -56,9 +56,11 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data, void mdc_file_secctx_pack(struct ptlrpc_request *req, const char *secctx_name, const void *secctx, size_t secctx_size); +void mdc_file_encctx_pack(struct ptlrpc_request *req, + const void *encctx, size_t encctx_size); +void mdc_file_sepol_pack(struct ptlrpc_request *req); void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data); -void mdc_getxattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data); void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data); void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data, const char *old, size_t oldlen, @@ -85,33 +87,24 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo, const union ldlm_policy_data *policy, struct md_op_data *op_data, struct lustre_handle *lockh, __u64 extra_lock_flags); - +int mdc_resource_get_unused_res(struct obd_export *exp, + struct ldlm_res_id *res_id, + struct list_head *cancels, + enum ldlm_mode mode, __u64 bits); int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid, struct list_head *cancels, enum ldlm_mode mode, __u64 bits); -int mdc_save_lovea(struct ptlrpc_request *req, - const struct req_msg_field *field, - void *data, u32 size); /* mdc/mdc_request.c */ int mdc_fid_alloc(const struct lu_env *env, struct obd_export *exp, struct lu_fid *fid, struct md_op_data *op_data); int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg); -int mdc_process_config(struct obd_device *obd, size_t len, void *buf); struct obd_client_handle; -int mdc_get_lustre_md(struct obd_export *md_exp, struct ptlrpc_request *req, - struct obd_export *dt_exp, struct obd_export *lmv_exp, - struct lustre_md *md); - -int mdc_free_lustre_md(struct obd_export *exp, struct lustre_md *md); - int mdc_set_open_replay_data(struct obd_export *exp, struct obd_client_handle *och, struct lookup_intent *it); -int mdc_clear_open_replay_data(struct obd_export *exp, - struct obd_client_handle *och); void mdc_commit_open(struct ptlrpc_request *req); void mdc_replay_open(struct ptlrpc_request *req); @@ -146,6 +139,12 @@ enum ldlm_mode mdc_lock_match(struct obd_export *exp, __u64 flags, enum ldlm_mode mode, struct lustre_handle *lockh); +#define MDC_CHANGELOG_DEV_COUNT LMV_MAX_STRIPE_COUNT +#define MDC_CHANGELOG_DEV_NAME "changelog" +extern struct class *mdc_changelog_class; +extern dev_t mdc_changelog_dev; +extern struct idr mdc_changelog_minor_idr; + int mdc_changelog_cdev_init(struct obd_device *obd); void mdc_changelog_cdev_finish(struct obd_device *obd); @@ -158,6 +157,26 @@ static inline int mdc_prep_elc_req(struct obd_export *exp, count); } +#ifdef CONFIG_LUSTRE_FS_POSIX_ACL +int mdc_unpack_acl(struct ptlrpc_request *req, struct lustre_md *md); +#else +static inline +int mdc_unpack_acl(struct ptlrpc_request *req, struct lustre_md *md) +{ + return 0; +} +#endif + +static inline void mdc_body2lvb(struct mdt_body *body, struct ost_lvb *lvb) +{ + LASSERT(body->mbo_valid & OBD_MD_DOM_SIZE); + lvb->lvb_mtime = body->mbo_mtime; + lvb->lvb_atime = body->mbo_atime; + lvb->lvb_ctime = body->mbo_ctime; + lvb->lvb_blocks = body->mbo_dom_blocks; + lvb->lvb_size = body->mbo_dom_size; +} + static inline unsigned long hash_x_index(__u64 hash, int hash64) { if (BITS_PER_LONG == 32 && hash64) @@ -173,7 +192,8 @@ int mdc_ldlm_blocking_ast(struct ldlm_lock *dlmlock, int mdc_ldlm_glimpse_ast(struct ldlm_lock *dlmlock, void *data); int mdc_fill_lvb(struct ptlrpc_request *req, struct ost_lvb *lvb); -#define MDC_DOM_DEF_INLINE_REPSIZE 8192 +/* the minimum inline repsize should be PAGE_SIZE at least */ +#define MDC_DOM_DEF_INLINE_REPSIZE max(8192UL, PAGE_SIZE) #define MDC_DOM_MAX_INLINE_REPSIZE XATTR_SIZE_MAX #endif