X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_internal.h;h=f712f00d5264cab4c3955946b8f536096e428e86;hp=f42eb1c4efad2dfa60b7a310355159a350987b35;hb=f9a2da63abab5b8b687842166a0b5b5e434ad441;hpb=fca35f74f9ec5c5ed77e774f3e3209d9df057a01 diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index f42eb1c..f712f00 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -59,6 +59,7 @@ #include #include #include +#include struct mdt_object; @@ -66,6 +67,8 @@ struct mdt_object; struct mdt_file_data { /** portals handle must be first */ struct portals_handle mfd_open_handle; + /* export data of portals_handle */ + const struct mdt_export_data *mfd_owner; /** open mode provided by client */ u64 mfd_open_flags; /** protected by med_open_lock */ @@ -132,7 +135,9 @@ struct coordinator { struct lu_env cdt_env; /**< coordinator lustre * env */ struct lu_context cdt_session; /** session for lu_ucred */ - struct proc_dir_entry *cdt_proc_dir; /**< cdt /proc directory */ + struct dentry *cdt_debugfs_dir; /**< cdt debugfs directory */ + struct completion cdt_kobj_unregister; + struct kobject cdt_hsm_kobj; /* hsm sysfs object */ __u64 cdt_policy; /**< policy flags */ enum cdt_states cdt_state; /**< state */ struct mutex cdt_state_lock; /**< cdt_state lock */ @@ -145,14 +150,14 @@ struct coordinator { * list */ struct mutex cdt_restore_lock; /**< protect restore * list */ - time64_t cdt_loop_period; /**< llog scan period */ - time64_t cdt_grace_delay; /**< request grace + timeout_t cdt_loop_period; /**< llog scan period */ + timeout_t cdt_grace_delay; /**< request grace * delay */ - time64_t cdt_active_req_timeout; /**< request timeout */ + timeout_t cdt_active_req_timeout; /**< request timeout */ __u32 cdt_default_archive_id; /**< archive id used * when none are * specified */ - __u64 cdt_max_requests; /**< max count of started + u64 cdt_max_requests; /**< max count of started * requests */ /** Current count of active requests */ atomic_t cdt_request_count; /** total */ @@ -201,6 +206,36 @@ struct mdt_statfs_cache { __u64 msf_age; }; +/* split directory automatically when sub file count exceeds 50k */ +#define DIR_SPLIT_COUNT_DEFAULT 50000 + +/* directory auto-split allocate delta new stripes each time */ +#define DIR_SPLIT_DELTA_DEFAULT 4 + +struct mdt_dir_restriper { + struct lu_env mdr_env; + struct lu_context mdr_session; + struct task_struct *mdr_task; + /* lock for below fields */ + spinlock_t mdr_lock; + /* auto split when plain dir/shard sub files exceed threshold */ + u64 mdr_dir_split_count; + /* auto split growth delta */ + u32 mdr_dir_split_delta; + /* directories to split */ + struct list_head mdr_auto_splitting; + /* directories under which sub files are migrating */ + struct list_head mdr_migrating; + /* directories waiting to update layout after migration */ + struct list_head mdr_updating; + /* time to update directory layout after migration */ + time64_t mdr_update_time; + /* lum used in split/migrate/layout_change */ + union lmv_mds_md mdr_lmv; + /* page used in readdir */ + struct page *mdr_page; +}; + struct mdt_device { /* super-class */ struct lu_device mdt_lu_dev; @@ -251,12 +286,19 @@ struct mdt_device { mdt_enable_remote_dir:1, mdt_enable_striped_dir:1, mdt_enable_dir_migration:1, + mdt_enable_dir_restripe:1, + mdt_enable_dir_auto_split:1, + mdt_enable_remote_rename:1, mdt_skip_lfsck:1, - mdt_readonly:1; + mdt_readonly:1, + /* dir restripe migrate dirent only */ + mdt_dir_restripe_nsonly:1; /* user with gid can create remote/striped * dir, and set default dir stripe */ gid_t mdt_enable_remote_dir_gid; + /* user with this gid can change projid */ + gid_t mdt_enable_chprojid_gid; /* lock for osfs and md_root */ spinlock_t mdt_lock; @@ -285,6 +327,8 @@ struct mdt_device { atomic_t mdt_async_commit_count; struct mdt_object *mdt_md_root; + + struct mdt_dir_restriper mdt_restriper; }; #define MDT_SERVICE_WATCHDOG_FACTOR (2) @@ -296,14 +340,17 @@ struct mdt_object { struct lu_object_header mot_header; struct lu_object mot_obj; unsigned int mot_lov_created:1, /* lov object created */ - mot_cache_attr:1; /* enable remote object + mot_cache_attr:1, /* enable remote object * attribute cache */ + mot_restriping:1, /* dir restriping */ + /* dir auto-split disabled */ + mot_auto_split_disabled:1; int mot_write_count; spinlock_t mot_write_lock; - /* Lock to protect object's SOM update. */ - struct mutex mot_som_mutex; /* Lock to protect create_data */ struct mutex mot_lov_mutex; + /* Lock to protect object's SOM update. */ + struct mutex mot_som_mutex; /* lock to protect read/write stages for Data-on-MDT files */ struct rw_semaphore mot_dom_sem; /* Lock to protect lease open. @@ -311,6 +358,10 @@ struct mdt_object { struct rw_semaphore mot_open_sem; atomic_t mot_lease_count; atomic_t mot_open_count; + /* directory offset, used in sub file migration in dir restripe */ + loff_t mot_restripe_offset; + /* link to mdt_restriper auto_splitting/migrating/updating */ + struct list_head mot_restripe_linkage; }; struct mdt_lock_handle { @@ -369,7 +420,7 @@ struct mdt_reint_record { }; enum mdt_reint_flag { - MRF_OPEN_TRUNC = 1 << 0, + MRF_OPEN_TRUNC = BIT(0), }; /* @@ -377,93 +428,92 @@ enum mdt_reint_flag { * reduce stack consumption. */ struct mdt_thread_info { - /* - * XXX: Part One: - * The following members will be filled explicitly - * with specific data in mdt_thread_info_init(). - */ - /* TODO: move this into mdt_session_key(with LCT_SESSION), because - * request handling may migrate from one server thread to another. - */ - struct req_capsule *mti_pill; - - /* although we have export in req, there are cases when it is not - * available, e.g. closing files upon export destroy */ - struct obd_export *mti_exp; - /* - * A couple of lock handles. - */ - struct mdt_lock_handle mti_lh[MDT_LH_NR]; - - struct mdt_device *mti_mdt; - const struct lu_env *mti_env; - - /* transaction number of current request */ - __u64 mti_transno; - - - /* - * XXX: Part Two: - * The following members will be filled expilictly - * with zero in mdt_thread_info_init(). These members may be used - * by all requests. - */ - - /* - * Object attributes. - */ + /* + * XXX: Part One: + * The following members will be filled explicitly + * with specific data in mdt_thread_info_init(). + */ + /* TODO: move this into mdt_session_key(with LCT_SESSION), because + * request handling may migrate from one server thread to another. + */ + struct req_capsule *mti_pill; + + /* although we have export in req, there are cases when it is not + * available, e.g. closing files upon export destroy */ + struct obd_export *mti_exp; + /* + * A couple of lock handles. + */ + struct mdt_lock_handle mti_lh[MDT_LH_NR]; + + struct mdt_device *mti_mdt; + const struct lu_env *mti_env; + + /* transaction number of current request */ + __u64 mti_transno; + + /* + * XXX: Part Two: + * The following members will be filled expilictly + * with zero in mdt_thread_info_init(). These members may be used + * by all requests. + */ + + /* + * Object attributes. + */ struct md_attr mti_attr; struct md_attr mti_attr2; /* mdt_lvb.c */ - /* - * Body for "habeo corpus" operations. - */ - const struct mdt_body *mti_body; - /* - * Host object. This is released at the end of mdt_handler(). - */ - struct mdt_object *mti_object; - /* - * Lock request for "habeo clavis" operations. - */ - const struct ldlm_request *mti_dlm_req; - - __u32 mti_has_trans:1, /* has txn already? */ + /* + * Body for "habeo corpus" operations. + */ + const struct mdt_body *mti_body; + /* + * Host object. This is released at the end of mdt_handler(). + */ + struct mdt_object *mti_object; + /* + * Lock request for "habeo clavis" operations. + */ + const struct ldlm_request *mti_dlm_req; + + __u32 mti_has_trans:1, /* has txn already? */ mti_cross_ref:1, /* big_lmm buffer was used and must be used in reply */ mti_big_lmm_used:1, mti_big_acl_used:1, mti_som_valid:1; - /* opdata for mdt_reint_open(), has the same as - * ldlm_reply:lock_policy_res1. mdt_update_last_rcvd() stores this - * value onto disk for recovery when mdt_trans_stop_cb() is called. - */ - __u64 mti_opdata; - - /* - * XXX: Part Three: - * The following members will be filled explicitly - * with zero in mdt_reint_unpack(), because they are only used - * by reint requests (including mdt_reint_open()). - */ - - /* - * reint record. contains information for reint operations. - */ - struct mdt_reint_record mti_rr; - - __u64 mti_ver[PTLRPC_NUM_VERSIONS]; - /* - * Operation specification (currently create and lookup) - */ - struct md_op_spec mti_spec; - - /* - * XXX: Part Four: - * The following members will _NOT_ be initialized at all. - * DO NOT expect them to contain any valid value. - * They should be initialized explicitly by the user themselves. - */ + /* opdata for mdt_reint_open(), has the same as + * ldlm_reply:lock_policy_res1. mdt_update_last_rcvd() stores this + * value onto disk for recovery when mdt_trans_stop_cb() is called. + */ + __u64 mti_opdata; + + /* + * XXX: Part Three: + * The following members will be filled explicitly + * with zero in mdt_reint_unpack(), because they are only used + * by reint requests (including mdt_reint_open()). + */ + + /* + * reint record. contains information for reint operations. + */ + struct mdt_reint_record mti_rr; + + __u64 mti_ver[PTLRPC_NUM_VERSIONS]; + /* + * Operation specification (currently create and lookup) + */ + struct md_op_spec mti_spec; + + /* + * XXX: Part Four: + * The following members will _NOT_ be initialized at all. + * DO NOT expect them to contain any valid value. + * They should be initialized explicitly by the user themselves. + */ /* XXX: If something is in a union, make sure they do not conflict */ struct lu_fid mti_tmp_fid1; @@ -475,12 +525,10 @@ struct mdt_thread_info { char ns_name[48];/* for mdt_init0() */ struct lustre_cfg_bufs bufs; /* for mdt_stack_fini() */ struct obd_statfs osfs; /* for mdt_statfs() */ - struct { - /* for mdt_readpage() */ - struct lu_rdpg mti_rdpg; - /* for mdt_sendpage() */ - struct l_wait_info mti_wait_info; - } rdpg; + struct { + /* for mdt_readpage() */ + struct lu_rdpg mti_rdpg; + } rdpg; struct { struct md_attr attr; } hsm; @@ -494,8 +542,8 @@ struct mdt_thread_info { struct lu_buf mti_buf; struct lu_buf mti_big_buf; - /* Ops object filename */ - struct lu_name mti_name; + /* Ops object filename */ + struct lu_name mti_name; char mti_filename[NAME_MAX + 1]; /* per-thread values, can be re-used, may be vmalloc'd */ void *mti_big_lmm; @@ -510,19 +558,16 @@ struct mdt_thread_info { struct tg_reply_data *mti_reply_data; /* FLR: layout change API */ - struct md_layout_change mti_layout; + struct md_layout_change mti_mlc; + + struct lu_seq_range mti_range; }; extern struct lu_context_key mdt_thread_key; static inline struct mdt_thread_info *mdt_th_info(const struct lu_env *env) { - struct mdt_thread_info *mti; - - lu_env_refill((void *)env); - mti = lu_context_key_get(&env->le_ctx, &mdt_thread_key); - LASSERT(mti); - return mti; + return lu_env_info(env, &mdt_thread_key); } struct cdt_req_progress { @@ -659,53 +704,64 @@ static inline bool mdt_is_striped_client(struct obd_export *exp) return exp_connect_flags(exp) & OBD_CONNECT_DIR_STRIPE; } -enum { - LMM_NO_DOM, - LMM_DOM_ONLY, - LMM_DOM_OST -}; +__u32 mdt_lmm_dom_entry_check(struct lov_mds_md *lmm, int *dom_only); + +static inline bool mdt_lmm_dom_only(struct lov_mds_md *lmm) +{ + int dom_only = 0; + + mdt_lmm_dom_entry_check(lmm, &dom_only); + return dom_only; +} + +static inline __u32 mdt_lmm_dom_stripesize(struct lov_mds_md *lmm) +{ + return mdt_lmm_dom_entry_check(lmm, NULL); +} + +static inline bool mdt_lmm_is_flr(struct lov_mds_md *lmm) +{ + struct lov_comp_md_v1 *lcm = (typeof(lcm))lmm; + + return le32_to_cpu(lmm->lmm_magic) == LOV_MAGIC_COMP_V1 && + le16_to_cpu(lcm->lcm_mirror_count) > 0; +} + +static inline bool lmm_is_overstriping(struct lov_mds_md *lmm) +{ + if (le32_to_cpu(lmm->lmm_magic) == LOV_MAGIC_V1 || + le32_to_cpu(lmm->lmm_magic) == LOV_MAGIC_V3) + return le16_to_cpu(lmm->lmm_pattern) & LOV_PATTERN_OVERSTRIPING; + + return false; +} -/* XXX Look into layout in MDT layer. This must be done in LOD. */ -static inline int mdt_lmm_dom_entry(struct lov_mds_md *lmm) +static inline bool mdt_lmm_comp_overstriping(struct lov_mds_md *lmm) { struct lov_comp_md_v1 *comp_v1; struct lov_mds_md *v1; __u32 off; int i; - if (le32_to_cpu(lmm->lmm_magic) != LOV_MAGIC_COMP_V1) - return LMM_NO_DOM; - comp_v1 = (struct lov_comp_md_v1 *)lmm; - off = le32_to_cpu(comp_v1->lcm_entries[0].lcme_offset); - v1 = (struct lov_mds_md *)((char *)comp_v1 + off); - - /* DoM entry is the first entry always */ - if (lov_pattern(le32_to_cpu(v1->lmm_pattern)) != LOV_PATTERN_MDT) - return LMM_NO_DOM; for (i = 1; i < le16_to_cpu(comp_v1->lcm_entry_count); i++) { - int j; - off = le32_to_cpu(comp_v1->lcm_entries[i].lcme_offset); v1 = (struct lov_mds_md *)((char *)comp_v1 + off); - for (j = 0; j < le16_to_cpu(v1->lmm_stripe_count); j++) { - /* if there is any object on OST */ - if (le32_to_cpu(v1->lmm_objects[j].l_ost_idx) != - (__u32)-1UL) - return LMM_DOM_OST; - } + if (lmm_is_overstriping(v1)) + return true; } - return LMM_DOM_ONLY; + + return false; } -static inline bool mdt_lmm_is_flr(struct lov_mds_md *lmm) +static inline bool mdt_lmm_is_overstriping(struct lov_mds_md *lmm) { - struct lov_comp_md_v1 *lcm = (typeof(lcm))lmm; + if (le32_to_cpu(lmm->lmm_magic) == LOV_MAGIC_COMP_V1) + return mdt_lmm_comp_overstriping(lmm); - return le32_to_cpu(lmm->lmm_magic) == LOV_MAGIC_COMP_V1 && - le16_to_cpu(lcm->lcm_mirror_count) > 0; + return lmm_is_overstriping(lmm); } static inline bool mdt_is_sum_statfs_client(struct obd_export *exp) @@ -791,7 +847,7 @@ int mdt_close_unpack(struct mdt_thread_info *info); int mdt_reint_unpack(struct mdt_thread_info *info, __u32 op); void mdt_fix_lov_magic(struct mdt_thread_info *info, void *eadata); int mdt_reint_rec(struct mdt_thread_info *, struct mdt_lock_handle *); -#ifdef CONFIG_FS_POSIX_ACL +#ifdef CONFIG_LUSTRE_FS_POSIX_ACL int mdt_pack_acl2body(struct mdt_thread_info *info, struct mdt_body *repbody, struct mdt_object *o, struct lu_nodemap *nodemap); #endif @@ -838,10 +894,14 @@ int mdt_attr_get_complex(struct mdt_thread_info *info, struct mdt_object *o, struct md_attr *ma); int mdt_big_xattr_get(struct mdt_thread_info *info, struct mdt_object *o, const char *name); +int __mdt_stripe_get(struct mdt_thread_info *info, struct mdt_object *o, + struct md_attr *ma, const char *name); int mdt_stripe_get(struct mdt_thread_info *info, struct mdt_object *o, struct md_attr *ma, const char *name); int mdt_attr_get_pfid(struct mdt_thread_info *info, struct mdt_object *o, struct lu_fid *pfid); +int mdt_attr_get_pfid_name(struct mdt_thread_info *info, struct mdt_object *o, + struct lu_fid *pfid, struct lu_name *lname); int mdt_write_get(struct mdt_object *o); void mdt_write_put(struct mdt_object *o); int mdt_write_read(struct mdt_object *o); @@ -856,6 +916,7 @@ int mdt_handle_last_unlink(struct mdt_thread_info *, struct mdt_object *, struct md_attr *); void mdt_reconstruct_open(struct mdt_thread_info *, struct mdt_lock_handle *); int mdt_layout_change(struct mdt_thread_info *info, struct mdt_object *obj, + struct mdt_lock_handle *lhc, struct md_layout_change *spec); int mdt_device_sync(const struct lu_env *env, struct mdt_device *mdt); @@ -876,6 +937,10 @@ int mdt_version_get_check(struct mdt_thread_info *, struct mdt_object *, int); void mdt_version_get_save(struct mdt_thread_info *, struct mdt_object *, int); int mdt_version_get_check_save(struct mdt_thread_info *, struct mdt_object *, int); +int mdt_lookup_version_check(struct mdt_thread_info *info, + struct mdt_object *p, + const struct lu_name *lname, + struct lu_fid *fid, int idx); void mdt_thread_info_init(struct ptlrpc_request *req, struct mdt_thread_info *mti); void mdt_thread_info_fini(struct mdt_thread_info *mti); @@ -888,6 +953,7 @@ int mdt_intent_lock_replace(struct mdt_thread_info *info, struct mdt_lock_handle *lh, __u64 flags, int result); +int hsm_init_ucred(struct lu_ucred *uc); int mdt_hsm_attr_set(struct mdt_thread_info *info, struct mdt_object *obj, const struct md_hsm *mh); @@ -898,17 +964,17 @@ int mdt_links_read(struct mdt_thread_info *info, struct linkea_data *ldata); int mdt_close_internal(struct mdt_thread_info *info, struct ptlrpc_request *req, struct mdt_body *repbody); -void mdt_pack_secctx_in_reply(struct mdt_thread_info *info, - struct mdt_object *child); +int mdt_pack_secctx_in_reply(struct mdt_thread_info *info, + struct mdt_object *child); static inline struct mdt_device *mdt_dev(struct lu_device *d) { - return container_of0(d, struct mdt_device, mdt_lu_dev); + return container_of_safe(d, struct mdt_device, mdt_lu_dev); } static inline struct mdt_object *mdt_obj(struct lu_object *o) { - return container_of0(o, struct mdt_object, mot_obj); + return container_of_safe(o, struct mdt_object, mot_obj); } static inline struct dt_object *mdt_obj2dt(struct mdt_object *mo) @@ -1040,14 +1106,13 @@ static inline void mdt_hsm_cdt_event(struct coordinator *cdt) cdt->cdt_event = true; } -/* coordinator control /proc interface */ -ssize_t mdt_hsm_cdt_control_seq_write(struct file *file, - const char __user *buffer, - size_t count, loff_t *off); -int mdt_hsm_cdt_control_seq_show(struct seq_file *m, void *data); -int hsm_cdt_procfs_init(struct mdt_device *mdt); -void hsm_cdt_procfs_fini(struct mdt_device *mdt); -struct lprocfs_vars *hsm_cdt_get_proc_vars(void); +/* coordinator control sysfs interface */ +ssize_t hsm_control_show(struct kobject *kobj, struct attribute *attr, + char *buf); +ssize_t hsm_control_store(struct kobject *kobj, struct attribute *attr, + const char *buffer, size_t count); +int hsm_cdt_tunables_init(struct mdt_device *mdt); +void hsm_cdt_tunables_fini(struct mdt_device *mdt); /* md_hsm helpers */ struct mdt_object *mdt_hsm_get_md_hsm(struct mdt_thread_info *mti, const struct lu_fid *fid, @@ -1112,13 +1177,13 @@ static inline int mdt_check_resent(struct mdt_thread_info *info, if (info->mti_reply_data == NULL) RETURN(-ENOMEM); - if (req_can_reconstruct(req, info->mti_reply_data)) { + rc = req_can_reconstruct(req, info->mti_reply_data); + if (rc == 1) { reconstruct(info, lhc); - rc = 1; } else { DEBUG_REQ(D_HA, req, - "no reply data found for RESENT req"); - rc = 0; + "no reply data found for RESENT req, rc = %d", + rc); } OBD_FREE_PTR(info->mti_reply_data); info->mti_reply_data = NULL; @@ -1170,7 +1235,7 @@ static inline void mdt_fid_unlock(struct lustre_handle *lh, enum ldlm_mode mode) static inline bool mdt_slc_is_enabled(struct mdt_device *mdt) { - return mdt->mdt_lut.lut_sync_lock_cancel == BLOCKING_SYNC_ON_CANCEL; + return mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_BLOCKING; } extern mdl_mode_t mdt_mdl_lock_modes[]; @@ -1202,9 +1267,8 @@ int mdt_lsom_update(struct mdt_thread_info *info, struct mdt_object *obj, /* mdt_lvb.c */ extern struct ldlm_valblock_ops mdt_lvbo; int mdt_dom_lvb_is_valid(struct ldlm_resource *res); -int mdt_dom_lvbo_update(const struct lu_env *env, struct ldlm_resource *res, - struct ldlm_lock *lock, struct ptlrpc_request *req, - bool increase_only); +int mdt_dom_lvbo_update(struct ldlm_resource *res, struct ldlm_lock *lock, + struct ptlrpc_request *req, bool increase_only); void mdt_enable_cos(struct mdt_device *dev, bool enable); int mdt_cos_is_enabled(struct mdt_device *); @@ -1230,13 +1294,14 @@ enum mdt_stat_idx { LPROC_MDT_IO_READ, LPROC_MDT_IO_WRITE, LPROC_MDT_IO_PUNCH, + LPROC_MDT_MIGRATE, LPROC_MDT_LAST, }; void mdt_counter_incr(struct ptlrpc_request *req, int opcode); void mdt_stats_counter_init(struct lprocfs_stats *stats); -int mdt_procfs_init(struct mdt_device *mdt, const char *name); -void mdt_procfs_fini(struct mdt_device *mdt); +int mdt_tunables_init(struct mdt_device *mdt, const char *name); +void mdt_tunables_fini(struct mdt_device *mdt); /* lustre/mdt_mdt_lproc.c */ int lprocfs_mdt_open_files_seq_open(struct inode *inode, @@ -1293,8 +1358,7 @@ int mdt_brw_enqueue(struct mdt_thread_info *info, struct ldlm_namespace *ns, struct ldlm_lock **lockp, __u64 flags); int mdt_dom_read_on_open(struct mdt_thread_info *mti, struct mdt_device *mdt, struct lustre_handle *lh); -void mdt_dom_discard_data(struct mdt_thread_info *info, - const struct lu_fid *fid); +void mdt_dom_discard_data(struct mdt_thread_info *info, struct mdt_object *mo); int mdt_dom_disk_lvbo_update(const struct lu_env *env, struct mdt_object *mo, struct ldlm_resource *res, bool increase_only); void mdt_dom_obj_lvb_update(const struct lu_env *env, struct mdt_object *mo, @@ -1322,4 +1386,54 @@ long mdt_grant_connect(const struct lu_env *env, struct obd_export *exp, u64 want, bool conservative); extern struct kmem_cache *ldlm_glimpse_work_kmem; +static inline bool mdt_is_rootadmin(struct mdt_thread_info *info) +{ + struct lu_ucred *uc = NULL; + bool is_admin; + int rc; + + if (info == NULL || info->mti_body == NULL) +#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 17, 3, 0) + /* return true in case old client did not send mdt body */ + return true; +#else + return false +#endif + + rc = mdt_init_ucred(info, (struct mdt_body *)info->mti_body); + if (rc < 0) + return false; + + uc = mdt_ucred(info); + is_admin = (uc->uc_uid == 0 && uc->uc_gid == 0 && + md_capable(uc, CFS_CAP_SYS_ADMIN)); + + mdt_exit_ucred(info); + + return is_admin; +} + +int mdt_reint_migrate(struct mdt_thread_info *info, + struct mdt_lock_handle *unused); +int mdt_dir_layout_update(struct mdt_thread_info *info); + +/* directory restripe */ +int mdt_restripe_internal(struct mdt_thread_info *info, + struct mdt_object *parent, + struct mdt_object *child, + const struct lu_name *lname, + struct lu_fid *tfid, + struct md_op_spec *spec, + struct md_attr *ma); +int mdt_restriper_start(struct mdt_device *mdt); +void mdt_restriper_stop(struct mdt_device *mdt); +void mdt_auto_split_add(struct mdt_thread_info *info, struct mdt_object *o); +void mdt_restripe_migrate_add(struct mdt_thread_info *info, + struct mdt_object *o); +void mdt_restripe_update_add(struct mdt_thread_info *info, + struct mdt_object *o); +int mdt_is_remote_object(struct mdt_thread_info *info, + struct mdt_object *parent, + struct mdt_object *child); + #endif /* _MDT_INTERNAL_H */