summaryrefslogtreecommitdiffstats
path: root/src/ioq.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-08-23 13:10:10 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-01-18 20:36:23 -0500
commit18597572f62ab18824df6bab6c30d2b645921969 (patch)
treee4f63e91271b382ee5a816a6e892d6cdfa52440c /src/ioq.h
parent58de21264be085b96c52d48db2cddd49ce40bde3 (diff)
downloadbfs-18597572f62ab18824df6bab6c30d2b645921969.tar.xz
ioq: Implement ioq_stat()
Diffstat (limited to 'src/ioq.h')
-rw-r--r--src/ioq.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ioq.h b/src/ioq.h
index e1e5052..77aabaa 100644
--- a/src/ioq.h
+++ b/src/ioq.h
@@ -10,6 +10,7 @@
#include "config.h"
#include "dir.h"
+#include "stat.h"
#include <stddef.h>
/**
@@ -27,6 +28,8 @@ enum ioq_op {
IOQ_OPENDIR,
/** ioq_closedir(). */
IOQ_CLOSEDIR,
+ /** ioq_stat(). */
+ IOQ_STAT,
};
/**
@@ -59,6 +62,14 @@ struct ioq_ent {
struct ioq_closedir {
struct bfs_dir *dir;
} closedir;
+ /** ioq_stat() args. */
+ struct ioq_stat {
+ int dfd;
+ const char *path;
+ enum bfs_stat_flags flags;
+ struct bfs_stat *buf;
+ void *xbuf;
+ } stat;
};
};
@@ -128,6 +139,26 @@ int ioq_opendir(struct ioq *ioq, struct bfs_dir *dir, int dfd, const char *path,
int ioq_closedir(struct ioq *ioq, struct bfs_dir *dir, void *ptr);
/**
+ * Asynchronous bfs_stat().
+ *
+ * @param ioq
+ * The I/O queue.
+ * @param dfd
+ * The base file descriptor.
+ * @param path
+ * The path to stat, relative to dfd.
+ * @param flags
+ * Flags that affect the lookup.
+ * @param buf
+ * A place to store the stat buffer, if successful.
+ * @param ptr
+ * An arbitrary pointer to associate with the request.
+ * @return
+ * 0 on success, or -1 on failure.
+ */
+int ioq_stat(struct ioq *ioq, int dfd, const char *path, enum bfs_stat_flags flags, struct bfs_stat *buf, void *ptr);
+
+/**
* Pop a response from the queue.
*
* @param ioq