+/* for job stats */
+enum {
+ LPROC_OFD_STATS_READ = 0,
+ LPROC_OFD_STATS_WRITE = 1,
+ LPROC_OFD_STATS_SETATTR = 2,
+ LPROC_OFD_STATS_PUNCH = 3,
+ LPROC_OFD_STATS_SYNC = 4,
+ LPROC_OFD_STATS_LAST,
+};
+
+static inline void ofd_counter_incr(struct obd_export *exp, int opcode,
+ char *jobid, long amount)
+{
+ if (exp->exp_obd && exp->exp_obd->u.obt.obt_jobstats.ojs_hash &&
+ (exp_connect_flags(exp) & OBD_CONNECT_JOBSTATS))
+ lprocfs_job_stats_log(exp->exp_obd, jobid, opcode, amount);
+
+ if (exp->exp_nid_stats != NULL &&
+ exp->exp_nid_stats->nid_stats != NULL) {
+ if (opcode == LPROC_OFD_STATS_READ)
+ lprocfs_counter_add(exp->exp_nid_stats->nid_stats,
+ LPROC_OFD_READ_BYTES, amount);
+ else if (opcode == LPROC_OFD_STATS_WRITE)
+ lprocfs_counter_add(exp->exp_nid_stats->nid_stats,
+ LPROC_OFD_WRITE_BYTES, amount);
+ }
+}
+
+struct ofd_seq {
+ cfs_list_t os_list;
+ obd_id os_last_oid;
+ obd_seq os_seq;
+ spinlock_t os_last_oid_lock;
+ struct mutex os_create_lock;
+ cfs_atomic_t os_refc;
+ struct dt_object *os_lastid_obj;
+ unsigned long os_destroys_in_progress:1;
+};
+