Commit Diff


commit - 148895f4f26017f5219f2033d6e061ef950a78dc
commit + 29f1f5824909cc91325fd45105a82d1006f5e176
blob - de3e8f6710a859dbc37ab900ca0f0c48f728cdf1
blob + 02e7afb62c665b9b27d4a9a0bc732ac78acac977
--- client.c
+++ client.c
@@ -45,9 +45,7 @@ struct qid {
 
 	int			 refcount;
 
-	int			 dir;
 	int			 fd;
-
 	char			 fpath[PATH_MAX+1];
 
 	STAILQ_ENTRY(qid)	 entries;
@@ -56,7 +54,21 @@ struct qid {
 STAILQ_HEAD(fidhead, fid) fids;
 struct fid {
 	uint32_t		 fid;
+
+	/*
+	 * 0 when the fid was not yet opened for I/O otherwise set to
+	 * the bitwise or of KFIO_R for read and KFIO_W for write
+	 */
+#define KFIO_W	0x02
+#define KFIO_R	0x04
 	int			 iomode;
+
+	/*
+	 * if iomode is set, this fid was opened and fd represents its
+	 * file descriptor.
+	 */
+	int			 fd;
+
 	struct qid		*qid;
 	STAILQ_ENTRY(fid)	 entries;
 };