nfs4: Make TRACE format strings 32/64 bit independent

This commit is contained in:
Pawel Dziepak 2013-02-14 01:37:09 +01:00
parent a4caa431e4
commit c65f77dc10
2 changed files with 55 additions and 51 deletions

View File

@ -220,8 +220,7 @@ FileSystem::GetInode(ino_t id, Inode** _inode)
FileInfo fi;
status_t result = fInoIdMap.GetFileInfo(&fi, id);
if (result == B_ENTRY_NOT_FOUND)
dprintf("NFS4: unknown inode: %llu\n", id);
ASSERT(result != B_ENTRY_NOT_FOUND);
if (result != B_OK)
return result;

View File

@ -7,6 +7,8 @@
*/
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdio.h>
#include <AutoDeleter.h>
@ -148,8 +150,8 @@ static status_t
nfs4_mount(fs_volume* volume, const char* device, uint32 flags,
const char* args, ino_t* _rootVnodeID)
{
TRACE("volume = %p, device = %s, flags = %lu, args = %s", volume, device,
flags, args);
TRACE("volume = %p, device = %s, flags = %" PRIu32 ", args = %s", volume,
device, flags, args);
status_t result;
@ -214,7 +216,7 @@ nfs4_mount(fs_volume* volume, const char* device, uint32 flags,
*_rootVnodeID = inode->ID();
TRACE("*_rootVnodeID = %llu", inode->ID());
TRACE("*_rootVnodeID = %" PRIi64, inode->ID());
return B_OK;
}
@ -225,7 +227,7 @@ nfs4_get_vnode(fs_volume* volume, ino_t id, fs_vnode* vnode, int* _type,
uint32* _flags, bool reenter)
{
FileSystem* fs = reinterpret_cast<FileSystem*>(volume->private_volume);
TRACE("volume = %p, id = %llu", volume, id);
TRACE("volume = %p, id = %" PRIi64, volume, id);
VnodeToInode* vnodeToInode = new VnodeToInode(id, fs);
if (vnodeToInode == NULL)
@ -289,14 +291,14 @@ nfs4_lookup(fs_volume* volume, fs_vnode* dir, const char* name, ino_t* _id)
if (inode == NULL)
return B_ENTRY_NOT_FOUND;
TRACE("volume = %p, dir = %llu, name = %s", volume, vti->ID(), name);
TRACE("volume = %p, dir = %" PRIi64 ", name = %s", volume, vti->ID(), name);
status_t result = inode->LookUp(name, _id);
if (result != B_OK)
return result;
locker.Unlock();
TRACE("*_id = %llu", *_id);
TRACE("*_id = %" PRIi64, *_id);
// If VTI holds an outdated Inode next operation performed on it will
// return either ERR_STALE or ERR_FHEXPIRED. Both of these error codes
@ -317,7 +319,7 @@ nfs4_get_vnode_name(fs_volume* volume, fs_vnode* vnode, char* buffer,
size_t bufferSize)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
TRACE("volume = %p, vnode = %" PRIi64, volume, vti->ID());
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -333,7 +335,7 @@ static status_t
nfs4_put_vnode(fs_volume* volume, fs_vnode* vnode, bool reenter)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
TRACE("volume = %p, vnode = %" PRIi64, volume, vti->ID());
delete vti;
return B_OK;
@ -345,7 +347,7 @@ nfs4_remove_vnode(fs_volume* volume, fs_vnode* vnode, bool reenter)
{
FileSystem* fs = reinterpret_cast<FileSystem*>(volume->private_volume);
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
TRACE("volume = %p, vnode = %" PRIi64, volume, vti->ID());
if (fs->Root() == vti->GetPointer())
return B_OK;
@ -362,8 +364,8 @@ nfs4_read_pages(fs_volume* _volume, fs_vnode* vnode, void* _cookie, off_t pos,
const iovec* vecs, size_t count, size_t* _numBytes)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p, pos = %llu, " \
"count = %lu, numBytes = %lu", _volume, vti->ID(), _cookie, pos,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, pos = %" PRIi64 \
", count = %lu, numBytes = %lu", _volume, vti->ID(), _cookie, pos,
count, *_numBytes);
VnodeToInodeLocker _(vti);
@ -406,8 +408,8 @@ nfs4_write_pages(fs_volume* _volume, fs_vnode* vnode, void* _cookie, off_t pos,
const iovec* vecs, size_t count, size_t* _numBytes)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p, pos = %llu, " \
"count = %lu, numBytes = %lu", _volume, vti->ID(), _cookie, pos,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, pos = %" PRIi64 \
", count = %lu, numBytes = %lu", _volume, vti->ID(), _cookie, pos,
count, *_numBytes);
VnodeToInodeLocker _(vti);
@ -446,7 +448,7 @@ static status_t
nfs4_io(fs_volume* volume, fs_vnode* vnode, void* cookie, io_request* request)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p", volume, vti->ID(),
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p", volume, vti->ID(),
cookie);
VnodeToInodeLocker _(vti);
@ -481,7 +483,7 @@ nfs4_get_file_map(fs_volume* volume, fs_vnode* vnode, off_t _offset,
static status_t
nfs4_set_flags(fs_volume* volume, fs_vnode* vnode, void* _cookie, int flags)
{
TRACE("volume = %p, vnode = %llu, cookie = %p, flags = %d", volume,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, flags = %d", volume,
reinterpret_cast<VnodeToInode*>(vnode->private_node)->ID(), _cookie,
flags);
@ -495,7 +497,7 @@ static status_t
nfs4_fsync(fs_volume* volume, fs_vnode* vnode)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
TRACE("volume = %p, vnode = %" PRIi64, volume, vti->ID());
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -511,7 +513,7 @@ nfs4_read_symlink(fs_volume* volume, fs_vnode* link, char* buffer,
size_t* _bufferSize)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(link->private_node);
TRACE("volume = %p, link = %llu", volume, vti->ID());
TRACE("volume = %p, link = %" PRIi64, volume, vti->ID());
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -527,8 +529,8 @@ nfs4_create_symlink(fs_volume* volume, fs_vnode* dir, const char* name,
const char* path, int mode)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(dir->private_node);
TRACE("volume = %p, dir = %llu, name = %s, path = %s, mode = %d", volume,
vti->ID(), name, path, mode);
TRACE("volume = %p, dir = %" PRIi64 ", name = %s, path = %s, mode = %d",
volume, vti->ID(), name, path, mode);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -556,7 +558,7 @@ nfs4_link(fs_volume* volume, fs_vnode* dir, const char* name, fs_vnode* vnode)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
VnodeToInode* dirVti = reinterpret_cast<VnodeToInode*>(dir->private_node);
TRACE("volume = %p, dir = %llu, name = %s, vnode = %llu", volume,
TRACE("volume = %p, dir = %" PRIi64 ", name = %s, vnode = %" PRIi64, volume,
dirVti->ID(), name, vti->ID());
VnodeToInodeLocker _dir(dirVti);
@ -584,7 +586,7 @@ nfs4_unlink(fs_volume* volume, fs_vnode* dir, const char* name)
if (inode == NULL)
return B_ENTRY_NOT_FOUND;
TRACE("volume = %p, dir = %llu, name = %s", volume, vti->ID(), name);
TRACE("volume = %p, dir = %" PRIi64 ", name = %s", volume, vti->ID(), name);
ino_t id;
status_t result = inode->Remove(name, NF4REG, &id);
@ -613,9 +615,9 @@ nfs4_rename(fs_volume* volume, fs_vnode* fromDir, const char* fromName,
VnodeToInode* fromVti
= reinterpret_cast<VnodeToInode*>(fromDir->private_node);
VnodeToInode* toVti = reinterpret_cast<VnodeToInode*>(toDir->private_node);
TRACE("volume = %p, fromDir = %llu, toDir = %llu, fromName = %s, " \
"toName = %s", volume, fromVti->ID(), toVti->ID(), fromName,
toName);
TRACE("volume = %p, fromDir = %" PRIi64 ", toDir = %" PRIi64 "," \
" fromName = %s, toName = %s", volume, fromVti->ID(), toVti->ID(), \
fromName, toName);
VnodeToInodeLocker _from(fromVti);
Inode* fromInode = fromVti->Get();
@ -652,7 +654,8 @@ static status_t
nfs4_access(fs_volume* volume, fs_vnode* vnode, int mode)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, mode = %d", volume, vti->ID(), mode);
TRACE("volume = %p, vnode = %" PRIi64 ", mode = %d", volume, vti->ID(),
mode);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -667,7 +670,7 @@ static status_t
nfs4_read_stat(fs_volume* volume, fs_vnode* vnode, struct stat* stat)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
TRACE("volume = %p, vnode = %" PRIi64, volume, vti->ID());
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -683,8 +686,8 @@ nfs4_write_stat(fs_volume* volume, fs_vnode* vnode, const struct stat* stat,
uint32 statMask)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, statMask = %lu", volume, vti->ID(),
statMask);
TRACE("volume = %p, vnode = %" PRIi64 ", statMask = %" PRIu32, volume,
vti->ID(), statMask);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -738,8 +741,8 @@ nfs4_create(fs_volume* volume, fs_vnode* dir, const char* name, int openMode,
*_cookie = cookie;
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(dir->private_node);
TRACE("volume = %p, dir = %llu, name = %s, openMode = %d, perms = %d",
volume, vti->ID(), name, openMode, perms);
TRACE("volume = %p, dir = %" PRIi64 ", name = %s, openMode = %d," \
" perms = %d", volume, vti->ID(), name, openMode, perms);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -784,7 +787,7 @@ nfs4_create(fs_volume* volume, fs_vnode* dir, const char* name, int openMode,
}
}
TRACE("*cookie = %p, *newVnodeID = %llu", *_cookie, *_newVnodeID);
TRACE("*cookie = %p, *newVnodeID = %" PRIi64, *_cookie, *_newVnodeID);
return result;
}
@ -793,7 +796,7 @@ static status_t
nfs4_open(fs_volume* volume, fs_vnode* vnode, int openMode, void** _cookie)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, openMode = %d", volume, vti->ID(),
TRACE("volume = %p, vnode = %" PRIi64 ", openMode = %d", volume, vti->ID(),
openMode);
VnodeToInodeLocker _(vti);
@ -826,7 +829,7 @@ nfs4_close(fs_volume* volume, fs_vnode* vnode, void* _cookie)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p", volume, vti->ID(),
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p", volume, vti->ID(),
_cookie);
VnodeToInodeLocker _(vti);
@ -848,7 +851,7 @@ nfs4_free_cookie(fs_volume* volume, fs_vnode* vnode, void* _cookie)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p", volume, vti->ID(),
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p", volume, vti->ID(),
_cookie);
VnodeToInodeLocker _(vti);
@ -873,8 +876,8 @@ nfs4_read(fs_volume* volume, fs_vnode* vnode, void* _cookie, off_t pos,
void* buffer, size_t* length)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p, pos = %llu, length = %lu",
volume, vti->ID(), _cookie, pos, *length);
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, pos = %" PRIi64 \
", length = %lu", volume, vti->ID(), _cookie, pos, *length);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -898,8 +901,8 @@ nfs4_write(fs_volume* volume, fs_vnode* vnode, void* _cookie, off_t pos,
const void* _buffer, size_t* length)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p, pos = %llu, length = %lu",
volume, vti->ID(), _cookie, pos, *length);
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, pos = %" PRIi64 \
", length = %lu", volume, vti->ID(), _cookie, pos, *length);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -923,7 +926,8 @@ nfs4_create_dir(fs_volume* volume, fs_vnode* parent, const char* name,
int mode)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(parent->private_node);
TRACE("volume = %p, parent = %llu, mode = %d", volume, vti->ID(), mode);
TRACE("volume = %p, parent = %" PRIi64 ", mode = %d", volume, vti->ID(),
mode);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -950,7 +954,8 @@ static status_t
nfs4_remove_dir(fs_volume* volume, fs_vnode* parent, const char* name)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(parent->private_node);
TRACE("volume = %p, parent = %llu, name = %s", volume, vti->ID(), name);
TRACE("volume = %p, parent = %" PRIi64 ", name = %s", volume, vti->ID(),
name);
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -985,7 +990,7 @@ nfs4_open_dir(fs_volume* volume, fs_vnode* vnode, void** _cookie)
*_cookie = cookie;
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
TRACE("volume = %p, vnode = %" PRIi64, volume, vti->ID());
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -1005,7 +1010,7 @@ nfs4_open_dir(fs_volume* volume, fs_vnode* vnode, void** _cookie)
static status_t
nfs4_close_dir(fs_volume* volume, fs_vnode* vnode, void* _cookie)
{
TRACE("volume = %p, vnode = %llu, cookie = %p", volume,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p", volume,
reinterpret_cast<VnodeToInode*>(vnode->private_node)->ID(), _cookie);
Cookie* cookie = reinterpret_cast<Cookie*>(_cookie);
@ -1016,7 +1021,7 @@ nfs4_close_dir(fs_volume* volume, fs_vnode* vnode, void* _cookie)
static status_t
nfs4_free_dir_cookie(fs_volume* volume, fs_vnode* vnode, void* cookie)
{
TRACE("volume = %p, vnode = %llu, cookie = %p", volume,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p", volume,
reinterpret_cast<VnodeToInode*>(vnode->private_node)->ID(), cookie);
delete reinterpret_cast<OpenDirCookie*>(cookie);
@ -1030,7 +1035,7 @@ nfs4_read_dir(fs_volume* volume, fs_vnode* vnode, void* _cookie,
{
OpenDirCookie* cookie = reinterpret_cast<OpenDirCookie*>(_cookie);
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p", volume, vti->ID(),
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p", volume, vti->ID(),
_cookie);
VnodeToInodeLocker _(vti);
@ -1045,7 +1050,7 @@ nfs4_read_dir(fs_volume* volume, fs_vnode* vnode, void* _cookie,
static status_t
nfs4_rewind_dir(fs_volume* volume, fs_vnode* vnode, void* _cookie)
{
TRACE("volume = %p, vnode = %llu, cookie = %p", volume,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p", volume,
reinterpret_cast<VnodeToInode*>(vnode->private_node)->ID(), _cookie);
OpenDirCookie* cookie = reinterpret_cast<OpenDirCookie*>(_cookie);
@ -1069,7 +1074,7 @@ nfs4_open_attr_dir(fs_volume* volume, fs_vnode* vnode, void** _cookie)
*_cookie = cookie;
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu", volume, vti->ID());
TRACE("volume = %p, vnode = %" PRIi64, volume, vti->ID());
VnodeToInodeLocker _(vti);
Inode* inode = vti->Get();
@ -1292,7 +1297,7 @@ nfs4_test_lock(fs_volume* volume, fs_vnode* vnode, void* _cookie,
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
OpenFileCookie* cookie = reinterpret_cast<OpenFileCookie*>(_cookie);
TRACE("volume = %p, vnode = %llu, cookie = %p, lock = %p", volume,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, lock = %p", volume,
vti->ID(), _cookie, lock);
VnodeToInodeLocker _(vti);
@ -1310,7 +1315,7 @@ nfs4_acquire_lock(fs_volume* volume, fs_vnode* vnode, void* _cookie,
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
OpenFileCookie* cookie = reinterpret_cast<OpenFileCookie*>(_cookie);
TRACE("volume = %p, vnode = %llu, cookie = %p, lock = %p", volume,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, lock = %p", volume,
vti->ID(), _cookie, lock);
@ -1329,7 +1334,7 @@ nfs4_release_lock(fs_volume* volume, fs_vnode* vnode, void* _cookie,
const struct flock* lock)
{
VnodeToInode* vti = reinterpret_cast<VnodeToInode*>(vnode->private_node);
TRACE("volume = %p, vnode = %llu, cookie = %p, lock = %p", volume,
TRACE("volume = %p, vnode = %" PRIi64 ", cookie = %p, lock = %p", volume,
vti->ID(), _cookie, lock);
VnodeToInodeLocker _(vti);