+int tgt_reply_data_init(const struct lu_env *env, struct lu_target *tgt);
+int tgt_lookup_reply(struct ptlrpc_request *req, struct tg_reply_data *trd);
+int tgt_mk_reply_data(const struct lu_env *env, struct lu_target *tgt,
+ struct tg_export_data *ted, struct ptlrpc_request *req,
+ __u64 opdata, struct thandle *th, bool write_update,
+ __u64 transno);
+struct tg_reply_data *tgt_lookup_reply_by_xid(struct tg_export_data *ted,
+ __u64 xid);
+int tgt_tunables_init(struct lu_target *lut);
+void tgt_tunables_fini(struct lu_target *lut);
+void tgt_mask_cksum_types(struct lu_target *lut, enum cksum_types *cksum_types);
+
+/* target/tgt_grant.c */
+static inline int exp_grant_param_supp(struct obd_export *exp)
+{
+ return !!(exp_connect_flags(exp) & OBD_CONNECT_GRANT_PARAM);
+}
+
+/* Blocksize used for client not supporting OBD_CONNECT_GRANT_PARAM.
+ * That's 4KB=2^12 which is the biggest block size known to work whatever
+ * the client's page size is. */
+#define COMPAT_BSIZE_SHIFT 12
+
+void tgt_grant_sanity_check(struct obd_device *obd, const char *func);
+void tgt_grant_connect(const struct lu_env *env, struct obd_export *exp,
+ struct obd_connect_data *data, bool new_conn);
+void tgt_grant_discard(struct obd_export *exp);
+void tgt_grant_prepare_read(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa);
+void tgt_grant_prepare_write(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct niobuf_remote *rnb,
+ int niocount);
+void tgt_grant_commit(struct obd_export *exp, unsigned long grant_used, int rc);
+int tgt_grant_commit_cb_add(struct thandle *th, struct obd_export *exp,
+ unsigned long grant);
+long tgt_grant_create(const struct lu_env *env, struct obd_export *exp,
+ s64 *nr);
+int tgt_statfs_internal(const struct lu_env *env, struct lu_target *lut,
+ struct obd_statfs *osfs, time64_t max_age,
+ int *from_cache);
+ssize_t tot_dirty_show(struct kobject *kobj, struct attribute *attr,
+ char *buf);
+ssize_t tot_granted_show(struct kobject *kobj, struct attribute *attr,
+ char *buf);
+ssize_t tot_pending_show(struct kobject *kobj, struct attribute *attr,
+ char *buf);
+ssize_t grant_compat_disable_show(struct kobject *kobj, struct attribute *attr,
+ char *buf);
+ssize_t grant_compat_disable_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer, size_t count);
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
+ssize_t sync_lock_cancel_show(struct kobject *kobj,
+ struct attribute *attr, char *buf);
+ssize_t sync_lock_cancel_store(struct kobject *kobj, struct attribute *attr,
+ const char *buffer, size_t count);
+#endif
+
+/* FMD */
+void tgt_fmd_update(struct obd_export *exp, const struct lu_fid *fid,
+ __u64 xid);
+bool tgt_fmd_check(struct obd_export *exp, const struct lu_fid *fid,
+ __u64 xid);
+#ifdef DO_FMD_DROP
+void tgt_fmd_drop(struct obd_export *exp, const struct lu_fid *fid);
+#else
+#define tgt_fmd_drop(exp, fid) do {} while (0)
+#endif