hrev53437 adds 5 changesets to branch 'master'
old head: 731be7dde11e3901859e6d527cd59a0ff566df3e
new head: 349ab0050a7038378f9d17b4e6d9083284d9efc6
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=349ab0050a70+%5E731be7dde11e
----------------------------------------------------------------------------
b9795faf5d27: ramfs: Add MIT license header to all files lacking copyright info.
OK'ed by Ingo via email.
c3e0275cc53d: ramfs: Adapt to current kernel FS APIs and fully fix the build.
b2c20927e8d0: ramfs: Fix setting the ops and an incorrect node cast.
And now ramfs works!
2914364270fc: ramfs: Fix debugging print macro invocations and use B_PRI*.
349ab0050a70: ramfs: Fix miscellaneous warnings.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
61 files changed, 383 insertions(+), 261 deletions(-)
.../kernel/file_systems/ramfs/AllocationInfo.cpp | 55 +++++-----
.../kernel/file_systems/ramfs/AllocationInfo.h | 6 +-
.../kernel/file_systems/ramfs/Attribute.cpp | 5 +-
.../kernel/file_systems/ramfs/Attribute.h | 6 +-
.../kernel/file_systems/ramfs/AttributeIndex.cpp | 6 +-
.../kernel/file_systems/ramfs/AttributeIndex.h | 6 +-
.../file_systems/ramfs/AttributeIndexImpl.cpp | 13 ++-
.../file_systems/ramfs/AttributeIndexImpl.h | 6 +-
.../file_systems/ramfs/AttributeIterator.cpp | 6 +-
.../file_systems/ramfs/AttributeIterator.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Block.h | 6 +-
.../kernel/file_systems/ramfs/BlockAllocator.cpp | 23 ++--
.../kernel/file_systems/ramfs/BlockAllocator.h | 6 +-
.../file_systems/ramfs/BlockAllocatorArea.cpp | 29 +++---
.../file_systems/ramfs/BlockAllocatorArea.h | 6 +-
.../ramfs/BlockAllocatorAreaBucket.cpp | 6 +-
.../ramfs/BlockAllocatorAreaBucket.h | 6 +-
.../file_systems/ramfs/BlockAllocatorMisc.h | 6 +-
.../file_systems/ramfs/BlockReferenceManager.cpp | 5 +-
.../file_systems/ramfs/BlockReferenceManager.h | 6 +-
.../kernel/file_systems/ramfs/DataContainer.cpp | 15 +--
.../kernel/file_systems/ramfs/DataContainer.h | 8 +-
.../kernel/file_systems/ramfs/Directory.cpp | 9 +-
.../kernel/file_systems/ramfs/Directory.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Entry.cpp | 5 +-
src/add-ons/kernel/file_systems/ramfs/Entry.h | 6 +-
.../kernel/file_systems/ramfs/EntryIterator.cpp | 5 +-
.../kernel/file_systems/ramfs/EntryIterator.h | 6 +-
.../kernel/file_systems/ramfs/EntryListener.cpp | 5 +-
.../kernel/file_systems/ramfs/EntryListener.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/File.cpp | 5 +-
src/add-ons/kernel/file_systems/ramfs/File.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Index.cpp | 11 +-
src/add-ons/kernel/file_systems/ramfs/Index.h | 6 +-
.../kernel/file_systems/ramfs/IndexDirectory.cpp | 7 +-
.../kernel/file_systems/ramfs/IndexDirectory.h | 6 +-
.../kernel/file_systems/ramfs/IndexImpl.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Jamfile | 4 +
.../file_systems/ramfs/LastModifiedIndex.cpp | 5 +-
.../file_systems/ramfs/LastModifiedIndex.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Locking.h | 5 +-
.../kernel/file_systems/ramfs/NameIndex.cpp | 5 +-
.../kernel/file_systems/ramfs/NameIndex.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Node.cpp | 11 +-
src/add-ons/kernel/file_systems/ramfs/Node.h | 6 +-
.../kernel/file_systems/ramfs/NodeChildTable.h | 6 +-
.../kernel/file_systems/ramfs/NodeListener.cpp | 5 +-
.../kernel/file_systems/ramfs/NodeListener.h | 5 +-
.../kernel/file_systems/ramfs/NodeTable.cpp | 5 +-
.../kernel/file_systems/ramfs/NodeTable.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Query.cpp | 104 +++++++++----------
.../kernel/file_systems/ramfs/SizeIndex.cpp | 5 +-
.../kernel/file_systems/ramfs/SizeIndex.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/String.h | 24 +----
.../kernel/file_systems/ramfs/SymLink.cpp | 5 +-
src/add-ons/kernel/file_systems/ramfs/SymLink.h | 6 +-
src/add-ons/kernel/file_systems/ramfs/Volume.cpp | 34 +++---
src/add-ons/kernel/file_systems/ramfs/Volume.h | 3 +-
.../file_systems/ramfs/kernel_interface.cpp | 38 +++----
src/add-ons/kernel/file_systems/ramfs/ramfs.h | 7 +-
.../kernel/file_systems/ramfs/ramfs_ioctl.h | 5 +-
############################################################################
Commit: b9795faf5d27edaf49acb9f884ba181c0f0ae66b
URL: https://git.haiku-os.org/haiku/commit/?id=b9795faf5d27
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Fri Aug 30 22:48:11 2019 UTC
ramfs: Add MIT license header to all files lacking copyright info.
OK'ed by Ingo via email.
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
b/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
index a5ca653ed9..819d477ec2 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
@@ -1,6 +1,9 @@
-// AllocationInfo.cpp
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
+
#include "DebugSupport.h"
#include "Attribute.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.h
b/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.h
index da12677e15..d2bf764bc9 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.h
+++ b/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.h
@@ -1,5 +1,7 @@
-// AllocationInfo.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ALLOCATION_INFO_H
#define ALLOCATION_INFO_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp
b/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp
index 4d45dcafd0..93e0de294c 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp
@@ -1,4 +1,7 @@
-// Attribute.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
#include "Attribute.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/Attribute.h
b/src/add-ons/kernel/file_systems/ramfs/Attribute.h
index e13b26a267..b87440dd0b 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Attribute.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Attribute.h
@@ -1,5 +1,7 @@
-// Attribute.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ATTRIBUTE_H
#define ATTRIBUTE_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.cpp
b/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.cpp
index 3d85ec0824..27f9a9d3be 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.cpp
@@ -1,5 +1,7 @@
-// AttributeIndex.cpp
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AttributeIndex.h"
// constructor
diff --git a/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.h
b/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.h
index 0fc73d92bb..8913642a51 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.h
+++ b/src/add-ons/kernel/file_systems/ramfs/AttributeIndex.h
@@ -1,5 +1,7 @@
-// AttributeIndex.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ATTRIBUTE_INDEX_H
#define ATTRIBUTE_INDEX_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
b/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
index 22730ef8bc..8b4f19675b 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
@@ -1,4 +1,7 @@
-// AttributeIndexImpl.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include <TypeConstants.h>
diff --git a/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.h
b/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.h
index dcdfecbca0..768ec01a2c 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.h
+++ b/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.h
@@ -1,5 +1,7 @@
-// AttributeIndexImpl.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ATTRIBUTE_INDEX_IMPL_H
#define ATTRIBUTE_INDEX_IMPL_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.cpp
b/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.cpp
index add194cbf2..1a51bfe2a2 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.cpp
@@ -1,5 +1,7 @@
-// AttributeIterator.cpp
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AttributeIterator.h"
#include "Node.h"
#include "Volume.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.h
b/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.h
index 98fa30f607..a58eb3b834 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.h
+++ b/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.h
@@ -1,5 +1,7 @@
-// AttributeIterator.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ATTRIBUTE_ITERATOR_H
#define ATTRIBUTE_ITERATOR_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/Block.h
b/src/add-ons/kernel/file_systems/ramfs/Block.h
index 1443f8de27..1a5bc7f404 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Block.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Block.h
@@ -1,5 +1,7 @@
-// Block.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef BLOCK_H
#define BLOCK_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
index 38aaf639f7..84294740a8 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
@@ -1,4 +1,7 @@
-// BlockAllocator.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
// debugging
#define BA_DEFINE_INLINES 1
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.h
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.h
index 703a430a4e..87254f0f98 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.h
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.h
@@ -1,5 +1,7 @@
-// BlockAllocator.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef BLOCK_ALLOCATOR_H
#define BLOCK_ALLOCATOR_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
index 5bf3baba2f..aa0bbbfca9 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
@@ -1,4 +1,7 @@
-// BlockAllocatorArea.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "BlockAllocatorArea.h"
#include "DebugSupport.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.h
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.h
index 3e9d8e04c7..8700bc8bd4 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.h
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.h
@@ -1,5 +1,7 @@
-// BlockAllocatorArea.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef BLOCK_ALLOCATOR_AREA_H
#define BLOCK_ALLOCATOR_AREA_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.cpp
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.cpp
index 1adfb7828e..200c8cded0 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.cpp
@@ -1,5 +1,7 @@
-// BlockAllocatorAreaBucket.cpp
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "BlockAllocatorAreaBucket.h"
// constructor
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.h
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.h
index fa2308c868..5af666c06b 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.h
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorAreaBucket.h
@@ -1,5 +1,7 @@
-// BlockAllocatorAreaBucket.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef BLOCK_ALLOCATOR_AREA_BUCKET_H
#define BLOCK_ALLOCATOR_AREA_BUCKET_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h
index d9d184b474..117450c7de 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h
@@ -1,5 +1,7 @@
-// BlockAllocatorMisc.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef BLOCK_ALLOCATOR_MISC_H
#define BLOCK_ALLOCATOR_MISC_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.cpp
b/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.cpp
index ace924706c..a1319daca1 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.cpp
@@ -1,4 +1,7 @@
-// BlockReferenceManager.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
#include "Block.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.h
b/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.h
index b574fa4749..5bf7c1dfc7 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.h
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockReferenceManager.h
@@ -1,5 +1,7 @@
-// BlockReferenceManager.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef BLOCK_REFERENCE_MANAGER_H
#define BLOCK_REFERENCE_MANAGER_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
b/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
index 14e7e7628f..d0d92b22f5 100644
--- a/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
@@ -1,4 +1,7 @@
-// DataContainer.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
#include "Attribute.h" // for debugging only
diff --git a/src/add-ons/kernel/file_systems/ramfs/DataContainer.h
b/src/add-ons/kernel/file_systems/ramfs/DataContainer.h
index 55c2f1d736..d51e640ae2 100644
--- a/src/add-ons/kernel/file_systems/ramfs/DataContainer.h
+++ b/src/add-ons/kernel/file_systems/ramfs/DataContainer.h
@@ -1,5 +1,7 @@
-// DataContainer.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef DATA_CONTAINER_H
#define DATA_CONTAINER_H
@@ -14,7 +16,7 @@ class Volume;
// 16 bytes are for free, since they are shared with the block list.
// (actually even more, since the list has an initial size).
// I ran a test analyzing what sizes the attributes in my system have:
-// size percentage bytes used in average
+// size percentage bytes used in average
// <= 0 0.00 93.45
// <= 4 25.46 75.48
// <= 8 30.54 73.02
diff --git a/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
b/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
index 6108ee6cad..180991bb1f 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
@@ -1,4 +1,7 @@
-// Directory.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
#include "DebugSupport.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/Directory.h
b/src/add-ons/kernel/file_systems/ramfs/Directory.h
index a626cbffce..fefb677d05 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Directory.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Directory.h
@@ -1,5 +1,7 @@
-// Directory.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef DIRECTORY_H
#define DIRECTORY_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/Entry.cpp
b/src/add-ons/kernel/file_systems/ramfs/Entry.cpp
index 37c0949d1c..d4ff177f35 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Entry.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Entry.cpp
@@ -1,4 +1,7 @@
-// Entry.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
#include "DebugSupport.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/Entry.h
b/src/add-ons/kernel/file_systems/ramfs/Entry.h
index 1396d235de..6e6ffbaf53 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Entry.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Entry.h
@@ -1,5 +1,7 @@
-// Entry.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ENTRY_H
#define ENTRY_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/EntryIterator.cpp
b/src/add-ons/kernel/file_systems/ramfs/EntryIterator.cpp
index 6d1e70214f..16f903b477 100644
--- a/src/add-ons/kernel/file_systems/ramfs/EntryIterator.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/EntryIterator.cpp
@@ -1,4 +1,7 @@
-// EntryIterator.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "Directory.h"
#include "Entry.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/EntryIterator.h
b/src/add-ons/kernel/file_systems/ramfs/EntryIterator.h
index c11d446f64..4848509b17 100644
--- a/src/add-ons/kernel/file_systems/ramfs/EntryIterator.h
+++ b/src/add-ons/kernel/file_systems/ramfs/EntryIterator.h
@@ -1,5 +1,7 @@
-// EntryIterator.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ENTRY_ITERATOR_H
#define ENTRY_ITERATOR_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/EntryListener.cpp
b/src/add-ons/kernel/file_systems/ramfs/EntryListener.cpp
index b2f1a3bec9..83a16bf5d2 100644
--- a/src/add-ons/kernel/file_systems/ramfs/EntryListener.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/EntryListener.cpp
@@ -1,4 +1,7 @@
-// EntryListener.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "EntryListener.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/EntryListener.h
b/src/add-ons/kernel/file_systems/ramfs/EntryListener.h
index 5103e51ca1..87d75ce433 100644
--- a/src/add-ons/kernel/file_systems/ramfs/EntryListener.h
+++ b/src/add-ons/kernel/file_systems/ramfs/EntryListener.h
@@ -1,5 +1,7 @@
-// EntryListener.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef ENTRY_LISTENER_H
#define ENTRY_LISTENER_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/File.cpp
b/src/add-ons/kernel/file_systems/ramfs/File.cpp
index 4bbdb61029..ffb021a415 100644
--- a/src/add-ons/kernel/file_systems/ramfs/File.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/File.cpp
@@ -1,4 +1,7 @@
-// File.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
#include "File.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/File.h
b/src/add-ons/kernel/file_systems/ramfs/File.h
index a16c90be87..53b3661190 100644
--- a/src/add-ons/kernel/file_systems/ramfs/File.h
+++ b/src/add-ons/kernel/file_systems/ramfs/File.h
@@ -1,5 +1,7 @@
-// File.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef FILE_H
#define FILE_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/Index.cpp
b/src/add-ons/kernel/file_systems/ramfs/Index.cpp
index 03d05a45e2..64a3d24af7 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Index.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Index.cpp
@@ -1,4 +1,7 @@
-// Index.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "DebugSupport.h"
#include "Directory.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/Index.h
b/src/add-ons/kernel/file_systems/ramfs/Index.h
index 77db01ad2d..989df58bb9 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Index.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Index.h
@@ -1,5 +1,7 @@
-// Index.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef INDEX_H
#define INDEX_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.cpp
b/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.cpp
index ecde6423d0..5090702b42 100644
--- a/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.cpp
@@ -1,4 +1,7 @@
-// IndexDirectory.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include <TypeConstants.h>
@@ -61,7 +64,7 @@ IndexDirectory::~IndexDirectory()
status_t
IndexDirectory::InitCheck() const
{
- return (fNameIndex && fLastModifiedIndex && fSizeIndex ? B_OK
+ return (fNameIndex && fLastModifiedIndex && fSizeIndex ? B_OK
: B_NO_MEMORY);
}
diff --git a/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.h
b/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.h
index a7c1964975..767920e6b7 100644
--- a/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.h
+++ b/src/add-ons/kernel/file_systems/ramfs/IndexDirectory.h
@@ -1,5 +1,7 @@
-// IndexDirectory.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef INDEX_DIRECTORY_H
#define INDEX_DIRECTORY_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/IndexImpl.h
b/src/add-ons/kernel/file_systems/ramfs/IndexImpl.h
index 726908ba9e..3d96b2f16e 100644
--- a/src/add-ons/kernel/file_systems/ramfs/IndexImpl.h
+++ b/src/add-ons/kernel/file_systems/ramfs/IndexImpl.h
@@ -1,5 +1,7 @@
-// IndexImpl.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef INDEX_IMPL_H
#define INDEX_IMPL_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.cpp
b/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.cpp
index 490781348c..030ba96a55 100644
--- a/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.cpp
@@ -1,4 +1,7 @@
-// LastModifiedIndex.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include <TypeConstants.h>
diff --git a/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.h
b/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.h
index bb5f566587..dba6630420 100644
--- a/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.h
+++ b/src/add-ons/kernel/file_systems/ramfs/LastModifiedIndex.h
@@ -1,5 +1,7 @@
-// LastModifiedIndex.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef LAST_MODIFIED_INDEX_H
#define LAST_MODIFIED_INDEX_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/Locking.h
b/src/add-ons/kernel/file_systems/ramfs/Locking.h
index 5831719a34..9a43b42554 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Locking.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Locking.h
@@ -1,4 +1,7 @@
-// Locking.h
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef LOCKING_H
#define LOCKING_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/NameIndex.cpp
b/src/add-ons/kernel/file_systems/ramfs/NameIndex.cpp
index 2ab27e0528..16ba41424f 100644
--- a/src/add-ons/kernel/file_systems/ramfs/NameIndex.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/NameIndex.cpp
@@ -1,4 +1,7 @@
-// NameIndex.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include <TypeConstants.h>
diff --git a/src/add-ons/kernel/file_systems/ramfs/NameIndex.h
b/src/add-ons/kernel/file_systems/ramfs/NameIndex.h
index 3503b7c961..598167ab04 100644
--- a/src/add-ons/kernel/file_systems/ramfs/NameIndex.h
+++ b/src/add-ons/kernel/file_systems/ramfs/NameIndex.h
@@ -1,5 +1,7 @@
-// NameIndex.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef NAME_INDEX_H
#define NAME_INDEX_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/Node.cpp
b/src/add-ons/kernel/file_systems/ramfs/Node.cpp
index 29b772d2c8..c62d70bc1e 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Node.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Node.cpp
@@ -1,4 +1,7 @@
-// Node.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "AllocationInfo.h"
#include "DebugSupport.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/Node.h
b/src/add-ons/kernel/file_systems/ramfs/Node.h
index 5c4ada2ac7..02a81ae7bd 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Node.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Node.h
@@ -1,5 +1,7 @@
-// Node.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef NODE_H
#define NODE_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h
b/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h
index b983b8c78e..987ea32b96 100644
--- a/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h
+++ b/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h
@@ -1,5 +1,7 @@
-// NodeChildTable.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef NODE_CHILD_TABLE_H
#define NODE_CHILD_TABLE_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeListener.cpp
b/src/add-ons/kernel/file_systems/ramfs/NodeListener.cpp
index e81b70c392..0cc3fb202d 100644
--- a/src/add-ons/kernel/file_systems/ramfs/NodeListener.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/NodeListener.cpp
@@ -1,4 +1,7 @@
-// NodeListener.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "NodeListener.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeListener.h
b/src/add-ons/kernel/file_systems/ramfs/NodeListener.h
index af30afcbb8..e334d11171 100644
--- a/src/add-ons/kernel/file_systems/ramfs/NodeListener.h
+++ b/src/add-ons/kernel/file_systems/ramfs/NodeListener.h
@@ -1,4 +1,7 @@
-// NodeListener.h
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef NODE_LISTENER_H
#define NODE_LISTENER_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp
b/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp
index b81ed57761..ed729c1ada 100644
--- a/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp
@@ -1,4 +1,7 @@
-// NodeTable.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include "DebugSupport.h"
#include "NodeTable.h"
diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeTable.h
b/src/add-ons/kernel/file_systems/ramfs/NodeTable.h
index 03a9dfcead..33e11d1fa2 100644
--- a/src/add-ons/kernel/file_systems/ramfs/NodeTable.h
+++ b/src/add-ons/kernel/file_systems/ramfs/NodeTable.h
@@ -1,5 +1,7 @@
-// NodeTable.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef NODE_TABLE_H
#define NODE_TABLE_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/SizeIndex.cpp
b/src/add-ons/kernel/file_systems/ramfs/SizeIndex.cpp
index b0626ed8da..469adf024a 100644
--- a/src/add-ons/kernel/file_systems/ramfs/SizeIndex.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/SizeIndex.cpp
@@ -1,4 +1,7 @@
-// SizeIndex.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include <TypeConstants.h>
diff --git a/src/add-ons/kernel/file_systems/ramfs/SizeIndex.h
b/src/add-ons/kernel/file_systems/ramfs/SizeIndex.h
index bc0560cd1d..8cacde9bc9 100644
--- a/src/add-ons/kernel/file_systems/ramfs/SizeIndex.h
+++ b/src/add-ons/kernel/file_systems/ramfs/SizeIndex.h
@@ -1,5 +1,7 @@
-// SizeIndex.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef SIZE_INDEX_H
#define SIZE_INDEX_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/String.h
b/src/add-ons/kernel/file_systems/ramfs/String.h
index a112b5cf75..70f4ef47cf 100644
--- a/src/add-ons/kernel/file_systems/ramfs/String.h
+++ b/src/add-ons/kernel/file_systems/ramfs/String.h
@@ -1,5 +1,7 @@
-// String.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef STRING_H
#define STRING_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp
b/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp
index 2a7ac8738d..d67ba64fe0 100644
--- a/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp
@@ -1,4 +1,7 @@
-// SymLink.cpp
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#include <limits.h>
diff --git a/src/add-ons/kernel/file_systems/ramfs/SymLink.h
b/src/add-ons/kernel/file_systems/ramfs/SymLink.h
index d8565f8d23..6eea024726 100644
--- a/src/add-ons/kernel/file_systems/ramfs/SymLink.h
+++ b/src/add-ons/kernel/file_systems/ramfs/SymLink.h
@@ -1,5 +1,7 @@
-// SymLink.h
-
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef SYMLINK_H
#define SYMLINK_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/ramfs.h
b/src/add-ons/kernel/file_systems/ramfs/ramfs.h
index dc2eda9827..becc91cc97 100644
--- a/src/add-ons/kernel/file_systems/ramfs/ramfs.h
+++ b/src/add-ons/kernel/file_systems/ramfs/ramfs.h
@@ -1,4 +1,7 @@
-// ramfs.h
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef RAM_FS_H
#define RAM_FS_H
diff --git a/src/add-ons/kernel/file_systems/ramfs/ramfs_ioctl.h
b/src/add-ons/kernel/file_systems/ramfs/ramfs_ioctl.h
index 9b1cf5d512..a6d12de0e5 100644
--- a/src/add-ons/kernel/file_systems/ramfs/ramfs_ioctl.h
+++ b/src/add-ons/kernel/file_systems/ramfs/ramfs_ioctl.h
@@ -1,4 +1,7 @@
-// ramfs_ioctl.h
+/*
+ * Copyright 2007, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * All rights reserved. Distributed under the terms of the MIT license.
+ */
#ifndef RAMFS_IOCTL_H
#define RAMFS_IOCTL_H
############################################################################
Commit: c3e0275cc53d77c606fdb1539ea5b5c5c87f4924
URL: https://git.haiku-os.org/haiku/commit/?id=c3e0275cc53d
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Fri Aug 30 23:54:54 2019 UTC
ramfs: Adapt to current kernel FS APIs and fully fix the build.
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/file_systems/ramfs/Jamfile
b/src/add-ons/kernel/file_systems/ramfs/Jamfile
index 939866f791..9d14961e76 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Jamfile
+++ b/src/add-ons/kernel/file_systems/ramfs/Jamfile
@@ -18,6 +18,7 @@ KernelAddon ramfs
BlockAllocatorAreaBucket.cpp
BlockReferenceManager.cpp
DataContainer.cpp
+ DebugSupport.cpp
Directory.cpp
Entry.cpp
EntryIterator.cpp
@@ -36,3 +37,6 @@ KernelAddon ramfs
SymLink.cpp
Volume.cpp
;
+
+SEARCH on [ FGristFiles DebugSupport.cpp ]
+ += [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems shared ] ;
diff --git a/src/add-ons/kernel/file_systems/ramfs/String.h
b/src/add-ons/kernel/file_systems/ramfs/String.h
index 70f4ef47cf..f02f115b3c 100644
--- a/src/add-ons/kernel/file_systems/ramfs/String.h
+++ b/src/add-ons/kernel/file_systems/ramfs/String.h
@@ -61,22 +61,6 @@ private:
char *fString;
};
-// strnlen
-size_t
-strnlen(const char *str, size_t maxLen)
-{
- if (str) {
- size_t origMaxLen = maxLen;
- while (maxLen > 0 && *str != '\0') {
- maxLen--;
- str++;
- }
- return origMaxLen - maxLen;
- }
- return 0;
-}
-
-
/*!
\class String
\brief A very simple string class.
diff --git a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
index 492de141b8..7781fddcfc 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
@@ -133,7 +133,6 @@ class EntryListenerTree : public _EntryListenerTree {};
Volume::Volume(fs_volume* volume)
:
fVolume(volume),
- fID(0),
fNextNodeID(kRootParentID + 1),
fNodeTable(NULL),
fDirectoryEntryTable(NULL),
@@ -170,16 +169,15 @@ Volume::Mount(uint32 flags)
{
Unmount();
- // check the locker's semaphores
- if (fLocker.Sem() < 0)
- return fLocker.Sem();
- if (fIteratorLocker.Sem() < 0)
- return fIteratorLocker.Sem();
- if (fQueryLocker.Sem() < 0)
- return fQueryLocker.Sem();
+ // check the lockers
+ if (fLocker.InitCheck() < 0)
+ return fLocker.InitCheck();
+ if (fIteratorLocker.InitCheck() < 0)
+ return fIteratorLocker.InitCheck();
+ if (fQueryLocker.InitCheck() < 0)
+ return fQueryLocker.InitCheck();
status_t error = B_OK;
- fID = id;
// create a block allocator
if (error == B_OK) {
fBlockAllocator = new(nothrow) BlockAllocator(kDefaultAreaSize);
@@ -291,7 +289,6 @@ Volume::Unmount()
delete fBlockAllocator;
fBlockAllocator = NULL;
}
- fID = 0;
return B_OK;
}
@@ -349,7 +346,7 @@ Volume::NewVNode(Node *node)
{
status_t error = NodeAdded(node);
if (error == B_OK) {
- error = new_vnode(GetID(), node->GetID(), node);
+ error = new_vnode(FSVolume(), node->GetID(), node,
&gRamFSVnodeOps);
if (error != B_OK)
NodeRemoved(node);
}
@@ -362,7 +359,8 @@ Volume::PublishVNode(Node *node)
{
status_t error = NodeAdded(node);
if (error == B_OK) {
- error = publish_vnode(GetID(), node->GetID(), node);
+ error = publish_vnode(FSVolume(), node->GetID(), node,
&gRamFSVnodeOps,
+ node->GetMode(), 0);
if (error != B_OK)
NodeRemoved(node);
}
@@ -373,7 +371,7 @@ Volume::PublishVNode(Node *node)
status_t
Volume::GetVNode(ino_t id, Node **node)
{
- return (fMounted ? get_vnode(GetID(), id, (void**)node) : B_BAD_VALUE);
+ return (fMounted ? get_vnode(FSVolume(), id, (void**)node) :
B_BAD_VALUE);
}
// GetVNode
@@ -384,7 +382,7 @@ Volume::GetVNode(Node *node)
status_t error = (fMounted ? GetVNode(node->GetID(), &dummy)
: B_BAD_VALUE );
if (error == B_OK && dummy != node) {
- FATAL(("Two Nodes have the same ID: %Ld!\n", node->GetID()));
+ FATAL("Two Nodes have the same ID: %Ld!\n", node->GetID());
PutVNode(dummy);
error = B_ERROR;
}
@@ -395,14 +393,14 @@ Volume::GetVNode(Node *node)
status_t
Volume::PutVNode(ino_t id)
{
- return (fMounted ? put_vnode(GetID(), id) : B_BAD_VALUE);
+ return (fMounted ? put_vnode(FSVolume(), id) : B_BAD_VALUE);
}
// PutVNode
status_t
Volume::PutVNode(Node *node)
{
- return (fMounted ? put_vnode(GetID(), node->GetID()) : B_BAD_VALUE);
+ return (fMounted ? put_vnode(FSVolume(), node->GetID()) : B_BAD_VALUE);
}
// RemoveVNode
@@ -410,7 +408,7 @@ status_t
Volume::RemoveVNode(Node *node)
{
if (fMounted)
- return remove_vnode(GetID(), node->GetID());
+ return remove_vnode(FSVolume(), node->GetID());
status_t error = NodeRemoved(node);
if (error == B_OK)
delete node;
@@ -421,7 +419,7 @@ Volume::RemoveVNode(Node *node)
status_t
Volume::UnremoveVNode(Node *node)
{
- return (fMounted ? unremove_vnode(GetID(), node->GetID()) :
B_BAD_VALUE);
+ return (fMounted ? unremove_vnode(FSVolume(), node->GetID()) :
B_BAD_VALUE);
}
// NodeAdded
diff --git a/src/add-ons/kernel/file_systems/ramfs/Volume.h
b/src/add-ons/kernel/file_systems/ramfs/Volume.h
index 8f137b7d90..05af40653c 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Volume.h
+++ b/src/add-ons/kernel/file_systems/ramfs/Volume.h
@@ -99,7 +99,7 @@ public:
status_t Mount(uint32 flags);
status_t Unmount();
- dev_t GetID() const { return fID; }
+ dev_t GetID() const { return fVolume != NULL ? fVolume->id : -1; }
fs_volume* FSVolume() const { return fVolume; }
off_t GetBlockSize() const;
@@ -183,7 +183,6 @@ protected:
private:
typedef DoublyLinkedList<Query> QueryList;
- dev_t fID;
ino_t fNextNodeID;
NodeTable *fNodeTable;
DirectoryEntryTable *fDirectoryEntryTable;
diff --git a/src/add-ons/kernel/file_systems/ramfs/ramfs.h
b/src/add-ons/kernel/file_systems/ramfs/ramfs.h
index becc91cc97..50037cfaa3 100644
--- a/src/add-ons/kernel/file_systems/ramfs/ramfs.h
+++ b/src/add-ons/kernel/file_systems/ramfs/ramfs.h
@@ -8,6 +8,7 @@
#include <SupportDefs.h>
+extern struct fs_vnode_ops gRamFSVnodeOps;
const size_t kMaxIndexKeyLength = 256;
#endif // RAM_FS_H
############################################################################
Commit: b2c20927e8d057277fbb73f634919405e2480d6c
URL: https://git.haiku-os.org/haiku/commit/?id=b2c20927e8d0
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Sat Aug 31 00:31:40 2019 UTC
ramfs: Fix setting the ops and an incorrect node cast.
And now ramfs works!
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
b/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
index 25271d9ec9..1dd0a1a89b 100644
--- a/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
@@ -105,6 +105,7 @@ ramfs_mount(fs_volume* _volume, const char* /*device*/,
uint32 flags,
*_rootID = volume->GetRootDirectory()->GetID();
_volume->private_volume = volume;
+ _volume->ops = &gRamFSVolumeOps;
RETURN_ERROR(B_OK);
}
@@ -186,7 +187,7 @@ ramfs_lookup(fs_volume* _volume, fs_vnode* _dir, const
char* entryName,
{
// FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
- Directory* dir = dynamic_cast<Directory*>((Node*)_dir);
+ Directory* dir = dynamic_cast<Directory*>((Node*)_dir->private_node);
FUNCTION(("dir: (%llu), entry: `%s'\n", (dir ? dir->GetID() : -1),
entryName));
diff --git a/src/add-ons/kernel/file_systems/ramfs/ramfs.h
b/src/add-ons/kernel/file_systems/ramfs/ramfs.h
index 50037cfaa3..0d2c35788f 100644
--- a/src/add-ons/kernel/file_systems/ramfs/ramfs.h
+++ b/src/add-ons/kernel/file_systems/ramfs/ramfs.h
@@ -9,6 +9,7 @@
#include <SupportDefs.h>
extern struct fs_vnode_ops gRamFSVnodeOps;
+extern struct fs_volume_ops gRamFSVolumeOps;
const size_t kMaxIndexKeyLength = 256;
#endif // RAM_FS_H
############################################################################
Commit: 2914364270fcc2e3feb18bcef467a743ef400907
URL: https://git.haiku-os.org/haiku/commit/?id=2914364270fc
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Sat Aug 31 00:48:58 2019 UTC
ramfs: Fix debugging print macro invocations and use B_PRI*.
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
b/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
index 819d477ec2..d155123689 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/AllocationInfo.cpp
@@ -172,68 +172,68 @@ AllocationInfo::Dump() const
size_t areaCount = 0;
size_t areaSize = 0;
- PRINT((" node table:\n"));
- PRINT((" array size: %9lu\n", fNodeTableArraySize));
- PRINT((" vector size: %9lu\n", fNodeTableVectorSize));
- PRINT((" elements: %9lu\n", fNodeTableElementCount));
+ PRINT(" node table:\n");
+ PRINT(" array size: %9lu\n", fNodeTableArraySize);
+ PRINT(" vector size: %9lu\n", fNodeTableVectorSize);
+ PRINT(" elements: %9lu\n", fNodeTableElementCount);
areaCount += 2;
areaSize += fNodeTableArraySize * sizeof(int32) + fNodeTableVectorSize;
- PRINT((" entry table:\n"));
- PRINT((" array size: %9lu\n", fDirectoryEntryTableArraySize));
- PRINT((" vector size: %9lu\n", fDirectoryEntryTableVectorSize));
- PRINT((" elements: %9lu\n", fDirectoryEntryTableElementCount));
+ PRINT(" entry table:\n");
+ PRINT(" array size: %9lu\n", fDirectoryEntryTableArraySize);
+ PRINT(" vector size: %9lu\n", fDirectoryEntryTableVectorSize);
+ PRINT(" elements: %9lu\n", fDirectoryEntryTableElementCount);
areaCount += 2;
areaSize += fDirectoryEntryTableArraySize * sizeof(int32)
+ fDirectoryEntryTableVectorSize;
- PRINT((" attribute table:\n"));
- PRINT((" array size: %9lu\n", fNodeAttributeTableArraySize));
- PRINT((" vector size: %9lu\n", fNodeAttributeTableVectorSize));
- PRINT((" elements: %9lu\n", fNodeAttributeTableElementCount));
+ PRINT(" attribute table:\n");
+ PRINT(" array size: %9lu\n", fNodeAttributeTableArraySize);
+ PRINT(" vector size: %9lu\n", fNodeAttributeTableVectorSize);
+ PRINT(" elements: %9lu\n", fNodeAttributeTableElementCount);
areaCount += 2;
areaSize += fNodeAttributeTableArraySize * sizeof(int32)
+ fNodeAttributeTableVectorSize;
- PRINT((" attributes: %9lu, size: %9lu\n", fAttributeCount,
fAttributeSize));
+ PRINT(" attributes: %9lu, size: %9lu\n", fAttributeCount,
fAttributeSize);
heapCount += fAttributeCount;
heapSize += fAttributeCount * sizeof(Attribute);
- PRINT((" directories: %9lu\n", fDirectoryCount));
+ PRINT(" directories: %9lu\n", fDirectoryCount);
heapCount += fDirectoryCount;
heapSize += fDirectoryCount * sizeof(Directory);
- PRINT((" entries: %9lu\n", fEntryCount));
+ PRINT(" entries: %9lu\n", fEntryCount);
heapCount += fEntryCount;
heapSize += fEntryCount * sizeof(Entry);
- PRINT((" files: %9lu, size: %9lu\n", fFileCount, fFileSize));
+ PRINT(" files: %9lu, size: %9lu\n", fFileCount, fFileSize);
heapCount += fFileCount;
heapSize += fFileCount * sizeof(File);
- PRINT((" symlinks: %9lu, size: %9lu\n", fSymLinkCount,
fSymLinkSize));
+ PRINT(" symlinks: %9lu, size: %9lu\n", fSymLinkCount, fSymLinkSize);
heapCount += fSymLinkCount;
heapSize += fSymLinkCount * sizeof(SymLink);
- PRINT((" areas: %9lu, size: %9lu\n", fAreaCount, fAreaSize));
+ PRINT(" areas: %9lu, size: %9lu\n", fAreaCount, fAreaSize);
areaCount += fAreaCount;
areaSize += fAreaSize;
- PRINT((" blocks: %9lu, size: %9lu\n", fBlockCount, fBlockSize));
+ PRINT(" blocks: %9lu, size: %9lu\n", fBlockCount, fBlockSize);
- PRINT((" lists: %9lu, size: %9lu\n", fListCount, fListSize));
+ PRINT(" lists: %9lu, size: %9lu\n", fListCount, fListSize);
heapCount += fListCount;
heapSize += fListSize;
- PRINT((" other: %9lu, size: %9lu\n", fOtherCount, fOtherSize));
+ PRINT(" other: %9lu, size: %9lu\n", fOtherCount, fOtherSize);
heapCount += fOtherCount;
heapSize += fOtherSize;
- PRINT((" strings: %9lu, size: %9lu\n", fStringCount, fStringSize));
+ PRINT(" strings: %9lu, size: %9lu\n", fStringCount, fStringSize);
heapCount += fStringCount;
heapSize += fStringSize;
- PRINT(("heap: %9lu allocations, size: %9lu\n", heapCount, heapSize));
- PRINT(("areas: %9lu allocations, size: %9lu\n", areaCount, areaSize));
+ PRINT("heap: %9lu allocations, size: %9lu\n", heapCount, heapSize);
+ PRINT("areas: %9lu allocations, size: %9lu\n", areaCount, areaSize);
}
diff --git a/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
b/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
index 8b4f19675b..c85642f135 100644
--- a/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/AttributeIndexImpl.cpp
@@ -274,7 +274,7 @@ AttributeIndexImpl::Changed(Attribute *attribute, const
uint8 *oldKey,
status_t
AttributeIndexImpl::Added(Attribute *attribute)
{
-PRINT(("AttributeIndex::Add(%p)\n", attribute));
+PRINT("AttributeIndex::Add(%p)\n", attribute);
status_t error = (attribute ? B_OK : B_BAD_VALUE);
if (error == B_OK) {
size_t size = attribute->GetSize();
@@ -293,7 +293,7 @@ PRINT(("AttributeIndex::Add(%p)\n", attribute));
bool
AttributeIndexImpl::Removed(Attribute *attribute)
{
-PRINT(("AttributeIndex::Removed(%p)\n", attribute));
+PRINT("AttributeIndex::Removed(%p)\n", attribute);
bool result = (attribute && attribute->GetIndex() == this);
if (result) {
if (attribute->IsInIndex())
@@ -381,13 +381,13 @@ AttributeIndexImpl::Iterator::GetCurrent(uint8 *buffer,
size_t *keyLength)
(*attribute)->GetKey(buffer, keyLength);
} else {
FATAL("Node of current attribute and node of
current entry "
- "differ: %Ld vs. %Ld\n",
+ "differ: %" B_PRIdINO " vs. %"
B_PRIdINO "\n",
(*attribute)->GetNode()->GetID(),
entry->GetNode()->GetID());
entry = NULL;
}
} else {
- FATAL("We have a current entry (`%s', node: %Ld), but
no current "
+ FATAL("We have a current entry (`%s', node: %"
B_PRIdINO "), but no current "
"attribute.\n", entry->GetName(),
entry->GetNode()->GetID());
entry = NULL;
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
index 84294740a8..6e4c001b89 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocator.cpp
@@ -178,7 +178,7 @@ BlockAllocator::SanityCheck(bool deep) const
}
// area count
if (areaCount != fAreaCount) {
- FATAL("fAreaCount is %ld, but should be %ld\n", fAreaCount,
+ FATAL("fAreaCount is %" B_PRId32 ", but should be %" B_PRId32
"\n", fAreaCount,
areaCount);
BA_PANIC("BlockAllocator: Bad free bytes.");
return false;
@@ -279,8 +279,8 @@ BlockAllocator::_AllocateBlock(size_t usableSize, bool
dontCreateArea)
fFreeBytes += area->GetFreeBytes();
bucket = fBuckets + area->GetBucketIndex();
bucket->AddArea(area);
-PRINT(("New area allocated. area count now: %ld, free bytes: %lu\n",
-fAreaCount, fFreeBytes));
+PRINT("New area allocated. area count now: %" B_PRId32 ", free bytes: %lu\n",
+fAreaCount, fFreeBytes);
}
}
// allocate a block
@@ -295,8 +295,8 @@ fAreaCount, fFreeBytes));
}
#if ENABLE_BA_PANIC
else if (!fPanic) {
-FATAL(("Block allocation failed unexpectedly.\n"));
-PRINT((" usableSize: %lu, areaFreeBytes: %lu\n", usableSize, areaFreeBytes));
+FATAL("Block allocation failed unexpectedly.\n");
+PRINT(" usableSize: %lu, areaFreeBytes: %lu\n", usableSize, areaFreeBytes);
BA_PANIC("Block allocation failed unexpectedly.");
//block = area->AllocateBlock(usableSize);
}
@@ -395,8 +395,8 @@ BlockAllocator::_Defragment()
area->FreeBlock(block, true);
#if ENABLE_BA_PANIC
if (fPanic) {
- PRINT(("Panicked while trying
to free block %p\n",
- block));
+ PRINT("Panicked while trying to
free block %p\n",
+ block);
success = false;
break;
}
@@ -410,9 +410,9 @@ BlockAllocator::_Defragment()
if (success && area->IsEmpty()) {
area->Delete();
fAreaCount--;
-PRINT(("defragmenting: area deleted\n"));
+PRINT("defragmenting: area deleted\n");
} else {
-PRINT(("defragmenting: failed to empty area\n"));
+PRINT("defragmenting: failed to empty area\n");
// failed: re-add the area
fFreeBytes += area->GetFreeBytes();
AreaBucket *newBucket = fBuckets +
area->GetBucketIndex();
diff --git a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
index aa0bbbfca9..7382998e0a 100644
--- a/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorArea.cpp
@@ -43,8 +43,8 @@ BlockAllocator::Area::Create(size_t size)
if (id >= 0) {
area = new(base) Area(id, size);
} else {
- ERROR(("BlockAllocator::Area::Create(%lu): Failed to create
area: %s\n",
- size, strerror(id)));
+ ERROR("BlockAllocator::Area::Create(%lu): Failed to create
area: %s\n",
+ size, strerror(id));
}
return area;
}
@@ -250,7 +250,7 @@ BlockAllocator::Area::SanityCheck() const
{
// area ID
if (fID < 0) {
- FATAL("Area ID < 0: %lx\n", fID);
+ FATAL("Area ID < 0: %" B_PRIx32 "\n", fID);
BA_PANIC("Bad area ID.");
return false;
}
@@ -271,7 +271,7 @@ BlockAllocator::Area::SanityCheck() const
}
// block count
if (fFreeBlockCount + fUsedBlockCount == 0) {
- FATAL(("Area contains no blocks at all.\n"));
+ FATAL("Area contains no blocks at all.\n");
BA_PANIC("Bad area block count.");
return false;
}
@@ -295,8 +295,8 @@ BlockAllocator::Area::SanityCheck() const
for (int32 i = 0; i < blockCount; i++) {
blockListOK = false;
if (!block) {
- FATAL("Encountered NULL in block list at index
%ld, although "
- "list should have %ld blocks\n", i,
blockCount);
+ FATAL("Encountered NULL in block list at index
%" B_PRId32 ", although "
+ "list should have %" B_PRId32 "
blocks\n", i, blockCount);
BA_PANIC("Bad area block list.");
return false;
}
@@ -321,14 +321,14 @@ BlockAllocator::Area::SanityCheck() const
// alignment
if (block_align_floor(address) != address
|| block_align_floor(blockSize) != blockSize) {
- FATAL("Block %ld not properly aligned: %p,
size: %lu\n",
+ FATAL("Block %" B_PRId32 " not properly
aligned: %p, size: %lu\n",
i, block, blockSize);
BA_PANIC("Bad area block.");
return false;
}
// previous block
if (block->GetPreviousBlock() != prevBlock) {
- FATAL("Previous block of block %ld was not the
previous "
+ FATAL("Previous block of block %" B_PRId32 "
was not the previous "
"block in list: %p vs %p\n", i,
block->GetPreviousBlock(),
prevBlock);
BA_PANIC("Bad area block list.");
@@ -344,14 +344,14 @@ BlockAllocator::Area::SanityCheck() const
freeBytes += freeBlock->GetUsableSize();
// block == next free block of previous free
block
if (freeBlock != nextFree) {
- FATAL("Free block %ld is not the next
block in free "
+ FATAL("Free block %" B_PRId32 " is not
the next block in free "
"list: %p vs %p\n", i,
freeBlock, nextFree);
BA_PANIC("Bad area free list.");
return false;
}
// previous free block
if (freeBlock->GetPreviousFreeBlock() !=
prevFree) {
- FATAL("Previous free block of block %ld
was not the "
+ FATAL("Previous free block of block %"
B_PRId32 " was not the "
" previous block in free
list: %p vs %p\n", i,
freeBlock->GetPreviousFreeBlock(), prevFree);
BA_PANIC("Bad area free list.");
@@ -384,13 +384,13 @@ BlockAllocator::Area::SanityCheck() const
}
// block counts (a bit reduntant)
if (freeBlockCount != fFreeBlockCount) {
- FATAL("Free block count is %ld, but should be
%ld\n",
+ FATAL("Free block count is %" B_PRIuSIZE ", but
should be %" B_PRIu32 "\n",
fFreeBlockCount, freeBlockCount);
BA_PANIC("Bad area free block count.");
return false;
}
if (usedBlockCount != fUsedBlockCount) {
- FATAL("Used block count is %ld, but should be
%ld\n",
+ FATAL("Used block count is %" B_PRIuSIZE ", but
should be %" B_PRIu32 "\n",
fUsedBlockCount, usedBlockCount);
BA_PANIC("Bad area used block count.");
return false;
diff --git a/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
b/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
index d0d92b22f5..ad025941c9 100644
--- a/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/DataContainer.cpp
@@ -74,15 +74,15 @@ D(
if (!blockData) {
Node *node = NULL;
if (Attribute *attribute = dynamic_cast<Attribute*>(this)) {
- FATAL(("attribute `%s' of\n", attribute->GetName()));
+ FATAL("attribute `%s' of\n", attribute->GetName());
node = attribute->GetNode();
} else {
node = dynamic_cast<Node*>(this);
}
if (node)
// FATAL(("node `%s'\n", node->GetName()));
- FATAL(("container size: %Ld, offset: %Ld, buffer size: %lu\n",
- fSize, offset, size));
+ FATAL("container size: %Ld, offset: %Ld, buffer size: %lu\n",
+ fSize, offset, size);
return B_ERROR;
}
);
@@ -308,7 +308,7 @@ D(if (!fVolume->CheckBlock(block, offset + size)) return
NULL;);
} else {
D(
if (offset + size > kSmallDataContainerSize) {
- FATAL(("DataContainer: Data access exceeds small buffer.\n"));
+ FATAL("DataContainer: Data access exceeds small buffer.\n");
PANIC("DataContainer: Data access exceeds small buffer.");
return NULL;
}
@@ -349,7 +349,7 @@ DataContainer::_ResizeLastBlock(size_t newSize)
? B_OK : B_BAD_VALUE);
D(
if (!_IsBlockMode()) {
- FATAL(("Call of _ResizeLastBlock() in small buffer mode.\n"));
+ FATAL("Call of _ResizeLastBlock() in small buffer mode.\n");
PANIC("Call of _ResizeLastBlock() in small buffer mode.");
return B_ERROR;
}
diff --git a/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
b/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
index 180991bb1f..3609b5b8ee 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Directory.cpp
@@ -25,7 +25,7 @@ Directory::~Directory()
// delete all entries
while (Entry *entry = fEntries.First()) {
if (DeleteEntry(entry) != B_OK) {
- FATAL(("Could not delete all entries in directory.\n"));
+ FATAL("Could not delete all entries in directory.\n");
break;
}
}
@@ -234,7 +234,7 @@ Directory::DeleteEntry(Entry *entry)
if (error == B_OK)
delete entry;
else {
- FATAL("Failed to Unlink() entry %p from node %Ld!\n",
entry,
+ FATAL("Failed to Unlink() entry %p from node %"
B_PRIdINO "!\n", entry,
entry->GetNode()->GetID());
AddEntry(entry);
}
diff --git a/src/add-ons/kernel/file_systems/ramfs/Index.cpp
b/src/add-ons/kernel/file_systems/ramfs/Index.cpp
index 64a3d24af7..2797d1702f 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Index.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Index.cpp
@@ -75,11 +75,11 @@ void
Index::Dump()
{
D(
- PRINT(("Index: `%s', type: %lx\n", GetName(), GetType()));
+ PRINT("Index: `%s', type: %lx\n", GetName(), GetType());
for (IndexEntryIterator it(this); it.GetCurrent();
it.GetNext()) {
Entry *entry = it.GetCurrent();
- PRINT((" entry: `%s', dir: %Ld\n", entry->GetName(),
-
entry->GetParent()->GetID()));
+ PRINT(" entry: `%s', dir: %Ld\n", entry->GetName(),
+
entry->GetParent()->GetID());
}
)
}
diff --git a/src/add-ons/kernel/file_systems/ramfs/Node.cpp
b/src/add-ons/kernel/file_systems/ramfs/Node.cpp
index c62d70bc1e..f2187b8e12 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Node.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Node.cpp
@@ -70,7 +70,7 @@ Node::~Node()
while (Attribute *attribute = fAttributes.First()) {
status_t error = DeleteAttribute(attribute);
if (error != B_OK) {
- FATAL(("Node::~Node(): Failed to delete attribute!\n"));
+ FATAL("Node::~Node(): Failed to delete attribute!\n");
break;
}
}
@@ -114,7 +114,7 @@ Node::RemoveReference()
status_t
Node::Link(Entry *entry)
{
-PRINT(("Node[%Ld]::Link(): %ld ->...\n", fID, fRefCount));
+PRINT("Node[%Ld]::Link(): %" B_PRId32 " ->...\n", fID, fRefCount);
fReferrers.Insert(entry);
status_t error = AddReference();
@@ -128,7 +128,7 @@ PRINT(("Node[%Ld]::Link(): %ld ->...\n", fID, fRefCount));
status_t
Node::Unlink(Entry *entry)
{
-PRINT(("Node[%Ld]::Unlink(): %ld ->...\n", fID, fRefCount));
+PRINT("Node[%Ld]::Unlink(): %" B_PRId32 " ->...\n", fID, fRefCount);
RemoveReference();
fReferrers.Remove(entry);
diff --git a/src/add-ons/kernel/file_systems/ramfs/Query.cpp
b/src/add-ons/kernel/file_systems/ramfs/Query.cpp
index 29a31a5e77..c6a1cd0c1e 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Query.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Query.cpp
@@ -236,7 +236,7 @@ enum ops {
enum match {
NO_MATCH = 0,
MATCH_OK = 1,
-
+
MATCH_BAD_PATTERN = -2,
MATCH_INVALID_CHARACTER
};
@@ -391,7 +391,7 @@ class Operator : public Term {
//---------------------------------
-void
+void
skipWhitespace(char **expr, int32 skip = 0)
{
char *string = (*expr) + skip;
@@ -400,7 +400,7 @@ skipWhitespace(char **expr, int32 skip = 0)
}
-void
+void
skipWhitespaceReverse(char **expr,char *stop)
{
char *string = *expr;
@@ -638,7 +638,7 @@ matchString(char *pattern, char *string)
if (string[0])
return NO_MATCH;
-
+
return MATCH_OK;
}
@@ -689,7 +689,7 @@ Equation::Equation(char **expr)
// attribute string is empty (which is not allowed)
if (start > end)
return;
-
+
// at this point, "start" points to the beginning of the string, "end"
points
// to the last character of the string, and "string" points to the first
// character of the equation symbol
@@ -710,7 +710,7 @@ Equation::Equation(char **expr)
return;
fOp = OP_UNEQUAL;
break;
-
+
// any invalid characters will be rejected
default:
*expr = string;
@@ -733,7 +733,7 @@ Equation::Equation(char **expr)
// string is quoted (start has to be on the beginning of a
string)
if (ParseQuotedString(&start, &end) < B_OK)
return;
-
+
string = end + 2;
skipWhitespace(&string);
} else {
@@ -743,7 +743,7 @@ Equation::Equation(char **expr)
end = string - 1;
skipWhitespaceReverse(&end, start);
}
-
+
// at this point, "start" will point to the first character of the
value,
// "end" will point to its last character, and "start" to the first non-
// whitespace character after the value string
@@ -776,7 +776,7 @@ Equation::~Equation()
}
-status_t
+status_t
Equation::InitCheck()
{
if (fAttribute == NULL
@@ -788,13 +788,13 @@ Equation::InitCheck()
}
-status_t
+status_t
Equation::ParseQuotedString(char **_start, char **_end)
{
char *start = *_start;
char quote = *start++;
char *end = start;
-
+
for (;*end && *end != quote;end++) {
if (*end == '\\')
end++;
@@ -831,7 +831,7 @@ Equation::CopyString(char *start, char *end)
}
-status_t
+status_t
Equation::ConvertValue(type_code type)
{
// Has the type already been converted?
@@ -874,7 +874,7 @@ Equation::ConvertValue(type_code type)
fSize = sizeof(double);
break;
default:
- FATAL("query value conversion to 0x%lx requested!\n",
type);
+ FATAL("query value conversion to 0x%" B_PRIx32 "
requested!\n", type);
// should we fail here or just do a safety int32
conversion?
return B_ERROR;
}
@@ -926,11 +926,11 @@ Equation::CompareTo(const uint8 *value, uint16 size)
}
-void
+void
Equation::Complement()
{
D(if (fOp <= OP_EQUATION || fOp > OP_LESS_THAN_OR_EQUAL) {
- FATAL(("op out of range!"));
+ FATAL("op out of range!");
return;
});
@@ -1025,7 +1025,7 @@ Equation::Match(Entry *entry, Node* node, const char
*attributeName, int32 type,
}
-void
+void
Equation::CalculateScore(IndexWrapper &index)
{
// As always, these values could be tuned and refined.
@@ -1063,7 +1063,7 @@ status_t
Equation::PrepareQuery(Volume */*volume*/, IndexWrapper &index, IndexIterator
**iterator, bool queryNonIndexed)
{
status_t status = index.SetTo(fAttribute);
-
+
// if we should query attributes without an index, we can just proceed
here
if (status < B_OK && !queryNonIndexed)
return B_ENTRY_NOT_FOUND;
@@ -1144,7 +1144,7 @@ Equation::PrepareQuery(Volume */*volume*/, IndexWrapper
&index, IndexIterator **
}
-status_t
+status_t
Equation::GetNextMatching(Volume *volume, IndexIterator *iterator,
struct dirent *dirent, size_t bufferSize)
{
@@ -1292,20 +1292,20 @@ Operator::Match(Entry *entry, Node* node, const char
*attribute,
}
-void
+void
Operator::Complement()
{
if (fOp == OP_AND)
fOp = OP_OR;
else
fOp = OP_AND;
-
+
fLeft->Complement();
fRight->Complement();
}
-void
+void
Operator::CalculateScore(IndexWrapper &index)
{
fLeft->CalculateScore(index);
@@ -1313,26 +1313,26 @@ Operator::CalculateScore(IndexWrapper &index)
}
-int32
+int32
Operator::Score() const
{
if (fOp == OP_AND) {
// return the one with the better score
if (fRight->Score() > fLeft->Score())
return fRight->Score();
-
+
return fLeft->Score();
}
-
+
// for OP_OR, be honest, and return the one with the worse score
if (fRight->Score() < fLeft->Score())
return fRight->Score();
-
+
return fLeft->Score();
}
-status_t
+status_t
Operator::InitCheck()
{
if ((fOp != OP_AND && fOp != OP_OR)
@@ -1363,7 +1363,7 @@ Operator::Copy() const
Term *term = new Term(equation);
if (term == NULL)
delete equation;
-
+
return term;
}
@@ -1438,10 +1438,10 @@ Expression::Expression(char *expr)
{
if (expr == NULL)
return;
-
+
fTerm = ParseOr(&expr);
if (fTerm != NULL && fTerm->InitCheck() < B_OK) {
- FATAL(("Corrupt tree in expression!\n"));
+ FATAL("Corrupt tree in expression!\n");
delete fTerm;
fTerm = NULL;
}
@@ -1449,7 +1449,7 @@ Expression::Expression(char *expr)
fTerm->PrintToStream();
D(__out("\n"));
if (*expr != '\0')
- PRINT(("Unexpected end of string: \"%s\"!\n", expr));
+ PRINT("Unexpected end of string: \"%s\"!\n", expr);
});
fPosition = expr;
}
@@ -1471,7 +1471,7 @@ Expression::ParseEquation(char **expr)
skipWhitespace(expr, 1);
if (**expr != '(')
return NULL;
-
+
nott = true;
}
@@ -1480,16 +1480,16 @@ Expression::ParseEquation(char **expr)
return NULL;
} else if (**expr == '(') {
skipWhitespace(expr, 1);
-
+
Term *term = ParseOr(expr);
-
+
skipWhitespace(expr);
-
+
if (**expr != ')') {
delete term;
return NULL;
}
-
+
// If the term is negated, we just complement the tree, to get
// rid of the not, a.k.a. DeMorgan's Law.
if (nott)
@@ -1557,11 +1557,11 @@ Expression::ParseOr(char **expr)
}
-bool
+bool
Expression::IsOperator(char **expr, char op)
{
char *string = *expr;
-
+
if (*string == op && *(string + 1) == op) {
*expr += 2;
return true;
@@ -1570,7 +1570,7 @@ Expression::IsOperator(char **expr, char op)
}
-status_t
+status_t
Expression::InitCheck()
{
if (fTerm == NULL)
@@ -1652,14 +1652,14 @@ Query::Rewind()
stack.Push(op->Left());
}
} else if (term->Op() == OP_EQUATION || fStack.Push((Equation
*)term) < B_OK)
- FATAL(("Unknown term on stack or stack error"));
+ FATAL("Unknown term on stack or stack error");
}
return B_OK;
}
-status_t
+status_t
Query::GetNextEntry(struct dirent *dirent, size_t size)
{
// If we don't have an equation to use yet/anymore, get a new one
@@ -1688,7 +1688,7 @@ Query::GetNextEntry(struct dirent *dirent, size_t size)
}
-void
+void
Query::SetLiveMode(port_id port, int32 token)
{
fPort = port;
@@ -1719,13 +1719,13 @@ send_entry_notification(port_id port, int32 token,
Volume* volume, Entry* entry,
}
-void
+void
Query::LiveUpdate(Entry *entry, Node* node, const char *attribute, int32 type,
const uint8 *oldKey, size_t oldLength, const uint8 *newKey,
size_t newLength)
{
-PRINT(("%p->Query::LiveUpdate(%p, %p, \"%s\", 0x%lx, %p, %lu, %p, %lu)\n",
-this, entry, node, attribute, type, oldKey, oldLength, newKey, newLength));
+PRINT("%p->Query::LiveUpdate(%p, %p, \"%s\", 0x%lx, %p, %lu, %p, %lu)\n",
+this, entry, node, attribute, type, oldKey, oldLength, newKey, newLength);
if (fPort < 0 || fExpression == NULL || node == NULL || attribute ==
NULL)
return;
@@ -1748,18 +1748,18 @@ this, entry, node, attribute, type, oldKey, oldLength,
newKey, newLength));
type, oldKey, oldLength);
status_t newStatus = fExpression->Root()->Match(entry, node, attribute,
type, newKey, newLength);
-PRINT((" oldStatus: 0x%lx, newStatus: 0x%lx\n", oldStatus, newStatus));
+PRINT(" oldStatus: 0x%lx, newStatus: 0x%lx\n", oldStatus, newStatus);
bool created;
if (oldStatus == MATCH_OK && newStatus == MATCH_OK) {
- // only send out a notification if the name was changed
+ // only send out a notification if the name was changed
if (oldKey == NULL || strcmp(attribute,"name"))
return;
if (entry) {
// entry should actually always be given, when the
changed
// attribute is the entry name
-PRINT(("notification: old: removed\n"));
+PRINT("notification: old: removed\n");
notify_query_entry_removed(fPort, fToken,
fVolume->GetID(),
entry->GetParent()->GetID(), (const char
*)oldKey,
entry->GetNode()->GetID());
@@ -1776,7 +1776,7 @@ PRINT(("notification: old: removed\n"));
// We send a notification for the given entry, if any, or otherwise for
// all entries referring to the node;
if (entry) {
-PRINT(("notification: new: %s\n", (created ? "created" : "removed")));
+PRINT("notification: new: %s\n", (created ? "created" : "removed"));
send_entry_notification(fPort, fToken, fVolume, entry, created);
} else {
entry = node->GetFirstReferrer();
diff --git a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
index 7781fddcfc..6e8c08d3a8 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp
@@ -382,7 +382,7 @@ Volume::GetVNode(Node *node)
status_t error = (fMounted ? GetVNode(node->GetID(), &dummy)
: B_BAD_VALUE );
if (error == B_OK && dummy != node) {
- FATAL("Two Nodes have the same ID: %Ld!\n", node->GetID());
+ FATAL("Two Nodes have the same ID: %" B_PRIdINO "!\n",
node->GetID());
PutVNode(dummy);
error = B_ERROR;
}
diff --git a/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
b/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
index 1dd0a1a89b..89fea48c0e 100644
--- a/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
@@ -311,7 +311,7 @@ ramfs_ioctl(fs_volume* _volume, fs_vnode* /*node*/, void*
/*cookie*/,
if (buffer) {
if (VolumeReadLocker locker = volume) {
const char *name = (const char*)buffer;
-PRINT((" RAMFS_IOCTL_DUMP_INDEX, `%s'\n", name));
+PRINT(" RAMFS_IOCTL_DUMP_INDEX, `%s'\n", name);
IndexDirectory *indexDir =
volume->GetIndexDirectory();
if (indexDir) {
if (Index *index =
indexDir->FindIndex(name))
@@ -377,7 +377,7 @@ ramfs_read_symlink(fs_volume* _volume, fs_vnode* _node,
char *buffer,
memcpy(buffer,
symLink->GetLinkedPath(), toRead);
*bufferSize = toRead;
} else {
- FATAL("Node %Ld pretends to be a SymLink, but
isn't!\n",
+ FATAL("Node %" B_PRIdINO " pretends to be a
SymLink, but isn't!\n",
node->GetID());
error = B_BAD_VALUE;
}
@@ -958,7 +958,7 @@ ramfs_read(fs_volume* _volume, fs_vnode* _node, void*
_cookie, off_t pos,
if (File *file = dynamic_cast<File*>(node))
error = file->ReadAt(pos, buffer, *bufferSize,
bufferSize);
else {
- FATAL("Node %Ld pretends to be a File, but
isn't!\n",
+ FATAL("Node %" B_PRIdINO " pretends to be a
File, but isn't!\n",
node->GetID());
error = B_BAD_VALUE;
}
@@ -1000,7 +1000,7 @@ ramfs_write(fs_volume* _volume, fs_vnode* _node, void*
_cookie, off_t pos,
error = file->WriteAt(pos, buffer,
*bufferSize,
bufferSize);
} else {
- FATAL("Node %Ld pretends to be a File,
but isn't!\n",
+ FATAL("Node %" B_PRIdINO " pretends to
be a File, but isn't!\n",
node->GetID());
error = B_BAD_VALUE;
}
@@ -1064,10 +1064,10 @@ fGetNextCounter++;
*entryName = entry->GetName();
}
}
- PRINT(("EntryIterator %ld, GetNext() counter: %ld, entry: %p
(%Ld)\n",
+ PRINT("EntryIterator %" B_PRId32 ", GetNext() counter: %"
B_PRId32 ", entry: %p (%Ld)\n",
fIteratorID, fGetNextCounter, fIterator.GetCurrent(),
(fIterator.GetCurrent()
- ? fIterator.GetCurrent()->GetNode()->GetID() :
-1)));
+ ? fIterator.GetCurrent()->GetNode()->GetID() :
-1));
return error;
}
@@ -1218,7 +1218,7 @@ ramfs_open_dir(fs_volume* /*fs*/, fs_vnode* _node, void**
_cookie)
if (error == B_OK) {
dir = dynamic_cast<Directory*>(node);
if (!dir) {
- FATAL("Node %Ld pretends to be a Directory, but
isn't!\n",
+ FATAL("Node %" B_PRIdINO " pretends to be a Directory,
but isn't!\n",
node->GetID());
error = B_NOT_A_DIRECTORY;
}
@@ -1284,7 +1284,7 @@ ramfs_read_dir(fs_volume* _volume, fs_vnode* DARG(_node),
void* _cookie,
ino_t nodeID = -1;
const char *name = NULL;
if (cookie->GetNext(&nodeID, &name) == B_OK) {
- PRINT((" entry: `%s'\n", name));
+ PRINT(" entry: `%s'\n", name);
size_t nameLen = strlen(name);
// check, whether the entry fits into the
buffer,
// and fill it in
@@ -2018,8 +2018,8 @@ ramfs_open_query(fs_volume* _volume, const char
*queryString, uint32 flags,
port_id port, uint32 token, void** _cookie)
{
FUNCTION_START();
- PRINT(("query = \"%s\", flags = %lu, port_id = %ld, token = %ld\n",
- queryString, flags, port, token));
+ PRINT("query = \"%s\", flags = %lu, port_id = %" B_PRId32 ", token = %"
B_PRId32 "\n",
+ queryString, flags, port, token);
Volume* volume = (Volume*)_volume->private_volume;
@@ -2035,8 +2035,8 @@ ramfs_open_query(fs_volume* _volume, const char
*queryString, uint32 flags,
ObjectDeleter<Expression> expressionDeleter(expression);
if (expression->InitCheck() < B_OK) {
- WARN(("Could not parse query, stopped at: \"%s\"\n",
- expression->Position()));
+ WARN("Could not parse query, stopped at: \"%s\"\n",
+ expression->Position());
RETURN_ERROR(B_BAD_VALUE);
}
@@ -2127,12 +2127,12 @@ ramfs_std_ops(int32 op, ...)
case B_MODULE_INIT:
{
init_debugging();
- PRINT(("ramfs_std_ops(): B_MODULE_INIT\n"));
+ PRINT("ramfs_std_ops(): B_MODULE_INIT\n");
return B_OK;
}
case B_MODULE_UNINIT:
- PRINT(("ramfs_std_ops(): B_MODULE_UNINIT\n"));
+ PRINT("ramfs_std_ops(): B_MODULE_UNINIT\n");
exit_debugging();
return B_OK;
############################################################################
Revision: hrev53437
Commit: 349ab0050a7038378f9d17b4e6d9083284d9efc6
URL: https://git.haiku-os.org/haiku/commit/?id=349ab0050a70
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Sat Aug 31 00:53:29 2019 UTC
ramfs: Fix miscellaneous warnings.
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/file_systems/ramfs/Query.cpp
b/src/add-ons/kernel/file_systems/ramfs/Query.cpp
index c6a1cd0c1e..9398f3bfa2 100644
--- a/src/add-ons/kernel/file_systems/ramfs/Query.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/Query.cpp
@@ -286,7 +286,7 @@ class Term {
virtual bool NeedsEntry() = 0;
-#ifdef DEBUG
+#if DEBUG
virtual void PrintToStream() = 0;
#endif
@@ -329,7 +329,7 @@ class Equation : public Term {
virtual bool NeedsEntry();
-#ifdef DEBUG
+#if DEBUG
virtual void PrintToStream();
#endif
@@ -375,7 +375,7 @@ class Operator : public Term {
virtual bool NeedsEntry();
//Term *Copy() const;
-#ifdef DEBUG
+#if DEBUG
virtual void PrintToStream();
#endif
@@ -1389,7 +1389,7 @@ Operator::Copy() const
// #pragma mark -
-#ifdef DEBUG
+#if DEBUG
void
Operator::PrintToStream()
{
diff --git a/src/add-ons/kernel/file_systems/ramfs/String.h
b/src/add-ons/kernel/file_systems/ramfs/String.h
index f02f115b3c..48921567cb 100644
--- a/src/add-ons/kernel/file_systems/ramfs/String.h
+++ b/src/add-ons/kernel/file_systems/ramfs/String.h
@@ -127,9 +127,7 @@ String::Truncate(int32 newLength)
newLength = 0;
if (newLength < fLength) {
char *string = fString;
- int32 len = fLength;
fString = NULL;
- len = 0;
if (!_SetTo(string, newLength)) {
fString = string;
fLength = newLength;
diff --git a/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
b/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
index 89fea48c0e..6f8d803689 100644
--- a/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
+++ b/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp
@@ -147,7 +147,7 @@ ramfs_read_fs_info(fs_volume* _volume, struct fs_info *info)
strcpy(info->fsh_name, "ramfs");
} else
SET_ERROR(error, B_ERROR);
- return B_OK;
+ return error;
}
@@ -916,7 +916,7 @@ ramfs_close(fs_volume* _volume, fs_vnode* _node, void*
/*cookie*/)
notify_if_stat_changed(volume, node);
} else
SET_ERROR(error, B_ERROR);
- return B_OK;
+ return error;
}
@@ -1632,8 +1632,7 @@ ramfs_close_attr(fs_volume* _volume, fs_vnode* _node,
void* _cookie)
notify_if_stat_changed(volume, node);
} else
SET_ERROR(error, B_ERROR);
- return B_OK;
-
+ return error;
}