file_systems/reiserfs: Fix -WFormat=

Change-Id: Id8b4c3137cfcabaef09d8adf55a3ab6667b5c55c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3335
Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
Murai Takashi
2020-10-22 05:57:50 +00:00
committed by Jérôme Duval
parent 6b48b59daf
commit f91802873f
5 changed files with 121 additions and 105 deletions
@@ -51,7 +51,8 @@ using std::nothrow;
// constructor
BlockCache::BlockCache()
: fDevice(-1),
:
fDevice(-1),
fBlockSize(0),
fBlockCount(0),
fLock(),
@@ -73,9 +74,9 @@ BlockCache::~BlockCache()
}
delete block;
}
PRINT(("statistics: %Ld block reads\n", fReads));
PRINT(("statistics: %Ld block gets\n", fBlockGets));
PRINT(("statistics: %Ld block releases\n", fBlockReleases));
PRINT(("statistics: %" B_PRId64 " block reads\n", fReads));
PRINT(("statistics: %" B_PRId64 " block gets\n", fBlockGets));
PRINT(("statistics: %" B_PRId64 " block releases\n", fBlockReleases));
if (fCacheHandle)
block_cache_delete(fCacheHandle, false);
fLock.Unlock();
@@ -57,9 +57,9 @@ public:
void Dump()
{
PRINT((" dir entry\n"));
PRINT((" offset: %lu\n", GetOffset()));
PRINT((" dir ID: %lu\n", GetDirID()));
PRINT((" object ID: %lu\n", GetObjectID()));
PRINT((" offset: %" B_PRIu32 "\n", GetOffset()));
PRINT((" dir ID: %" B_PRIu32 "\n", GetDirID()));
PRINT((" object ID: %" B_PRIu32 "\n", GetObjectID()));
PRINT((" location: %hu\n", GetLocation()));
PRINT((" state: %hx\n", GetState()));
}
@@ -39,7 +39,8 @@ static const bool kDefaultHideEsoteric = true;
// constructor
Settings::Settings()
: fDefaultVolumeName(),
:
fDefaultVolumeName(),
fVolumeName(),
fHideEsoteric(kDefaultHideEsoteric),
fHiddenEntries(5)
@@ -74,7 +75,8 @@ Settings::SetTo(const char *volumeName)
status_t
Settings::SetTo(off_t volumeOffset, off_t volumeSize)
{
PRINT(("Settings::SetTo(%Ld, %Ld)\n", volumeOffset, volumeSize));
PRINT(("Settings::SetTo(%" B_PRIdOFF ", %" B_PRIdOFF ")\n", volumeOffset,
volumeSize));
// unset
Unset();
// load the driver settings and find the entry for the volume
@@ -86,7 +88,8 @@ PRINT(("Settings::SetTo(%Ld, %Ld)\n", volumeOffset, volumeSize));
// init the object and unload the settings
_Init(ds, volume);
unload_driver_settings(settings);
PRINT(("Settings::SetTo(%Ld, %Ld) done: B_OK\n", volumeOffset, volumeSize));
PRINT(("Settings::SetTo(%" B_PRIdOFF ", %" B_PRIdOFF ") done: B_OK\n",
volumeOffset, volumeSize));
return B_OK;
}
@@ -143,7 +146,7 @@ Settings::Dump()
PRINT((" default volume name: `%s'\n", GetDefaultVolumeName()));
PRINT((" volume name: `%s'\n", GetVolumeName()));
PRINT((" hide esoteric entries: %d\n", GetHideEsoteric()));
PRINT((" %ld hidden entries:\n", fHiddenEntries.CountItems()));
PRINT((" %" B_PRId32 " hidden entries:\n", fHiddenEntries.CountItems()));
for (int32 i = 0; const char *entry = HiddenEntryAt(i); i++)
PRINT((" `%s'\n", entry));
}
@@ -222,7 +225,8 @@ const driver_parameter *
Settings::_FindVolumeParameter(const driver_settings *settings,
off_t offset, off_t size)
{
PRINT(("Settings::_FindVolumeParameter(%Ld, %Ld)\n", offset, size));
PRINT(("Settings::_FindVolumeParameter(%" B_PRIdOFF ", %" B_PRIdOFF ")\n",
offset, size));
if (settings) {
int32 cookie = 0;
while (const driver_parameter *parameter
@@ -231,8 +235,8 @@ PRINT(("Settings::_FindVolumeParameter(%Ld, %Ld)\n", offset, size));
== offset
&& _GetParameterValue(parameter, "size", size + 1, size + 1)
== size) {
PRINT(("Settings::_FindVolumeParameter() done: found parameter: index: %ld, "
"(%p)\n", cookie - 1, parameter));
PRINT(("Settings::_FindVolumeParameter() done: found parameter:"
" index: %" B_PRId32 ", (%p)\n", cookie - 1, parameter));
return parameter;
}
}
@@ -176,16 +176,16 @@ public:
{
PRINT(("StatData:\n"));
PRINT((" mode: %hx\n", GetMode()));
PRINT((" nlink: %lu\n", GetNLink()));
PRINT((" uid: %lx\n", GetUID()));
PRINT((" gid: %lx\n", GetGID()));
PRINT((" size: %Lu\n", GetSize()));
PRINT((" atime: %lu\n", GetATime()));
PRINT((" mtime: %lu\n", GetMTime()));
PRINT((" ctime: %lu\n", GetCTime()));
PRINT((" blocks: %lu\n", GetBlocks()));
PRINT((" rdev: %lu\n", GetRDev()));
PRINT((" generation: %lu\n", GetGeneration()));
PRINT((" nlink: %" B_PRIu32 "\n", GetNLink()));
PRINT((" uid: %" B_PRIx32 "\n", GetUID()));
PRINT((" gid: %" B_PRIx32 "\n", GetGID()));
PRINT((" size: %" B_PRIu64 "\n", GetSize()));
PRINT((" atime: %" B_PRIu32 "\n", GetATime()));
PRINT((" mtime: %" B_PRIu32 "\n", GetMTime()));
PRINT((" ctime: %" B_PRIu32 "\n", GetCTime()));
PRINT((" blocks: %" B_PRIu32 "\n", GetBlocks()));
PRINT((" rdev: %" B_PRIu32 "\n", GetRDev()));
PRINT((" generation: %" B_PRIu32 "\n", GetGeneration()));
}
StatData &operator=(const StatData &data)
@@ -182,8 +182,10 @@ reiserfs_lookup(fs_volume* fs, fs_vnode* _dir, const char *entryName,
// FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
VNode *dir = (VNode*)_dir->private_node;
FUNCTION(("dir: (%Ld: %lu, %lu), entry: `%s'\n", dir->GetID(), dir->GetDirID(),
dir->GetObjectID(), entryName));
FUNCTION(("dir: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 "), "
"entry: `%s'\n",
dir->GetID(), dir->GetDirID(), dir->GetObjectID(),
entryName));
status_t error = B_OK;
VNode *entryNode = NULL;
@@ -236,8 +238,8 @@ reiserfs_read_vnode(fs_volume *fs, ino_t vnid, fs_vnode *node, int *_type,
{
TOUCH(reenter);
// FUNCTION_START();
FUNCTION(("(%Ld: %lu, %ld)\n", vnid, VNode::GetDirIDFor(vnid),
VNode::GetObjectIDFor(vnid)));
FUNCTION(("(%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
vnid, VNode::GetDirIDFor(vnid), VNode::GetObjectIDFor(vnid)));
Volume *volume = (Volume*)fs->private_volume;
status_t error = B_OK;
VNode *foundNode = new(nothrow) VNode;
@@ -287,8 +289,8 @@ reiserfs_read_symlink(fs_volume *fs, fs_vnode *_node, char *buffer,
// FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
status_t error = B_OK;
// read symlinks only
if (!node->IsSymlink())
@@ -305,8 +307,8 @@ reiserfs_access(fs_volume *fs, fs_vnode *_node, int mode)
{
TOUCH(fs);
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
// write access requested?
if (mode & W_OK)
@@ -326,8 +328,8 @@ reiserfs_read_stat(fs_volume *fs, fs_vnode *_node, struct stat *st)
// FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
status_t error = B_OK;
StatData *statData = node->GetStatData();
st->st_dev = volume->GetID();
@@ -355,8 +357,8 @@ reiserfs_open(fs_volume *fs, fs_vnode *_node, int openMode, void **cookie)
// FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
status_t error = B_OK;
// check the open mode
if ((openMode & O_RWMASK) == O_WRONLY || (openMode & O_RWMASK) == O_RDWR
@@ -386,8 +388,8 @@ reiserfs_close(fs_volume *fs, fs_vnode *_node, void *cookie)
TOUCH(fs); TOUCH(cookie);
// FUNCTION_START();
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
TOUCH(node);
return B_OK;
}
@@ -399,8 +401,8 @@ reiserfs_free_cookie(fs_volume *fs, fs_vnode *_node, void *cookie)
TOUCH(fs);
// FUNCTION_START();
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
TOUCH(node);
StreamReader *reader = (StreamReader*)cookie;
delete reader;
@@ -416,9 +418,10 @@ reiserfs_read(fs_volume *fs, fs_vnode *_node, void *cookie, off_t pos,
// FUNCTION_START();
// Volume *volume = (Volume*)fs->private_volume;
VNode *node = (VNode*)_node->private_node;
FUNCTION(("((%Ld: %lu, %lu), %Ld, %p, %lu)\n", node->GetID(),
node->GetDirID(), node->GetObjectID(), pos, buffer,
*bufferSize));
FUNCTION(("((%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 "), "
"%" B_PRIdOFF ", %p, %lu)\n",
node->GetID(), node->GetDirID(), node->GetObjectID(),
pos, buffer, *bufferSize));
status_t error = B_OK;
// don't read anything but files
if (!node->IsFile()) {
@@ -475,8 +478,8 @@ reiserfs_open_dir(fs_volume *fs, fs_vnode *_node, void **cookie)
// FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
status_t error = (node->IsDir() ? B_OK : B_NOT_A_DIRECTORY);
if (error == B_OK) {
DirectoryCookie *iterator = new(nothrow) DirectoryCookie(
@@ -516,8 +519,8 @@ reiserfs_close_dir(fs_volume *fs, fs_vnode *_node, void *cookie)
TOUCH(fs); TOUCH(cookie);
// FUNCTION_START();
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
TOUCH(node);
return B_OK;
}
@@ -529,8 +532,8 @@ reiserfs_free_dir_cookie(fs_volume *fs, fs_vnode *_node, void *cookie)
TOUCH(fs);
// FUNCTION_START();
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
TOUCH(node);
DirectoryCookie *iterator = (DirectoryCookie*)cookie;
delete iterator;
@@ -545,8 +548,8 @@ reiserfs_read_dir(fs_volume *fs, fs_vnode *_node, void *cookie,
// FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
DirectoryCookie *iterator = (DirectoryCookie*)cookie;
status_t error = iterator->Resume();
if (error == B_OK) {
@@ -585,9 +588,13 @@ FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
buffer->d_dev = volume->GetID();
buffer->d_ino = VNode::GetIDFor(dirID, objectID);
*count = 1;
PRINT(("Successfully read entry: dir: (%Ld: %ld, %ld), name: `%s', "
"id: (%Ld, %ld, %ld), reclen: %hu\n", node->GetID(), node->GetDirID(),
node->GetObjectID(), buffer->d_name, buffer->d_ino, dirID, objectID,
PRINT(("Successfully read entry: dir: (%" B_PRIdINO ": "
"%" B_PRIu32 ", %" B_PRIu32 "), name: `%s', "
"id: (%" B_PRIdINO ", %" B_PRIu32 ", %" B_PRIu32 "), "
"reclen: %hu\n",
node->GetID(),
node->GetDirID(), node->GetObjectID(), buffer->d_name,
buffer->d_ino, dirID, objectID,
buffer->d_reclen));
if (!strcmp("..", buffer->d_name))
iterator->SetEncounteredDotDot(true);
@@ -614,17 +621,21 @@ PRINT(("Successfully read entry: dir: (%Ld: %ld, %ld), name: `%s', "
buffer->d_ino = node->GetID();
// < That's not correct!
*count = 1;
PRINT(("faking `..' entry: dir: (%Ld: %ld, %ld), name: `%s', "
"id: (%Ld, %ld, %ld), reclen: %hu\n", node->GetID(), node->GetDirID(),
node->GetObjectID(), buffer->d_name, buffer->d_ino, node->GetDirID(),
node->GetObjectID(), buffer->d_reclen));
PRINT(("faking `..' entry: dir: (%" B_PRIdINO ": "
"%" B_PRIu32 ", %" B_PRIu32 "), name: `%s', "
"id: (%" B_PRIdINO ", %" B_PRIu32 ", %" B_PRIu32
"), reclen: %hu\n",
node->GetID(),
node->GetDirID(), node->GetObjectID(), buffer->d_name,
buffer->d_ino, node->GetDirID(), node->GetObjectID(),
buffer->d_reclen));
iterator->SetEncounteredDotDot(true);
}
}
}
iterator->Suspend();
}
PRINT(("returning %ld entries\n", *count));
PRINT(("returning %" B_PRIu32 " entries\n", *count));
RETURN_ERROR(error);
}
@@ -635,8 +646,8 @@ reiserfs_rewind_dir(fs_volume *fs, fs_vnode *_node, void *cookie)
TOUCH(fs);
// FUNCTION_START();
VNode *node = (VNode*)_node->private_node;
FUNCTION(("node: (%Ld: %lu, %lu)\n", node->GetID(), node->GetDirID(),
node->GetObjectID()));
FUNCTION(("node: (%" B_PRIdINO ": %" B_PRIu32 ", %" B_PRIu32 ")\n",
node->GetID(), node->GetDirID(), node->GetObjectID()));
TOUCH(node);
DirectoryCookie *iterator = (DirectoryCookie*)cookie;
status_t error = iterator->Rewind(); // no need to Resume()