+/**
+ * Free sequence structures on OFD.
+ *
+ * This function is part of OFD cleanup process, it goes through
+ * the list of ofd_seq structures stored in ofd_device structure
+ * and frees them.
+ *
+ * \param[in] env execution environment
+ * \param[in] ofd OFD device
+ */
+void ofd_seqs_free(const struct lu_env *env, struct ofd_device *ofd)
+{
+ struct ofd_seq *oseq;
+ struct ofd_seq *tmp;
+ struct list_head dispose;
+
+ INIT_LIST_HEAD(&dispose);
+ write_lock(&ofd->ofd_seq_list_lock);
+ list_for_each_entry_safe(oseq, tmp, &ofd->ofd_seq_list, os_list)
+ list_move(&oseq->os_list, &dispose);
+ write_unlock(&ofd->ofd_seq_list_lock);
+
+ while (!list_empty(&dispose)) {
+ oseq = container_of0(dispose.next, struct ofd_seq, os_list);
+ list_del_init(&oseq->os_list);
+ ofd_seq_put(env, oseq);
+ }