mirror of
https://review.haiku-os.org/haiku
synced 2025-01-18 04:28:52 +01:00
ramfs: Add some WriteLocked assertions.
These would have caught the problem in #19360.
This commit is contained in:
parent
6d6a53f147
commit
48bfa9ee2f
@ -237,6 +237,8 @@ status_t
|
||||
AttributeIndexImpl::Changed(Attribute *attribute, const uint8 *oldKey,
|
||||
size_t oldLength)
|
||||
{
|
||||
fVolume->AssertWriteLocked();
|
||||
|
||||
status_t error = B_BAD_VALUE;
|
||||
if (attribute && attribute->GetIndex() == this) {
|
||||
// update the iterators and remove the attribute from the tree
|
||||
|
@ -147,6 +147,8 @@ LastModifiedIndex::CountEntries() const
|
||||
status_t
|
||||
LastModifiedIndex::Changed(Node *node, time_t oldModified)
|
||||
{
|
||||
fVolume->AssertWriteLocked();
|
||||
|
||||
status_t error = B_BAD_VALUE;
|
||||
if (node) {
|
||||
NodeTree::Iterator it;
|
||||
|
@ -145,6 +145,8 @@ SizeIndex::CountEntries() const
|
||||
status_t
|
||||
SizeIndex::Changed(Node *node, off_t oldSize)
|
||||
{
|
||||
fVolume->AssertWriteLocked();
|
||||
|
||||
status_t error = B_BAD_VALUE;
|
||||
if (node) {
|
||||
NodeTree::Iterator it;
|
||||
|
@ -163,6 +163,7 @@ public:
|
||||
void ReadUnlock();
|
||||
bool WriteLock();
|
||||
void WriteUnlock();
|
||||
inline void AssertWriteLocked() { ASSERT_WRITE_LOCKED_RW_LOCK(&fLocker); }
|
||||
|
||||
bool IteratorLock();
|
||||
void IteratorUnlock();
|
||||
|
Loading…
Reference in New Issue
Block a user