+int lproc_ofd_attach_seqstat(struct obd_device *dev);
+extern struct file_operations ofd_per_nid_stats_fops;
+void ofd_stats_counter_init(struct lprocfs_stats *stats);
+#else
+static void lprocfs_ofd_init_vars(struct lprocfs_static_vars *lvars)
+{
+ memset(lvars, 0, sizeof(*lvars));
+}
+static inline int lproc_ofd_attach_seqstat(struct obd_device *dev) {}
+static inline void ofd_stats_counter_init(struct lprocfs_stats *stats) {}
+#endif
+
+/* ofd_objects.c */
+struct ofd_object *ofd_object_find(const struct lu_env *env,
+ struct ofd_device *ofd,
+ const struct lu_fid *fid);
+struct ofd_object *ofd_object_find_or_create(const struct lu_env *env,
+ struct ofd_device *ofd,
+ const struct lu_fid *fid,
+ struct lu_attr *attr);
+int ofd_object_ff_check(const struct lu_env *env, struct ofd_object *fo);
+int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd,
+ obd_id id, obd_seq group, int nr);
+
+void ofd_object_put(const struct lu_env *env, struct ofd_object *fo);
+int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo,
+ struct lu_attr *la, struct filter_fid *ff);
+int ofd_object_punch(const struct lu_env *env, struct ofd_object *fo,
+ __u64 start, __u64 end, struct lu_attr *la,
+ struct filter_fid *ff);
+int ofd_object_destroy(const struct lu_env *, struct ofd_object *, int);
+int ofd_attr_get(const struct lu_env *env, struct ofd_object *fo,
+ struct lu_attr *la);
+int ofd_attr_handle_ugid(const struct lu_env *env, struct ofd_object *fo,
+ struct lu_attr *la, int is_setattr);
+
+/* ofd_grants.c */
+#define OFD_GRANT_RATIO_SHIFT 8
+static inline __u64 ofd_grant_reserved(struct ofd_device *ofd, obd_size bavail)
+{
+ return (bavail * ofd->ofd_grant_ratio) >> OFD_GRANT_RATIO_SHIFT;
+}
+
+static inline int ofd_grant_ratio_conv(int percentage)
+{
+ return (percentage << OFD_GRANT_RATIO_SHIFT) / 100;
+}
+
+static inline int ofd_grant_param_supp(struct obd_export *exp)
+{
+ return !!(exp->exp_connect_flags & 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
+static inline int ofd_grant_compat(struct obd_export *exp,
+ struct ofd_device *ofd)
+{
+ /* Clients which don't support OBD_CONNECT_GRANT_PARAM cannot handle
+ * a block size > page size and consume CFS_PAGE_SIZE of grant when
+ * dirtying a page regardless of the block size */
+ return !!(ofd_obd(ofd)->obd_self_export != exp &&
+ ofd->ofd_blockbits > COMPAT_BSIZE_SHIFT &&
+ !ofd_grant_param_supp(exp));
+}
+
+static inline int ofd_grant_prohibit(struct obd_export *exp,
+ struct ofd_device *ofd)
+{
+ /* When ofd_grant_compat_disable is set, we don't grant any space to
+ * clients not supporting OBD_CONNECT_GRANT_PARAM.
+ * Otherwise, space granted to such a client is inflated since it
+ * consumes CFS_PAGE_SIZE of grant space per block */
+ return !!(ofd_grant_compat(exp, ofd) && ofd->ofd_grant_compat_disable);
+}
+
+void ofd_grant_sanity_check(struct obd_device *obd, const char *func);
+long ofd_grant_connect(const struct lu_env *env, struct obd_export *exp,
+ obd_size want);
+void ofd_grant_discard(struct obd_export *exp);
+void ofd_grant_prepare_read(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa);
+void ofd_grant_prepare_write(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct niobuf_remote *rnb,
+ int niocount);
+void ofd_grant_commit(const struct lu_env *env, struct obd_export *exp, int rc);
+int ofd_grant_create(const struct lu_env *env, struct obd_export *exp, int *nr);
+
+/* ofd_fmd.c */
+int ofd_fmd_init(void);
+void ofd_fmd_exit(void);
+struct ofd_mod_data *ofd_fmd_find(struct obd_export *exp,
+ struct lu_fid *fid);
+struct ofd_mod_data *ofd_fmd_get(struct obd_export *exp,
+ struct lu_fid *fid);
+void ofd_fmd_put(struct obd_export *exp, struct ofd_mod_data *fmd);
+void ofd_fmd_expire(struct obd_export *exp);
+void ofd_fmd_cleanup(struct obd_export *exp);
+#ifdef DO_FMD_DROP
+void ofd_fmd_drop(struct obd_export *exp, struct lu_fid *fid);
+#else
+#define ofd_fmd_drop(exp, fid) do {} while (0)
+#endif
+
+/* ofd_lvb.c */
+extern struct ldlm_valblock_ops ofd_lvbo;
+
+/* ofd_dlm.c */
+int ofd_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp,
+ void *req_cookie, ldlm_mode_t mode, int flags,
+ void *data);