about summary refs log tree commit homepage
path: root/cmogstored.h
diff options
context:
space:
mode:
Diffstat (limited to 'cmogstored.h')
-rw-r--r--cmogstored.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/cmogstored.h b/cmogstored.h
index 66193b7..d7f37c9 100644
--- a/cmogstored.h
+++ b/cmogstored.h
@@ -96,10 +96,19 @@ enum mog_next {
         MOG_NEXT_IGNORE /* for iostat and fsck MD5 */
 };
 
+struct mog_ioq {
+        size_t cur;
+        size_t max;
+        pthread_mutex_t mtx;
+        SIMPLEQ_HEAD(ioq_head, mog_fd) ioq_head;
+        struct mog_svc *svc;
+};
+
 struct mog_wbuf;
 struct mog_dev {
         dev_t st_dev;
         uint32_t devid;
+        struct mog_ioq fsckq;
 };
 
 struct mog_rbuf {
@@ -130,7 +139,6 @@ struct mog_mgmt {
         struct mog_svc *svc;
         enum Gc_hash alg;
         LIST_ENTRY(mog_mgmt) subscribed;
-        SIMPLEQ_ENTRY(mog_mgmt) fsckq;
 };
 
 struct mog_queue;
@@ -301,6 +309,7 @@ struct mog_fd {
                 struct mog_queue queue;
                 struct mog_svc *svc;
         } as;
+        SIMPLEQ_ENTRY(mog_fd) ioqent;
 };
 void mog_fd_put(struct mog_fd *mfd);
 void mog_fdmap_requeue(struct mog_queue *quit_queue);
@@ -348,10 +357,11 @@ void mog_svc_aio_threads_enqueue(struct mog_svc *, size_t nr);
 void mog_svc_aio_threads_handler(void);
 
 /* dev.c */
-struct mog_dev * mog_dev_for(struct mog_svc *, uint32_t mog_devid);
+struct mog_dev *mog_dev_for(struct mog_svc *, uint32_t mog_devid, bool update);
 int mog_dev_mkusage(const struct mog_dev *, struct mog_svc *);
 size_t mog_dev_hash(const void *, size_t tablesize);
 bool mog_dev_cmp(const void *a, const void *b);
+void mog_dev_free(void *devptr);
 
 /* valid_path.rl */
 int mog_valid_path(const char *buf, size_t len);
@@ -602,3 +612,11 @@ void mog_nameinfo(struct mog_packaddr *, struct mog_ni *);
 
 /* yield.c */
 void mog_yield(void);
+
+
+/* ioq.c */
+extern __thread struct mog_ioq *mog_ioq_current;
+void mog_ioq_init(struct mog_ioq *, struct mog_svc *, size_t val);
+bool mog_ioq_ready(struct mog_ioq *, struct mog_fd *) MOG_CHECK;
+void mog_ioq_next(struct mog_ioq *);
+void mog_ioq_destroy(struct mog_ioq *);