]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/fs/rock/RockIoRequests.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / fs / rock / RockIoRequests.h
index 367f4092a3262373d4db28550139b8b7feec8fc8..bf5ab37cd249c677348af6f5bcb54caf3365ac99 100644 (file)
@@ -1,8 +1,17 @@
+/*
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_FS_ROCK_IO_REQUESTS_H
 #define SQUID_FS_ROCK_IO_REQUESTS_H
 
 #include "DiskIO/ReadRequest.h"
 #include "DiskIO/WriteRequest.h"
+#include "fs/rock/forward.h"
 #include "fs/rock/RockIoState.h"
 
 class DiskFile;
@@ -10,37 +19,42 @@ class DiskFile;
 namespace Rock
 {
 
-/// \ingroup Rock
 class ReadRequest: public ::ReadRequest
 {
+    CBDATA_CLASS(ReadRequest);
+
 public:
-    ReadRequest(const ::ReadRequest &base, const IoState::Pointer &anSio);
+    ReadRequest(const ::ReadRequest &, const IoState::Pointer &, const IoXactionId);
     IoState::Pointer sio;
 
-private:
-    CBDATA_CLASS2(ReadRequest);
+    /// identifies this read transaction for the requesting IoState
+    IoXactionId id;
 };
 
-/// \ingroup Rock
 class WriteRequest: public ::WriteRequest
 {
+    CBDATA_CLASS(WriteRequest);
+
 public:
-    WriteRequest(const ::WriteRequest &base, const IoState::Pointer &anSio);
+    WriteRequest(const ::WriteRequest &, const IoState::Pointer &, const IoXactionId);
     IoState::Pointer sio;
 
+    /* We own these two reserved slots until SwapDir links them into the map. */
+
+    /// slot that will point to sidCurrent in the cache_dir map
+    SlotId sidPrevious;
+
     /// slot being written using this write request
     SlotId sidCurrent;
 
-    /// allocated next slot (negative if we are writing the last slot)
-    SlotId sidNext;
+    /// identifies this write transaction for the requesting IoState
+    IoXactionId id;
 
     /// whether this is the last request for the entry
     bool eof;
-
-private:
-    CBDATA_CLASS2(WriteRequest);
 };
 
 } // namespace Rock
 
 #endif /* SQUID_FS_ROCK_IO_REQUESTS_H */
+