Author: kpvdr
Date: 2009-01-22 15:26:18 -0500 (Thu, 22 Jan 2009)
New Revision: 3069
Modified:
store/trunk/cpp/lib/jrnl/fcntl.cpp
store/trunk/cpp/lib/jrnl/fcntl.hpp
store/trunk/cpp/lib/jrnl/jerrno.cpp
store/trunk/cpp/lib/jrnl/jerrno.hpp
Log:
Reverted the changes of r.3060. Testing has shown that the issue changed in that checkin
was no the source of the bug.
Modified: store/trunk/cpp/lib/jrnl/fcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/fcntl.cpp 2009-01-22 20:13:06 UTC (rev 3068)
+++ store/trunk/cpp/lib/jrnl/fcntl.cpp 2009-01-22 20:26:18 UTC (rev 3069)
@@ -186,6 +186,20 @@
}
u_int32_t
+fcntl::add_rd_cmpl_cnt_dblks(u_int32_t a)
+{
+ if (_rd_cmpl_cnt_dblks + a > _rd_subm_cnt_dblks)
+ {
+ std::ostringstream oss;
+ oss << "pfid=" << _pfid << " lfid="
<< _lfid << " rd_cmpl_cnt_dblks=" << _rd_cmpl_cnt_dblks
<< " incr=" << a;
+ oss << " rd_subm_cnt_dblks=" << _rd_subm_cnt_dblks;
+ throw jexception(jerrno::JERR_FCNTL_CMPLOFFSOVFL, oss.str(), "fcntl",
"add_rd_cmpl_cnt_dblks");
+ }
+ _rd_cmpl_cnt_dblks += a;
+ return _rd_cmpl_cnt_dblks;
+}
+
+u_int32_t
fcntl::add_wr_subm_cnt_dblks(u_int32_t a)
{
if (_wr_subm_cnt_dblks + a > _ffull_dblks) // Allow for file header
@@ -199,6 +213,20 @@
return _wr_subm_cnt_dblks;
}
+u_int32_t
+fcntl::add_wr_cmpl_cnt_dblks(u_int32_t a)
+{
+ if (_wr_cmpl_cnt_dblks + a > _wr_subm_cnt_dblks)
+ {
+ std::ostringstream oss;
+ oss << "pfid=" << _pfid << " lfid="
<< _lfid << " wr_cmpl_cnt_dblks=" << _wr_cmpl_cnt_dblks
<< " incr=" << a;
+ oss << " wr_subm_cnt_dblks=" << _wr_subm_cnt_dblks;
+ throw jexception(jerrno::JERR_FCNTL_CMPLOFFSOVFL, oss.str(), "fcntl",
"add_wr_cmpl_cnt_dblks");
+ }
+ _wr_cmpl_cnt_dblks += a;
+ return _wr_cmpl_cnt_dblks;
+}
+
u_int16_t
fcntl::decr_aio_cnt()
{
Modified: store/trunk/cpp/lib/jrnl/fcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/fcntl.hpp 2009-01-22 20:13:06 UTC (rev 3068)
+++ store/trunk/cpp/lib/jrnl/fcntl.hpp 2009-01-22 20:26:18 UTC (rev 3069)
@@ -101,7 +101,7 @@
inline u_int32_t rd_cmpl_cnt_dblks() const { return _rd_cmpl_cnt_dblks; }
inline std::size_t rd_cmpl_offs() const { return _rd_cmpl_cnt_dblks *
JRNL_DBLK_SIZE; }
- inline u_int32_t add_rd_cmpl_cnt_dblks(u_int32_t a) { _rd_cmpl_cnt_dblks += a;
return _rd_cmpl_cnt_dblks; }
+ u_int32_t add_rd_cmpl_cnt_dblks(u_int32_t a);
inline u_int32_t wr_subm_cnt_dblks() const { return _wr_subm_cnt_dblks; }
inline std::size_t wr_subm_offs() const { return _wr_subm_cnt_dblks *
JRNL_DBLK_SIZE; }
@@ -109,7 +109,7 @@
inline u_int32_t wr_cmpl_cnt_dblks() const { return _wr_cmpl_cnt_dblks; }
inline std::size_t wr_cmpl_offs() const { return _wr_cmpl_cnt_dblks *
JRNL_DBLK_SIZE; }
- inline u_int32_t add_wr_cmpl_cnt_dblks(u_int32_t a) { _wr_cmpl_cnt_dblks += a;
return _wr_cmpl_cnt_dblks; }
+ u_int32_t add_wr_cmpl_cnt_dblks(u_int32_t a);
inline u_int16_t aio_cnt() const { return _aio_cnt; }
inline u_int16_t incr_aio_cnt() { return ++_aio_cnt; }
Modified: store/trunk/cpp/lib/jrnl/jerrno.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.cpp 2009-01-22 20:13:06 UTC (rev 3068)
+++ store/trunk/cpp/lib/jrnl/jerrno.cpp 2009-01-22 20:26:18 UTC (rev 3069)
@@ -82,7 +82,8 @@
const u_int32_t jerrno::JERR_FCNTL_WRITE = 0x0401;
const u_int32_t jerrno::JERR_FCNTL_CLOSE = 0x0402;
const u_int32_t jerrno::JERR_FCNTL_FILEOFFSOVFL = 0x0403;
-const u_int32_t jerrno::JERR_FCNTL_RDOFFSOVFL = 0x0404;
+const u_int32_t jerrno::JERR_FCNTL_CMPLOFFSOVFL = 0x0404;
+const u_int32_t jerrno::JERR_FCNTL_RDOFFSOVFL = 0x0405;
// class lfmgr
const u_int32_t jerrno::JERR_LFMGR_BADAEFNUMLIM = 0x0500;
@@ -171,6 +172,7 @@
_err_map[JERR_FCNTL_WRITE] = "JERR_FCNTL_WRITE: Unable to write to file.";
_err_map[JERR_FCNTL_CLOSE] = "JERR_FCNTL_CLOSE: File close failed.";
_err_map[JERR_FCNTL_FILEOFFSOVFL] = "JERR_FCNTL_FILEOFFSOVFL: Attempted increase
file offset past file size.";
+ _err_map[JERR_FCNTL_CMPLOFFSOVFL] = "JERR_FCNTL_CMPLOFFSOVFL: Attempted increase
completed file offset past submitted offset.";
_err_map[JERR_FCNTL_RDOFFSOVFL] = "JERR_FCNTL_RDOFFSOVFL: Attempted increase
read offset past write offset.";
// class lfmgr
Modified: store/trunk/cpp/lib/jrnl/jerrno.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.hpp 2009-01-22 20:13:06 UTC (rev 3068)
+++ store/trunk/cpp/lib/jrnl/jerrno.hpp 2009-01-22 20:26:18 UTC (rev 3069)
@@ -100,6 +100,7 @@
static const u_int32_t JERR_FCNTL_WRITE; ///< Unable to write to file
static const u_int32_t JERR_FCNTL_CLOSE; ///< File close failed
static const u_int32_t JERR_FCNTL_FILEOFFSOVFL; ///< Increased offset past
file size
+ static const u_int32_t JERR_FCNTL_CMPLOFFSOVFL; ///< Increased cmpl offs past
subm offs
static const u_int32_t JERR_FCNTL_RDOFFSOVFL; ///< Increased read offs past
write offs
// class lfmgr
Show replies by date