struct obd_export *mdt_bottom_exp;
/** target device */
struct lu_target mdt_lut;
- /*
- * Options bit-fields.
- */
- struct {
- signed int mo_user_xattr :1,
- mo_acl :1,
- mo_compat_resname:1,
- mo_mds_capa :1,
- mo_oss_capa :1,
- mo_cos :1;
- } mdt_opts;
+ /*
+ * Options bit-fields.
+ */
+ struct {
+ unsigned int mo_user_xattr:1,
+ mo_acl:1,
+ mo_compat_resname:1,
+ mo_mds_capa:1,
+ mo_oss_capa:1,
+ mo_cos:1;
+ } mdt_opts;
/* mdt state flags */
unsigned long mdt_state;
/* lock to protect IOepoch */
cfs_timer_t mdt_ck_timer;
struct ptlrpc_thread mdt_ck_thread;
struct lustre_capa_key mdt_capa_keys[2];
- unsigned int mdt_capa_conf:1,
- mdt_som_conf:1;
+ unsigned int mdt_capa_conf:1,
+ mdt_som_conf:1,
+ mdt_enable_remote_dir:1;
/* statfs optimization: we cache a bit */
struct obd_statfs mdt_osfs;
struct lustre_handle mlh_pdo_lh;
ldlm_mode_t mlh_pdo_mode;
unsigned int mlh_pdo_hash;
+
+ /* Remote regular lock */
+ struct lustre_handle mlh_rreg_lh;
+ ldlm_mode_t mlh_rreg_mode;
};
enum {
struct lu_buf buf;
loff_t pos;
} write;
+ struct {
+ struct ost_body *body;
+ } destroy;
} u;
};
static inline __u64 mdt_conn_flags(struct mdt_thread_info *info)
{
- LASSERT(info->mti_exp);
- return info->mti_exp->exp_connect_flags;
+ LASSERT(info->mti_exp);
+ return exp_connect_flags(info->mti_exp);
}
static inline void mdt_object_get(const struct lu_env *env,
return lu_object_exists(&o->mot_obj.mo_lu);
}
+static inline int mdt_object_remote(const struct mdt_object *o)
+{
+ return lu_object_remote(&o->mot_obj.mo_lu);
+}
+
static inline const struct lu_fid *mdt_object_fid(const struct mdt_object *o)
{
return lu_object_fid(&o->mot_obj.mo_lu);
class_export_put(exp);
}
+/* Here we use LVB_TYPE to check dne client, because it is
+ * also landed on 2.4. */
+static inline int mdt_is_dne_client(struct obd_export *exp)
+{
+ return !!(exp_connect_flags(exp) & OBD_CONNECT_LVB_TYPE);
+}
+
int mdt_get_disposition(struct ldlm_reply *rep, int flag);
void mdt_set_disposition(struct mdt_thread_info *info,
struct ldlm_reply *rep, int flag);
void mdt_client_compatibility(struct mdt_thread_info *info);
+int mdt_remote_object_lock(struct mdt_thread_info *mti,
+ struct mdt_object *o, struct lustre_handle *lh,
+ ldlm_mode_t mode, __u64 ibits);
int mdt_close_unpack(struct mdt_thread_info *info);
int mdt_reint_unpack(struct mdt_thread_info *info, __u32 op);
int mdt_reint_rec(struct mdt_thread_info *, struct mdt_lock_handle *);
int mdt_quotacheck(struct mdt_thread_info *info);
int mdt_quotactl(struct mdt_thread_info *info);
int mdt_quota_dqacq(struct mdt_thread_info *info);
+int mdt_swap_layouts(struct mdt_thread_info *info);
extern struct lprocfs_vars lprocfs_mds_module_vars[];
extern struct lprocfs_vars lprocfs_mds_obd_vars[];
void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars);
void lprocfs_mds_init_vars(struct lprocfs_static_vars *lvars);
int mdt_procfs_init(struct mdt_device *mdt, const char *name);
-int mdt_procfs_fini(struct mdt_device *mdt);
+void mdt_procfs_fini(struct mdt_device *mdt);
void mdt_rename_counter_tally(struct mdt_thread_info *info,
struct mdt_device *mdt,
struct ptlrpc_request *req,
int mdt_capa_keys_init(const struct lu_env *env, struct mdt_device *mdt);
static inline void mdt_set_capainfo(struct mdt_thread_info *info, int offset,
- const struct lu_fid *fid,
- struct lustre_capa *capa)
+ const struct lu_fid *fid,
+ struct lustre_capa *capa)
{
- struct md_capainfo *ci;
+ struct md_capainfo *ci;
LASSERT(offset >= 0 && offset < MD_CAPAINFO_MAX);
- if (!info->mti_mdt->mdt_opts.mo_mds_capa ||
- !(info->mti_exp->exp_connect_flags & OBD_CONNECT_MDS_CAPA))
- return;
-
- ci = md_capainfo(info->mti_env);
- LASSERT(ci);
- ci->mc_fid[offset] = *fid;
- ci->mc_capa[offset] = capa;
+ if (!info->mti_mdt->mdt_opts.mo_mds_capa ||
+ !(exp_connect_flags(info->mti_exp) & OBD_CONNECT_MDS_CAPA))
+ return;
+
+ ci = md_capainfo(info->mti_env);
+ LASSERT(ci);
+ ci->mc_fid[offset] = *fid;
+ ci->mc_capa[offset] = capa;
}
static inline void mdt_dump_capainfo(struct mdt_thread_info *info)