From 245aecda8ac43fc2c0c0bac6a7e4016efa9b71e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 21 Jun 2007 19:50:57 +0000 Subject: [PATCH] Got rid of vnode_id and mount_id, replaced with ino_t and dev_t. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21485 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/file_cache.h | 14 +- headers/private/kernel/fs/node_monitor.h | 8 +- headers/private/kernel/vfs.h | 25 ++-- headers/private/userlandfs/private/Requests.h | 54 ++++---- .../file_systems/bfs/BlockAllocator.cpp | 2 +- src/add-ons/kernel/file_systems/bfs/Index.cpp | 2 +- src/add-ons/kernel/file_systems/bfs/Inode.cpp | 25 ++-- src/add-ons/kernel/file_systems/bfs/Inode.h | 18 +-- .../kernel/file_systems/bfs/Volume.cpp | 2 +- src/add-ons/kernel/file_systems/bfs/Volume.h | 13 +- .../kernel/file_systems/bfs/bfs_control.h | 13 +- .../file_systems/bfs/kernel_interface.cpp | 20 +-- .../file_systems/cdda/kernel_interface.cpp | 28 ++-- src/add-ons/kernel/file_systems/dos/dir.c | 44 ++++--- src/add-ons/kernel/file_systems/dos/dir.h | 28 ++-- src/add-ons/kernel/file_systems/dos/dlist.c | 42 ++++-- src/add-ons/kernel/file_systems/dos/dlist.h | 6 +- src/add-ons/kernel/file_systems/dos/dosfs.c | 6 +- src/add-ons/kernel/file_systems/dos/dosfs.h | 26 ++-- src/add-ons/kernel/file_systems/dos/file.c | 13 +- src/add-ons/kernel/file_systems/dos/file.h | 12 +- src/add-ons/kernel/file_systems/dos/vcache.c | 36 +++--- src/add-ons/kernel/file_systems/dos/vcache.h | 12 +- .../kernel/file_systems/googlefs/fsproto.h | 29 ++--- .../kernel/file_systems/googlefs/googlefs.c | 22 ++-- .../kernel/file_systems/googlefs/googlefs.h | 6 +- .../kernel/file_systems/googlefs/vnidpool.c | 4 +- .../kernel/file_systems/googlefs/vnidpool.h | 6 +- src/add-ons/kernel/file_systems/iso9660/iso.c | 42 +++--- src/add-ons/kernel/file_systems/iso9660/iso.h | 61 ++++----- .../file_systems/iso9660/kernel_interface.cpp | 84 ++++++------ src/add-ons/kernel/file_systems/nfs/fsproto.h | 29 ++--- .../kernel/file_systems/nfs/nfs_add_on.c | 22 ++-- .../kernel/file_systems/nfs/nfs_add_on.h | 16 +-- .../kernel/file_systems/ntfs/fs_func.c | 27 ++-- .../kernel/file_systems/ntfs/fs_func.h | 18 +-- .../kernel/file_systems/ntfs/fsproto.h | 29 ++--- src/add-ons/kernel/file_systems/ntfs/ntfs.h | 2 +- src/add-ons/kernel/file_systems/ramfs/Node.h | 4 +- .../file_systems/ramfs/NodeChildTable.h | 26 ++-- .../kernel/file_systems/ramfs/NodeTable.cpp | 6 +- .../kernel/file_systems/ramfs/NodeTable.h | 8 +- .../kernel/file_systems/ramfs/Volume.cpp | 22 ++-- .../kernel/file_systems/ramfs/Volume.h | 30 ++--- .../file_systems/ramfs/kernel_interface.cpp | 16 +-- .../kernel/file_systems/reiserfs/VNode.cpp | 8 +- .../kernel/file_systems/reiserfs/VNode.h | 20 +-- .../kernel/file_systems/reiserfs/Volume.cpp | 12 +- .../kernel/file_systems/reiserfs/Volume.h | 16 +-- .../reiserfs/kernel_interface.cpp | 8 +- .../file_systems/udf/DirectoryIterator.cpp | 6 +- .../file_systems/udf/DirectoryIterator.h | 6 +- src/add-ons/kernel/file_systems/udf/Icb.cpp | 8 +- src/add-ons/kernel/file_systems/udf/Icb.h | 10 +- src/add-ons/kernel/file_systems/udf/Utils.cpp | 14 +- src/add-ons/kernel/file_systems/udf/Utils.h | 8 +- src/add-ons/kernel/file_systems/udf/fsproto.h | 30 ++--- src/add-ons/kernel/file_systems/udf/udf.cpp | 20 +-- .../userlandfs/kernel_add_on/FileSystem.cpp | 4 +- .../userlandfs/kernel_add_on/FileSystem.h | 4 +- .../kernel_add_on/KernelRequestHandler.cpp | 2 +- .../kernel_add_on/KernelRequestHandler.h | 2 +- .../userlandfs/kernel_add_on/Volume.cpp | 40 +++--- .../userlandfs/kernel_add_on/Volume.h | 38 +++--- .../kernel_add_on/kernel_interface.cpp | 12 +- .../server/BeOSKernelFileSystem.cpp | 2 +- .../userlandfs/server/BeOSKernelFileSystem.h | 2 +- .../userlandfs/server/BeOSKernelVolume.cpp | 16 +-- .../userlandfs/server/BeOSKernelVolume.h | 14 +- .../userlandfs/server/FileSystem.h | 2 +- .../server/HaikuKernelFileSystem.cpp | 2 +- .../userlandfs/server/HaikuKernelFileSystem.h | 2 +- .../userlandfs/server/HaikuKernelVolume.cpp | 12 +- .../userlandfs/server/HaikuKernelVolume.h | 12 +- .../server/UserlandRequestHandler.cpp | 8 +- .../file_systems/userlandfs/server/Volume.cpp | 18 +-- .../file_systems/userlandfs/server/Volume.h | 18 +-- .../userlandfs/server/beos_fs_interface.h | 10 +- .../userlandfs/server/beos_kernel_emu.cpp | 20 +-- .../userlandfs/server/haiku_file_cache.cpp | 16 +-- .../userlandfs/server/haiku_fs_cache.h | 2 +- .../userlandfs/server/haiku_kernel_emu.cpp | 42 +++--- .../userlandfs/server/kernel_emu.cpp | 22 ++-- .../userlandfs/server/kernel_emu.h | 22 ++-- src/system/kernel/cache/file_cache.cpp | 12 +- src/system/kernel/fs/devfs.cpp | 28 ++-- src/system/kernel/fs/node_monitor.cpp | 60 ++++----- src/system/kernel/fs/pipefs.cpp | 36 +++--- src/system/kernel/fs/rootfs.c | 28 ++-- src/system/kernel/fs/vfs.cpp | 120 +++++++++--------- src/system/kernel/main.c | 7 +- 91 files changed, 884 insertions(+), 875 deletions(-) diff --git a/headers/private/kernel/file_cache.h b/headers/private/kernel/file_cache.h index 0daab3082a..4bb012d6ac 100644 --- a/headers/private/kernel/file_cache.h +++ b/headers/private/kernel/file_cache.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ #ifndef _KERNEL_FILE_CACHE_H @@ -26,9 +26,9 @@ struct cache_module_info { module_info info; - void (*node_opened)(void *vnode, int32 fdType, mount_id mountID, vnode_id parentID, - vnode_id vnodeID, const char *name, off_t size); - void (*node_closed)(void *vnode, int32 fdType, mount_id mountID, vnode_id vnodeID, + void (*node_opened)(void *vnode, int32 fdType, dev_t mountID, ino_t parentID, + ino_t vnodeID, const char *name, off_t size); + void (*node_closed)(void *vnode, int32 fdType, dev_t mountID, ino_t vnodeID, int32 accessType); void (*node_launched)(size_t argCount, char * const *args); }; @@ -38,12 +38,12 @@ extern "C" { #endif extern void cache_node_opened(void *vnode, int32 fdType, vm_cache_ref *cache, - mount_id mountID, vnode_id parentID, vnode_id vnodeID, const char *name); + dev_t mountID, ino_t parentID, ino_t vnodeID, const char *name); extern void cache_node_closed(void *vnode, int32 fdType, vm_cache_ref *cache, - mount_id mountID, vnode_id vnodeID); + dev_t mountID, ino_t vnodeID); extern void cache_node_launched(size_t argCount, char * const *args); extern void cache_prefetch_vnode(void *vnode, off_t offset, size_t size); -extern void cache_prefetch(mount_id mountID, vnode_id vnodeID, off_t offset, size_t size); +extern void cache_prefetch(dev_t mountID, ino_t vnodeID, off_t offset, size_t size); extern status_t file_cache_init_post_boot_device(void); extern status_t file_cache_init(void); diff --git a/headers/private/kernel/fs/node_monitor.h b/headers/private/kernel/fs/node_monitor.h index 23a7545c6c..c595d2ea3f 100644 --- a/headers/private/kernel/fs/node_monitor.h +++ b/headers/private/kernel/fs/node_monitor.h @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef _KERNEL_NODE_MONITOR_H @@ -18,9 +18,9 @@ extern "C" { // private kernel API extern status_t remove_node_monitors(struct io_context *context); extern status_t node_monitor_init(void); -extern status_t notify_unmount(mount_id device); -extern status_t notify_mount(mount_id device, mount_id parentDevice, - vnode_id parentDirectory); +extern status_t notify_unmount(dev_t device); +extern status_t notify_mount(dev_t device, dev_t parentDevice, + ino_t parentDirectory); // user-space exported calls extern status_t _user_stop_notifying(port_id port, uint32 token); diff --git a/headers/private/kernel/vfs.h b/headers/private/kernel/vfs.h index e1fc714658..1498c8d4a2 100644 --- a/headers/private/kernel/vfs.h +++ b/headers/private/kernel/vfs.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -21,10 +21,9 @@ #include -/* R5 figures, but we don't use a table for monitors anyway */ -#define DEFAULT_FD_TABLE_SIZE 128 +#define DEFAULT_FD_TABLE_SIZE 256 #define MAX_FD_TABLE_SIZE 8192 -#define DEFAULT_NODE_MONITORS 4096 +#define DEFAULT_NODE_MONITORS 4096 #define MAX_NODE_MONITORS 65536 struct kernel_args; @@ -78,12 +77,12 @@ int vfs_setrlimit(int resource, const struct rlimit * rlp); /* calls needed by the VM for paging and by the file cache */ int vfs_get_vnode_from_fd(int fd, bool kernel, void **vnode); status_t vfs_get_vnode_from_path(const char *path, bool kernel, void **vnode); -status_t vfs_get_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode); -status_t vfs_entry_ref_to_vnode(mount_id mountID, vnode_id directoryID, +status_t vfs_get_vnode(dev_t mountID, ino_t vnodeID, void **_vnode); +status_t vfs_entry_ref_to_vnode(dev_t mountID, ino_t directoryID, const char *name, void **_vnode); -void vfs_vnode_to_node_ref(void *_vnode, mount_id *_mountID, vnode_id *_vnodeID); +void vfs_vnode_to_node_ref(void *_vnode, dev_t *_mountID, ino_t *_vnodeID); -status_t vfs_lookup_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode); +status_t vfs_lookup_vnode(dev_t mountID, ino_t vnodeID, void **_vnode); void vfs_put_vnode(void *vnode); void vfs_acquire_vnode(void *vnode); status_t vfs_get_cookie_from_fd(int fd, void **_cookie); @@ -95,13 +94,13 @@ status_t vfs_write_pages(void *vnode, void *cookie, off_t pos, status_t vfs_get_vnode_cache(void *vnode, struct vm_cache_ref **_cache, bool allocate); status_t vfs_get_file_map( void *_vnode, off_t offset, size_t size, struct file_io_vec *vecs, size_t *_count); -status_t vfs_get_fs_node_from_path(mount_id mountID, const char *path, +status_t vfs_get_fs_node_from_path(dev_t mountID, const char *path, bool kernel, void **_node); status_t vfs_stat_vnode(void *_vnode, struct stat *stat); status_t vfs_get_vnode_name(void *vnode, char *name, size_t nameSize); -status_t vfs_get_cwd(mount_id *_mountID, vnode_id *_vnodeID); +status_t vfs_get_cwd(dev_t *_mountID, ino_t *_vnodeID); void vfs_unlock_vnode_if_locked(struct file_descriptor *descriptor); -status_t vfs_disconnect_vnode(mount_id mountID, vnode_id vnodeID); +status_t vfs_disconnect_vnode(dev_t mountID, ino_t vnodeID); void vfs_free_unused_vnodes(int32 level); /* special module convenience call */ @@ -113,8 +112,8 @@ status_t vfs_normalize_path(const char *path, char *buffer, size_t bufferSize, bool kernel); /* service call for the node monitor */ -status_t resolve_mount_point_to_volume_root(mount_id mountID, vnode_id nodeID, - mount_id *resolvedMountID, vnode_id *resolvedNodeID); +status_t resolve_mount_point_to_volume_root(dev_t mountID, ino_t nodeID, + dev_t *resolvedMountID, ino_t *resolvedNodeID); /* calls the syscall dispatcher should use for user file I/O */ dev_t _user_mount(const char *path, const char *device, const char *fs_name, diff --git a/headers/private/userlandfs/private/Requests.h b/headers/private/userlandfs/private/Requests.h index 7a35e312a0..4753dd5d0b 100644 --- a/headers/private/userlandfs/private/Requests.h +++ b/headers/private/userlandfs/private/Requests.h @@ -326,7 +326,7 @@ public: MountVolumeRequest() : Request(MOUNT_VOLUME_REQUEST) {} status_t GetAddressInfos(AddressInfo* infos, int32* count); - mount_id nsid; + dev_t nsid; Address cwd; // current working dir of the mount() caller Address device; uint32 flags; @@ -338,7 +338,7 @@ class MountVolumeReply : public ReplyRequest { public: MountVolumeReply() : ReplyRequest(MOUNT_VOLUME_REPLY) {} - vnode_id rootID; + ino_t rootID; fs_volume volume; }; @@ -430,7 +430,7 @@ class LookupReply : public ReplyRequest { public: LookupReply() : ReplyRequest(LOOKUP_REPLY) {} - vnode_id vnid; + ino_t vnid; int type; }; @@ -456,7 +456,7 @@ class ReadVNodeRequest : public VolumeRequest { public: ReadVNodeRequest() : VolumeRequest(READ_VNODE_REQUEST) {} - vnode_id vnid; + ino_t vnid; bool reenter; }; @@ -731,7 +731,7 @@ class CreateReply : public ReplyRequest { public: CreateReply() : ReplyRequest(CREATE_REPLY) {} - vnode_id vnid; + ino_t vnid; fs_cookie fileCookie; }; @@ -831,7 +831,7 @@ class CreateDirReply : public ReplyRequest { public: CreateDirReply() : ReplyRequest(CREATE_DIR_REPLY) {} - vnode_id newDir; + ino_t newDir; }; // RemoveDirRequest @@ -1374,10 +1374,10 @@ public: int32 operation; uint32 details; // for B_STAT_CHANGED:statFields // and B_ATTRIBUTE_CHANGED:cause - mount_id device; - vnode_id oldDirectory; - vnode_id directory; - vnode_id node; + dev_t device; + ino_t oldDirectory; + ino_t directory; + ino_t node; Address oldName; Address name; }; @@ -1414,9 +1414,9 @@ public: port_id port; int32 token; int32 operation; // B_ENTRY_{CREATED,REMOVED} - mount_id device; - vnode_id directory; - vnode_id node; + dev_t device; + ino_t directory; + ino_t node; Address name; }; @@ -1435,8 +1435,8 @@ class GetVNodeRequest : public Request { public: GetVNodeRequest() : Request(GET_VNODE_REQUEST) {} - mount_id nsid; - vnode_id vnid; + dev_t nsid; + ino_t vnid; }; // GetVNodeReply @@ -1452,8 +1452,8 @@ class PutVNodeRequest : public Request { public: PutVNodeRequest() : Request(PUT_VNODE_REQUEST) {} - mount_id nsid; - vnode_id vnid; + dev_t nsid; + ino_t vnid; }; // PutVNodeReply @@ -1467,8 +1467,8 @@ class NewVNodeRequest : public Request { public: NewVNodeRequest() : Request(NEW_VNODE_REQUEST) {} - mount_id nsid; - vnode_id vnid; + dev_t nsid; + ino_t vnid; fs_vnode node; }; @@ -1483,8 +1483,8 @@ class PublishVNodeRequest : public Request { public: PublishVNodeRequest() : Request(PUBLISH_VNODE_REQUEST) {} - mount_id nsid; - vnode_id vnid; + dev_t nsid; + ino_t vnid; fs_vnode node; }; @@ -1499,8 +1499,8 @@ class RemoveVNodeRequest : public Request { public: RemoveVNodeRequest() : Request(REMOVE_VNODE_REQUEST) {} - mount_id nsid; - vnode_id vnid; + dev_t nsid; + ino_t vnid; }; // RemoveVNodeReply @@ -1514,8 +1514,8 @@ class UnremoveVNodeRequest : public Request { public: UnremoveVNodeRequest() : Request(UNREMOVE_VNODE_REQUEST) {} - mount_id nsid; - vnode_id vnid; + dev_t nsid; + ino_t vnid; }; // UnremoveVNodeReply @@ -1529,8 +1529,8 @@ class GetVNodeRemovedRequest : public Request { public: GetVNodeRemovedRequest() : Request(GET_VNODE_REMOVED_REQUEST) {} - mount_id nsid; - vnode_id vnid; + dev_t nsid; + ino_t vnid; }; // GetVNodeRemovedReply diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index 0adbe184b8..399197c8f1 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -977,7 +977,7 @@ BlockAllocator::CheckNextNode(check_control *control) char name[B_FILE_NAME_LENGTH]; uint16 length; - vnode_id id; + ino_t id; status_t status = cookie->iterator->GetNextEntry(name, &length, B_FILE_NAME_LENGTH, &id); if (status == B_ENTRY_NOT_FOUND) { diff --git a/src/add-ons/kernel/file_systems/bfs/Index.cpp b/src/add-ons/kernel/file_systems/bfs/Index.cpp index 2b50c4efc8..a0423be7f7 100644 --- a/src/add-ons/kernel/file_systems/bfs/Index.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Index.cpp @@ -79,7 +79,7 @@ Index::SetTo(const char *name) if (indices->GetTree(&tree) != B_OK) return B_BAD_VALUE; - vnode_id id; + ino_t id; status_t status = tree->Find((uint8 *)name, (uint16)strlen(name), &id); if (status != B_OK) return status; diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index f79184553a..12c7ceebf4 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -165,7 +165,7 @@ bfs_inode::InitCheck(Volume *volume) // #pragma mark - Inode -Inode::Inode(Volume *volume, vnode_id id) +Inode::Inode(Volume *volume, ino_t id) : fVolume(volume), fID(id), @@ -194,7 +194,8 @@ Inode::Inode(Volume *volume, vnode_id id) } -Inode::Inode(Volume *volume, Transaction &transaction, vnode_id id, mode_t mode, block_run &run) +Inode::Inode(Volume *volume, Transaction &transaction, ino_t id, mode_t mode, + block_run &run) : fVolume(volume), fID(id), @@ -1002,7 +1003,7 @@ Inode::GetAttribute(const char *name, Inode **_attribute) BPlusTree *tree; status_t status = attributes->GetTree(&tree); if (status == B_OK) { - vnode_id id; + ino_t id; status = tree->Find((uint8 *)name, (uint16)strlen(name), &id); if (status == B_OK) { Vnode vnode(fVolume, id); @@ -1090,7 +1091,7 @@ Inode::IsEmpty() uint32 count = 0; char name[BPLUSTREE_MAX_KEY_LENGTH]; uint16 length; - vnode_id id; + ino_t id; while (iterator.GetNextEntry(name, &length, B_FILE_NAME_LENGTH, &id) == B_OK) { if (Mode() & (S_ATTR_DIR | S_INDEX_DIR)) @@ -2011,7 +2012,7 @@ Inode::Free(Transaction &transaction) char name[B_FILE_NAME_LENGTH]; uint32 type; size_t length; - vnode_id id; + ino_t id; while ((status = iterator.GetNext(name, &length, &type, &id)) == B_OK) { RemoveAttribute(transaction, name); } @@ -2123,7 +2124,7 @@ Inode::Sync() status_t -Inode::Remove(Transaction &transaction, const char *name, vnode_id *_id, +Inode::Remove(Transaction &transaction, const char *name, ino_t *_id, bool isDirectory) { BPlusTree *tree; @@ -2220,7 +2221,7 @@ Inode::Remove(Transaction &transaction, const char *name, vnode_id *_id, */ status_t Inode::Create(Transaction &transaction, Inode *parent, const char *name, - int32 mode, int openMode, uint32 type, bool *_created, vnode_id *_id, + int32 mode, int openMode, uint32 type, bool *_created, ino_t *_id, Inode **_inode) { FUNCTION_START(("name = %s, mode = %ld\n", name, mode)); @@ -2456,7 +2457,7 @@ AttributeIterator::Rewind() status_t AttributeIterator::GetNext(char *name, size_t *_length, uint32 *_type, - vnode_id *_id) + ino_t *_id) { // read attributes out of the small data section @@ -2484,7 +2485,7 @@ AttributeIterator::GetNext(char *name, size_t *_length, uint32 *_type, strncpy(name, item->Name(), B_FILE_NAME_LENGTH); *_type = item->Type(); *_length = item->NameSize(); - *_id = (vnode_id)fCurrentSmallData; + *_id = (ino_t)fCurrentSmallData; fCurrentSmallData = i; } @@ -2510,7 +2511,7 @@ AttributeIterator::GetNext(char *name, size_t *_length, uint32 *_type, if (fAttributes == NULL) { if (get_vnode(volume->ID(), volume->ToVnode(fInode->Attributes()), (void **)&fAttributes) != B_OK) { - FATAL(("get_vnode() failed in AttributeIterator::GetNext(vnode_id" + FATAL(("get_vnode() failed in AttributeIterator::GetNext(ino_t" " = %Ld,name = \"%s\")\n",fInode->ID(),name)); return B_ENTRY_NOT_FOUND; } @@ -2518,14 +2519,14 @@ AttributeIterator::GetNext(char *name, size_t *_length, uint32 *_type, BPlusTree *tree; if (fAttributes->GetTree(&tree) < B_OK || (fIterator = new TreeIterator(tree)) == NULL) { - FATAL(("could not get tree in AttributeIterator::GetNext(vnode_id" + FATAL(("could not get tree in AttributeIterator::GetNext(ino_t" " = %Ld,name = \"%s\")\n",fInode->ID(),name)); return B_ENTRY_NOT_FOUND; } } uint16 length; - vnode_id id; + ino_t id; status_t status = fIterator->GetNextEntry(name, &length, B_FILE_NAME_LENGTH, &id); if (status < B_OK) diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.h b/src/add-ons/kernel/file_systems/bfs/Inode.h index bf377feb92..0c351ec2bd 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.h +++ b/src/add-ons/kernel/file_systems/bfs/Inode.h @@ -35,14 +35,14 @@ enum inode_type { class Inode { public: - Inode(Volume *volume, vnode_id id); - Inode(Volume *volume, Transaction &transaction, vnode_id id, + Inode(Volume *volume, ino_t id); + Inode(Volume *volume, Transaction &transaction, ino_t id, mode_t mode, block_run &run); //Inode(CachedBlock *cached); ~Inode(); //bfs_inode *Node() const { return (bfs_inode *)fBlock; } - vnode_id ID() const { return fID; } + ino_t ID() const { return fID; } off_t BlockNumber() const { return fVolume->VnodeToBlock(fID); } ReadWriteLock &Lock() { return fLock; } @@ -138,10 +138,10 @@ class Inode { // create/remove inodes status_t Remove(Transaction &transaction, const char *name, - vnode_id *_id = NULL, bool isDirectory = false); + ino_t *_id = NULL, bool isDirectory = false); static status_t Create(Transaction &transaction, Inode *parent, const char *name, int32 mode, int openMode, uint32 type, - bool *_created = NULL, vnode_id *_id = NULL, Inode **_inode = NULL); + bool *_created = NULL, ino_t *_id = NULL, Inode **_inode = NULL); // index maintaining helper void UpdateOldSize() @@ -194,7 +194,7 @@ class Inode { private: ReadWriteLock fLock; Volume *fVolume; - vnode_id fID; + ino_t fID; BPlusTree *fTree; Inode *fAttributes; void *fCache; @@ -251,7 +251,7 @@ class NodeGetter : public CachedBlock { class Vnode { public: - Vnode(Volume *volume, vnode_id id) + Vnode(Volume *volume, ino_t id) : fVolume(volume), fID(id) @@ -290,7 +290,7 @@ class Vnode { private: Volume *fVolume; - vnode_id fID; + ino_t fID; }; @@ -300,7 +300,7 @@ class AttributeIterator { ~AttributeIterator(); status_t Rewind(); - status_t GetNext(char *name, size_t *length, uint32 *type, vnode_id *id); + status_t GetNext(char *name, size_t *length, uint32 *type, ino_t *id); private: friend class Chain; diff --git a/src/add-ons/kernel/file_systems/bfs/Volume.cpp b/src/add-ons/kernel/file_systems/bfs/Volume.cpp index af6e577f59..fbd185af10 100644 --- a/src/add-ons/kernel/file_systems/bfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Volume.cpp @@ -242,7 +242,7 @@ disk_super_block::Initialize(const char *diskName, off_t numBlocks, uint32 block // #pragma mark - -Volume::Volume(mount_id id) +Volume::Volume(dev_t id) : fID(id), fBlockAllocator(this), diff --git a/src/add-ons/kernel/file_systems/bfs/Volume.h b/src/add-ons/kernel/file_systems/bfs/Volume.h index eedc4de605..fd233b51af 100644 --- a/src/add-ons/kernel/file_systems/bfs/Volume.h +++ b/src/add-ons/kernel/file_systems/bfs/Volume.h @@ -1,6 +1,5 @@ -/* Volume - BFS super block, mounting, etc. - * - * Copyright 2001-2004, Axel Dörfler, axeld@pinc-software.de. +/* + * Copyright 2001-2007, Axel Dörfler, axeld@pinc-software.de. * This file may be used under the terms of the MIT License. */ #ifndef VOLUME_H @@ -27,7 +26,7 @@ enum volume_initialize_flags { class Volume { public: - Volume(mount_id id); + Volume(dev_t id); ~Volume(); status_t Mount(const char *device, uint32 flags); @@ -49,7 +48,7 @@ class Volume { vint32 &LogEnd() { return fLogEnd; } int Device() const { return fDevice; } - mount_id ID() const { return fID; } + dev_t ID() const { return fID; } const char *Name() const { return fSuperBlock.name; } off_t NumBlocks() const { return fSuperBlock.NumBlocks(); } @@ -70,7 +69,7 @@ class Volume { off_t ToVnode(block_run run) const { return ToBlock(run); } off_t ToVnode(off_t block) const { return block; } - off_t VnodeToBlock(vnode_id id) const { return (off_t)id; } + off_t VnodeToBlock(ino_t id) const { return (off_t)id; } status_t CreateIndicesRoot(Transaction &transaction); @@ -106,7 +105,7 @@ class Volume { static status_t Identify(int fd, disk_super_block *superBlock); protected: - mount_id fID; + dev_t fID; int fDevice; disk_super_block fSuperBlock; diff --git a/src/add-ons/kernel/file_systems/bfs/bfs_control.h b/src/add-ons/kernel/file_systems/bfs/bfs_control.h index 6d451df6ca..810537a2c8 100644 --- a/src/add-ons/kernel/file_systems/bfs/bfs_control.h +++ b/src/add-ons/kernel/file_systems/bfs/bfs_control.h @@ -1,10 +1,11 @@ +/* + * Copyright 2001-2007, Axel Dörfler, axeld@pinc-software.de + * This file may be used under the terms of the MIT License. + */ #ifndef BFS_CONTROL_H #define BFS_CONTROL_H -/* bfs_control - additional functionality exported via ioctl() -** -** Copyright 2001-2004, Axel Dörfler, axeld@pinc-software.de -** This file may be used under the terms of the OpenBeOS License. -*/ + +//! additional functionality exported via ioctl() #include "system_dependencies.h" @@ -29,7 +30,7 @@ struct check_control { uint32 magic; uint32 flags; char name[B_FILE_NAME_LENGTH]; - vnode_id inode; + ino_t inode; uint32 mode; uint32 errors; struct { diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index 929d037be0..945ae85414 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -104,8 +104,8 @@ bfs_free_identify_partition_cookie(partition_data *partition, void *_cookie) static status_t -bfs_mount(mount_id mountID, const char *device, uint32 flags, const char *args, - void **_data, vnode_id *_rootID) +bfs_mount(dev_t mountID, const char *device, uint32 flags, const char *args, + void **_data, ino_t *_rootID) { FUNCTION(); @@ -229,9 +229,9 @@ bfs_sync(void *_ns) */ static status_t -bfs_read_vnode(void *_ns, vnode_id id, void **_node, bool reenter) +bfs_read_vnode(void *_ns, ino_t id, void **_node, bool reenter) { - //FUNCTION_START(("vnode_id = %Ld\n", id)); + //FUNCTION_START(("ino_t = %Ld\n", id)); Volume *volume = (Volume *)_ns; // first inode may be after the log area, we don't go through @@ -444,7 +444,7 @@ bfs_get_file_map(fs_volume _fs, fs_vnode _node, off_t offset, size_t size, static status_t -bfs_lookup(void *_ns, void *_directory, const char *file, vnode_id *_vnodeID, int *_type) +bfs_lookup(void *_ns, void *_directory, const char *file, ino_t *_vnodeID, int *_type) { //FUNCTION_START(("file = %s\n", file)); if (_ns == NULL || _directory == NULL || file == NULL || _vnodeID == NULL) @@ -740,7 +740,7 @@ bfs_write_stat(void *_ns, void *_node, const struct stat *stat, uint32 mask) status_t bfs_create(void *_ns, void *_directory, const char *name, int openMode, int mode, - void **_cookie, vnode_id *_vnodeID) + void **_cookie, ino_t *_vnodeID) { FUNCTION_START(("name = \"%s\", perms = %d, openMode = %d\n", name, mode, openMode)); @@ -942,8 +942,8 @@ bfs_rename(void *_ns, void *_oldDir, const char *oldName, void *_newDir, const c // If we meet our inode on that way, we have to bail out. if (oldDirectory != newDirectory) { - vnode_id parent = volume->ToVnode(newDirectory->Parent()); - vnode_id root = volume->RootNode()->ID(); + ino_t parent = volume->ToVnode(newDirectory->Parent()); + ino_t root = volume->RootNode()->ID(); while (true) { if (parent == id) @@ -1357,7 +1357,7 @@ bfs_read_link(void *_ns, void *_node, char *buffer, size_t *_bufferSize) static status_t bfs_create_dir(void *_ns, void *_directory, const char *name, int mode, - vnode_id *_newVnodeID) + ino_t *_newVnodeID) { FUNCTION_START(("name = \"%s\", perms = %d\n", name, mode)); @@ -1466,7 +1466,7 @@ bfs_read_dir(void *_ns, void *_node, void *_cookie, struct dirent *dirent, RETURN_ERROR(B_BAD_VALUE); uint16 length; - vnode_id id; + ino_t id; status_t status = iterator->GetNextEntry(dirent->d_name, &length, bufferSize, &id); if (status == B_ENTRY_NOT_FOUND) { *_num = 0; diff --git a/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp b/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp index 376949d02f..e1c6184c6a 100644 --- a/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp @@ -76,24 +76,24 @@ enum attr_mode { class Volume { public: - Volume(mount_id id); + Volume(dev_t id); ~Volume(); status_t InitCheck(); - mount_id ID() const { return fID; } + dev_t ID() const { return fID; } uint32 DiscID() const { return fDiscID; } Inode &RootNode() const { return *fRootNode; } status_t Mount(const char* device); int Device() const { return fDevice; } - vnode_id GetNextNodeID() { return fNextID++; } + ino_t GetNextNodeID() { return fNextID++; } const char *Name() const { return fName; } status_t SetName(const char *name); Semaphore &Lock(); - Inode *Find(vnode_id id); + Inode *Find(ino_t id); Inode *Find(const char *name); Inode *FirstEntry() const { return fFirstEntry; } @@ -116,10 +116,10 @@ class Volume { Semaphore fLock; int fDevice; - mount_id fID; + dev_t fID; uint32 fDiscID; Inode *fRootNode; - vnode_id fNextID; + ino_t fNextID; char *fName; off_t fNumBlocks; @@ -160,7 +160,7 @@ class Inode { ~Inode(); status_t InitCheck(); - vnode_id ID() const { return fID; } + ino_t ID() const { return fID; } const char *Name() const { return fName; } status_t SetName(const char* name); @@ -206,7 +206,7 @@ class Inode { private: Inode *fNext; - vnode_id fID; + ino_t fID; int32 fType; char *fName; gid_t fGroupID; @@ -447,7 +447,7 @@ fill_stat_buffer(Volume *volume, Inode *inode, Attribute *attribute, // #pragma mark - Volume class -Volume::Volume(mount_id id) +Volume::Volume(dev_t id) : fLock("cdda"), fDevice(-1), @@ -655,7 +655,7 @@ Volume::_CreateNode(Inode *parent, const char *name, off_t start, off_t frames, Inode * -Volume::Find(vnode_id id) +Volume::Find(ino_t id) { for (Inode *inode = fFirstEntry; inode != NULL; inode = inode->Next()) { if (inode->ID() == id) @@ -1268,8 +1268,8 @@ cdda_free_identify_partition_cookie(partition_data *partition, void *_cookie) static status_t -cdda_mount(mount_id id, const char *device, uint32 flags, const char *args, - fs_volume *_volume, vnode_id *_rootVnodeID) +cdda_mount(dev_t id, const char *device, uint32 flags, const char *args, + fs_volume *_volume, ino_t *_rootVnodeID) { TRACE(("cdda_mount: entry\n")); @@ -1355,7 +1355,7 @@ cdda_sync(fs_volume fs) static status_t -cdda_lookup(fs_volume _volume, fs_vnode _dir, const char *name, vnode_id *_id, int *_type) +cdda_lookup(fs_volume _volume, fs_vnode _dir, const char *name, ino_t *_id, int *_type) { Volume *volume = (Volume *)_volume; status_t status; @@ -1398,7 +1398,7 @@ cdda_get_vnode_name(fs_volume _volume, fs_vnode _node, char *buffer, size_t buff static status_t -cdda_get_vnode(fs_volume _volume, vnode_id id, fs_vnode *_inode, bool reenter) +cdda_get_vnode(fs_volume _volume, ino_t id, fs_vnode *_inode, bool reenter) { Volume *volume = (Volume *)_volume; Inode *inode; diff --git a/src/add-ons/kernel/file_systems/dos/dir.c b/src/add-ons/kernel/file_systems/dos/dir.c index 17e370fbd5..8931405785 100644 --- a/src/add-ons/kernel/file_systems/dos/dir.c +++ b/src/add-ons/kernel/file_systems/dos/dir.c @@ -39,7 +39,7 @@ typedef struct dircookie { static CHECK_MAGIC(dircookie,struct dircookie, DIRCOOKIE_MAGIC) static status_t findfile(nspace *vol, vnode *dir, const char *file, - vnode_id *vnid, vnode **node, bool check_case, + ino_t *vnid, vnode **node, bool check_case, bool check_dups, bool *dups_exist); // private structure for returning data from _next_dirent_() @@ -205,7 +205,7 @@ _next_dirent_(struct diri *iter, struct _dirent_info_ *oinfo, char *filename, static status_t -get_next_dirent(nspace *vol, vnode *dir, struct diri *iter, vnode_id *vnid, +get_next_dirent(nspace *vol, vnode *dir, struct diri *iter, ino_t *vnid, char *filename, int len) { struct _dirent_info_ info; @@ -229,7 +229,7 @@ get_next_dirent(nspace *vol, vnode *dir, struct diri *iter, vnode_id *vnid, if (vnid) *vnid = dir->dir_vnid; } else { if (vnid) { - vnode_id loc = (IS_DATA_CLUSTER(info.cluster)) + ino_t loc = (IS_DATA_CLUSTER(info.cluster)) ? GENERATE_DIR_CLUSTER_VNID(dir->vnid, info.cluster) : GENERATE_DIR_INDEX_VNID(dir->vnid, info.sindex); bool added_to_vcache = false; @@ -320,7 +320,7 @@ check_dir_empty(nspace *vol, vnode *dir) status_t -findfile_case(nspace *vol, vnode *dir, const char *file, vnode_id *vnid, +findfile_case(nspace *vol, vnode *dir, const char *file, ino_t *vnid, vnode **node) { return findfile(vol, dir, file, vnid, node, true, false, NULL); @@ -328,7 +328,7 @@ findfile_case(nspace *vol, vnode *dir, const char *file, vnode_id *vnid, status_t -findfile_nocase(nspace *vol, vnode *dir, const char *file, vnode_id *vnid, +findfile_nocase(nspace *vol, vnode *dir, const char *file, ino_t *vnid, vnode **node) { return findfile(vol, dir, file, vnid, node, false, false, NULL); @@ -337,7 +337,7 @@ findfile_nocase(nspace *vol, vnode *dir, const char *file, vnode_id *vnid, status_t findfile_nocase_duplicates(nspace *vol, vnode *dir, const char *file, - vnode_id *vnid, vnode **node, bool *dups_exist) + ino_t *vnid, vnode **node, bool *dups_exist) { return findfile(vol, dir, file, vnid, node, false, true, dups_exist); } @@ -345,14 +345,14 @@ findfile_nocase_duplicates(nspace *vol, vnode *dir, const char *file, status_t findfile_case_duplicates(nspace *vol, vnode *dir, const char *file, - vnode_id *vnid, vnode **node, bool *dups_exist) + ino_t *vnid, vnode **node, bool *dups_exist) { return findfile(vol, dir, file, vnid, node, true, true, dups_exist); } static status_t -findfile(nspace *vol, vnode *dir, const char *file, vnode_id *vnid, +findfile(nspace *vol, vnode *dir, const char *file, ino_t *vnid, vnode **node, bool check_case, bool check_dups, bool *dups_exist) { /* Starting at the base, find the file in the subdir @@ -366,7 +366,7 @@ findfile(nspace *vol, vnode *dir, const char *file, vnode_id *vnid, any other case-insensitive matches. If there are, the dups_exist flag is set to true. */ int result = 0; - vnode_id found_vnid = 0; + ino_t found_vnid = 0; bool found_file = false; // dprintf("findfile: %s in %Lx, case %d dups %d\n", file, dir->vnid, check_case, check_dups); @@ -400,7 +400,7 @@ findfile(nspace *vol, vnode *dir, const char *file, vnode_id *vnid, while (1) { char filename[512]; - vnode_id _vnid; + ino_t _vnid; result = get_next_dirent(vol, dir, &diri, &_vnid, filename, 512); if (result != B_NO_ERROR) @@ -922,11 +922,11 @@ create_dir_entry(nspace *vol, vnode *dir, vnode *node, const char *name, status_t -dosfs_read_vnode(void *_vol, vnode_id vnid, void **_node, bool reenter) +dosfs_read_vnode(void *_vol, ino_t vnid, void **_node, bool reenter) { nspace *vol = (nspace*)_vol; int result = B_NO_ERROR; - vnode_id loc, dir_vnid; + ino_t loc, dir_vnid; vnode *entry; struct _dirent_info_ info; struct diri iter; @@ -1027,11 +1027,11 @@ dosfs_read_vnode(void *_vol, vnode_id vnid, void **_node, bool reenter) entry->st_size = count_clusters(vol,entry->cluster) * vol->sectors_per_cluster * vol->bytes_per_sector; } - if (entry->cluster) + if (entry->cluster) { entry->end_cluster = get_nth_fat_entry(vol, info.cluster, - (entry->st_size + vol->bytes_per_sector * vol->sectors_per_cluster - 1) / - vol->bytes_per_sector / vol->sectors_per_cluster - 1); - else + (entry->st_size + vol->bytes_per_sector * vol->sectors_per_cluster - 1) / + vol->bytes_per_sector / vol->sectors_per_cluster - 1); + } else entry->end_cluster = 0; entry->st_time = dos2time_t(info.time); #if TRACK_FILENAME @@ -1044,17 +1044,21 @@ dosfs_read_vnode(void *_vol, vnode_id vnid, void **_node, bool reenter) *_node = entry; -bi2:diri_free(&iter); -bi: if (!reenter) UNLOCK_VOL(vol); +bi2: + diri_free(&iter); +bi: + if (!reenter) + UNLOCK_VOL(vol); - if (result != B_OK) DPRINTF(0, ("dosfs_read_vnode (%s)\n", strerror(result))); + if (result != B_OK) + DPRINTF(0, ("dosfs_read_vnode (%s)\n", strerror(result))); return result; } status_t -dosfs_walk(void *_vol, void *_dir, const char *file, vnode_id *_vnid, int *_type) +dosfs_walk(void *_vol, void *_dir, const char *file, ino_t *_vnid, int *_type) { /* Starting at the base, find file in the subdir, and return path string and vnode id of file. */ diff --git a/src/add-ons/kernel/file_systems/dos/dir.h b/src/add-ons/kernel/file_systems/dos/dir.h index 361530049f..d1aa7acfa0 100644 --- a/src/add-ons/kernel/file_systems/dos/dir.h +++ b/src/add-ons/kernel/file_systems/dos/dir.h @@ -8,29 +8,29 @@ bool is_filename_legal(const char *name); status_t check_dir_empty(nspace *vol, vnode *dir); status_t findfile_case(nspace *vol, vnode *dir, const char *file, - vnode_id *vnid, vnode **node); + ino_t *vnid, vnode **node); status_t findfile_nocase(nspace *vol, vnode *dir, const char *file, - vnode_id *vnid, vnode **node); + ino_t *vnid, vnode **node); status_t findfile_nocase_duplicates(nspace *vol, vnode *dir, const char *file, - vnode_id *vnid, vnode **node, bool *dups_exist); + ino_t *vnid, vnode **node, bool *dups_exist); status_t findfile_case_duplicates(nspace *vol, vnode *dir, const char *file, - vnode_id *vnid, vnode **node, bool *dups_exist); + ino_t *vnid, vnode **node, bool *dups_exist); status_t erase_dir_entry(nspace *vol, vnode *node); status_t compact_directory(nspace *vol, vnode *dir); status_t create_volume_label(nspace *vol, const char name[11], uint32 *index); status_t create_dir_entry(nspace *vol, vnode *dir, vnode *node, const char *name, uint32 *ns, uint32 *ne); -status_t dosfs_read_vnode(void *_vol, vnode_id vnid, void **node, bool reenter); -status_t dosfs_walk(void *_vol, void *_dir, const char *file, - vnode_id *_vnid, int *_type); -status_t dosfs_access(void *_vol, void *_node, int mode); -status_t dosfs_readlink(void *_vol, void *_node, char *buf, size_t *bufsize); -status_t dosfs_opendir(void *_vol, void *_node, void **cookie); -status_t dosfs_readdir(void *_vol, void *_node, void *cookie, +status_t dosfs_read_vnode(void *_vol, ino_t vnid, void **node, bool reenter); +status_t dosfs_walk(void *_vol, void *_dir, const char *file, + ino_t *_vnid, int *_type); +status_t dosfs_access(void *_vol, void *_node, int mode); +status_t dosfs_readlink(void *_vol, void *_node, char *buf, size_t *bufsize); +status_t dosfs_opendir(void *_vol, void *_node, void **cookie); +status_t dosfs_readdir(void *_vol, void *_node, void *cookie, struct dirent *buf, size_t bufsize, uint32 *num); -status_t dosfs_rewinddir(void *_vol, void *_node, void *cookie); -status_t dosfs_closedir(void *_vol, void *_node, void *cookie); -status_t dosfs_free_dircookie(void *_vol, void *_node, void *cookie); +status_t dosfs_rewinddir(void *_vol, void *_node, void *cookie); +status_t dosfs_closedir(void *_vol, void *_node, void *cookie); +status_t dosfs_free_dircookie(void *_vol, void *_node, void *cookie); #endif diff --git a/src/add-ons/kernel/file_systems/dos/dlist.c b/src/add-ons/kernel/file_systems/dos/dlist.c index 0a09d4e9eb..8f39d8c989 100644 --- a/src/add-ons/kernel/file_systems/dos/dlist.c +++ b/src/add-ons/kernel/file_systems/dos/dlist.c @@ -35,13 +35,15 @@ TODO: #define DLIST_ENTRY_QUANTUM 0x20 #endif -status_t dlist_init(nspace *vol) + +status_t +dlist_init(nspace *vol) { DPRINTF(0, ("dlist_init called\n")); vol->dlist.entries = 0; vol->dlist.allocated = DLIST_ENTRY_QUANTUM; - vol->dlist.vnid_list = malloc(sizeof(vnode_id) * vol->dlist.allocated); + vol->dlist.vnid_list = malloc(sizeof(ino_t) * vol->dlist.allocated); if (vol->dlist.vnid_list == NULL) { vol->dlist.allocated = 0; dprintf("dlist_init: out of core\n"); @@ -51,7 +53,9 @@ status_t dlist_init(nspace *vol) return B_OK; } -status_t dlist_uninit(nspace *vol) + +status_t +dlist_uninit(nspace *vol) { DPRINTF(0, ("dlist_uninit called\n")); @@ -63,22 +67,24 @@ status_t dlist_uninit(nspace *vol) return B_OK; } -static status_t dlist_realloc(nspace *vol, uint32 allocate) + +static status_t +dlist_realloc(nspace *vol, uint32 allocate) { - vnode_id *vnid_list; + ino_t *vnid_list; DPRINTF(0, ("dlist_realloc %lx -> %lx\n", vol->dlist.allocated, allocate)); ASSERT(allocate != vol->dlist.allocated); ASSERT(allocate > vol->dlist.entries); - vnid_list = malloc(sizeof(vnode_id) * allocate); + vnid_list = malloc(sizeof(ino_t) * allocate); if (vnid_list == NULL) { dprintf("dlist_realloc: out of core\n"); return ENOMEM; } - memcpy(vnid_list, vol->dlist.vnid_list, sizeof(vnode_id) * vol->dlist.entries); + memcpy(vnid_list, vol->dlist.vnid_list, sizeof(ino_t) * vol->dlist.entries); free(vol->dlist.vnid_list); vol->dlist.vnid_list = vnid_list; vol->dlist.allocated = allocate; @@ -86,7 +92,9 @@ static status_t dlist_realloc(nspace *vol, uint32 allocate) return B_OK; } -status_t dlist_add(nspace *vol, vnode_id vnid) + +status_t +dlist_add(nspace *vol, ino_t vnid) { DPRINTF(0, ("dlist_add vnid %Lx\n", vnid)); @@ -103,7 +111,9 @@ status_t dlist_add(nspace *vol, vnode_id vnid) return B_OK; } -status_t dlist_remove(nspace *vol, vnode_id vnid) + +status_t +dlist_remove(nspace *vol, ino_t vnid) { uint32 i; @@ -125,7 +135,9 @@ status_t dlist_remove(nspace *vol, vnode_id vnid) return B_OK; } -vnode_id dlist_find(nspace *vol, uint32 cluster) + +ino_t +dlist_find(nspace *vol, uint32 cluster) { uint32 i; @@ -133,8 +145,8 @@ vnode_id dlist_find(nspace *vol, uint32 cluster) ASSERT(((cluster >= 2) && (cluster < vol->total_clusters + 2)) || (cluster == 1)); - for (i=0;idlist.entries;i++) { - vnode_id loc; + for (i = 0; i < vol->dlist.entries; i++) { + ino_t loc; if (vcache_vnid_to_loc(vol, vol->dlist.vnid_list[i], &loc) < B_OK) loc = vol->dlist.vnid_list[i]; @@ -148,14 +160,16 @@ vnode_id dlist_find(nspace *vol, uint32 cluster) return -1LL; } -void dlist_dump(nspace *vol) + +void +dlist_dump(nspace *vol) { uint32 i; dprintf("%lx/%lx dlist entries filled, QUANTUM = %x\n", vol->dlist.entries, vol->dlist.allocated, DLIST_ENTRY_QUANTUM); - for (i=0;idlist.entries;i++) + for (i = 0; i < vol->dlist.entries; i++) dprintf("%s %Lx", ((i == 0) ? "entries:" : ","), vol->dlist.vnid_list[i]); dprintf("\n"); diff --git a/src/add-ons/kernel/file_systems/dos/dlist.h b/src/add-ons/kernel/file_systems/dos/dlist.h index 55fb39d0f3..dbc1e1cf8d 100644 --- a/src/add-ons/kernel/file_systems/dos/dlist.h +++ b/src/add-ons/kernel/file_systems/dos/dlist.h @@ -7,9 +7,9 @@ status_t dlist_init(nspace *vol); status_t dlist_uninit(nspace *vol); -status_t dlist_add(nspace *vol, vnode_id vnid); -status_t dlist_remove(nspace *vol, vnode_id vnid); -vnode_id dlist_find(nspace *vol, uint32 cluster); +status_t dlist_add(nspace *vol, ino_t vnid); +status_t dlist_remove(nspace *vol, ino_t vnid); +ino_t dlist_find(nspace *vol, uint32 cluster); void dlist_dump(nspace *vol); diff --git a/src/add-ons/kernel/file_systems/dos/dosfs.c b/src/add-ons/kernel/file_systems/dos/dosfs.c index 801d918be5..83afc399cf 100644 --- a/src/add-ons/kernel/file_systems/dos/dosfs.c +++ b/src/add-ons/kernel/file_systems/dos/dosfs.c @@ -144,7 +144,7 @@ static int lock_removable_device(int fd, bool state) return ioctl(fd, B_SCSI_PREVENT_ALLOW, &state, sizeof(state)); } -static status_t mount_fat_disk(const char *path, mount_id nsid, +static status_t mount_fat_disk(const char *path, dev_t nsid, const int flags, nspace** newVol, int fs_flags, int op_sync_mode) { nspace *vol = NULL; @@ -665,8 +665,8 @@ dosfs_free_identify_partition_cookie(partition_data *partition, void *_cookie) static status_t -dosfs_mount(mount_id nsid, const char *device, uint32 flags, - const char *args, void **_data, vnode_id *_rootID) +dosfs_mount(dev_t nsid, const char *device, uint32 flags, + const char *args, void **_data, ino_t *_rootID) { int result; nspace *vol; diff --git a/src/add-ons/kernel/file_systems/dos/dosfs.h b/src/add-ons/kernel/file_systems/dos/dosfs.h index eabbf2702f..9ed2b273e9 100644 --- a/src/add-ons/kernel/file_systems/dos/dosfs.h +++ b/src/add-ons/kernel/file_systems/dos/dosfs.h @@ -19,9 +19,9 @@ typedef recursive_lock lock; /* for multiple reader/single writer locks */ #define READERS 100000 -/* Unfortunately, vnode_id's are defined as signed. This causes problems with - * programs (notably cp) that use the modulo of a vnode_id (or ino_t) as a - * hash function to index an array. This means the high bit of every vnode_id +/* Unfortunately, ino_t's are defined as signed. This causes problems with + * programs (notably cp) that use the modulo of a ino_t as a + * hash function to index an array. This means the high bit of every ino_t * is off-limits. Luckily, FAT32 is actually FAT28, so dosfs can make do with * only 63 bits. */ @@ -46,10 +46,10 @@ typedef recursive_lock lock; ((vnid) & INVALID_VNID_BITS_MASK)) #define GENERATE_DIR_INDEX_VNID(dircluster, index) \ - (DIR_INDEX_VNID_BITS | ((vnode_id)(dircluster) << 32) | (index)) + (DIR_INDEX_VNID_BITS | ((ino_t)(dircluster) << 32) | (index)) #define GENERATE_DIR_CLUSTER_VNID(dircluster, filecluster) \ - (DIR_CLUSTER_VNID_BITS | ((vnode_id)(dircluster) << 32) | (filecluster)) + (DIR_CLUSTER_VNID_BITS | ((ino_t)(dircluster) << 32) | (filecluster)) #define CLUSTER_OF_DIR_CLUSTER_VNID(vnid) \ ((uint32)((vnid) & 0xffffffff)) @@ -68,8 +68,8 @@ typedef recursive_lock lock; typedef struct vnode { uint32 magic; - vnode_id vnid; // self id - vnode_id dir_vnid; // parent vnode id (directory containing entry) + ino_t vnid; // self id + ino_t dir_vnid; // parent vnode id (directory containing entry) void *cache; // for file cache uint32 disk_image; // 0 = no, 1 = BEOS, 2 = IMAGE.BE @@ -116,7 +116,7 @@ struct vcache_entry; typedef struct _nspace { uint32 magic; - mount_id id; // ID passed in to fs_mount + dev_t id; // ID passed in to fs_mount int fd; // File descriptor char device[256]; uint32 flags; // see for modes @@ -148,7 +148,7 @@ typedef struct _nspace uint32 data_start; uint32 last_allocated; // last allocated cluster - vnode_id beos_vnid; // vnid of \BEOS directory + ino_t beos_vnid; // vnid of \BEOS directory bool respect_disk_image; int fs_flags; // flags for this mount @@ -157,16 +157,16 @@ typedef struct _nspace // vcache state struct { - sem_id vc_sem; - vnode_id cur_vnid; - uint32 cache_size; + sem_id vc_sem; + ino_t cur_vnid; + uint32 cache_size; struct vcache_entry **by_vnid, **by_loc; } vcache; struct { uint32 entries; uint32 allocated; - vnode_id *vnid_list; + ino_t *vnid_list; } dlist; } nspace; diff --git a/src/add-ons/kernel/file_systems/dos/file.c b/src/add-ons/kernel/file_systems/dos/file.c index d38fb5bb57..54eba201df 100644 --- a/src/add-ons/kernel/file_systems/dos/file.c +++ b/src/add-ons/kernel/file_systems/dos/file.c @@ -2,6 +2,7 @@ Copyright 1999-2001, Be Incorporated. All Rights Reserved. This file may be used under the terms of the Be Sample Code License. */ + #include #include #include @@ -125,7 +126,7 @@ dosfs_release_vnode(void *_vol, void *_node, bool reenter) return EINVAL; } - DPRINTF(0, ("dosfs_write_vnode (vnode_id %Lx)\n", ((vnode *)_node)->vnid)); + DPRINTF(0, ("dosfs_write_vnode (ino_t %Lx)\n", ((vnode *)_node)->vnid)); if ((vol->fs_flags & FS_FLAGS_OP_SYNC) && node->dirty) { LOCK_VOL(vol); @@ -758,7 +759,7 @@ dosfs_free_cookie(void *_vol, void *_node, void *_cookie) status_t dosfs_create(void *_vol, void *_dir, const char *name, int omode, - int perms, void **_cookie, vnode_id *vnid) + int perms, void **_cookie, ino_t *vnid) { nspace *vol = (nspace *)_vol; vnode *dir = (vnode *)_dir, *file; @@ -907,7 +908,7 @@ bi: if (result != B_OK) free(cookie); status_t -dosfs_mkdir(void *_vol, void *_dir, const char *name, int perms, vnode_id *_vnid) +dosfs_mkdir(void *_vol, void *_dir, const char *name, int perms, ino_t *_vnid) { nspace *vol = (nspace *)_vol; vnode *dir = (vnode *)_dir, dummy; @@ -1121,10 +1122,10 @@ dosfs_rename(void *_vol, void *_odir, const char *oldname, // don't move a directory into one of its children if (file->mode & FAT_SUBDIR) { - vnode_id vnid = ndir->vnid; + ino_t vnid = ndir->vnid; while (1) { vnode *dir; - vnode_id parent; + ino_t parent; if (vnid == file->vnid) { result = EINVAL; @@ -1347,7 +1348,7 @@ do_unlink(void *_vol, void *_dir, const char *name, bool is_file) status_t result = EINVAL; nspace *vol = (nspace *)_vol; vnode *dir = (vnode *)_dir, *file; - vnode_id vnid; + ino_t vnid; if (!strcmp(name, ".")) return EPERM; diff --git a/src/add-ons/kernel/file_systems/dos/file.h b/src/add-ons/kernel/file_systems/dos/file.h index 490fbae8ca..e61c64494a 100644 --- a/src/add-ons/kernel/file_systems/dos/file.h +++ b/src/add-ons/kernel/file_systems/dos/file.h @@ -12,23 +12,23 @@ status_t dosfs_release_vnode(void *_vol, void *_node, bool reenter); status_t dosfs_rstat(void *_vol, void *_node, struct stat *st); status_t dosfs_open(void *_vol, void *_node, int omode, void **cookie); status_t dosfs_read(void *_vol, void *_node, void *cookie, off_t pos, - void *buf, size_t *len); + void *buf, size_t *len); status_t dosfs_free_cookie(void *vol, void *node, void *cookie); status_t dosfs_close(void *vol, void *node, void *cookie); status_t dosfs_remove_vnode(void *vol, void *node, bool reenter); status_t dosfs_create(void *vol, void *dir, const char *name, - int omode, int perms, void **cookie, vnode_id *vnid); -status_t dosfs_mkdir(void *vol, void *dir, const char *name, int perms, vnode_id *_vnid); + int omode, int perms, void **cookie, ino_t *vnid); +status_t dosfs_mkdir(void *vol, void *dir, const char *name, int perms, ino_t *_vnid); status_t dosfs_rename(void *vol, void *olddir, const char *oldname, - void *newdir, const char *newname); + void *newdir, const char *newname); status_t dosfs_unlink(void *vol, void *dir, const char *name); status_t dosfs_rmdir(void *vol, void *dir, const char *name); status_t dosfs_wstat(void *vol, void *node, const struct stat *st, uint32 mask); status_t dosfs_write(void *vol, void *node, void *cookie, off_t pos, - const void *buf, size_t *len); + const void *buf, size_t *len); status_t dosfs_get_file_map(void *fs, void *node, off_t pos, size_t reqLen, - struct file_io_vec *vecs, size_t *_count); + struct file_io_vec *vecs, size_t *_count); bool dosfs_can_page(fs_volume _fs, fs_vnode _v, fs_cookie _cookie); status_t dosfs_read_pages(fs_volume _fs, fs_vnode _node, fs_cookie _cookie, off_t pos, const iovec *vecs, size_t count, size_t *_numBytes, bool reenter); diff --git a/src/add-ons/kernel/file_systems/dos/vcache.c b/src/add-ons/kernel/file_systems/dos/vcache.c index 8fa9934ee4..51073cf114 100644 --- a/src/add-ons/kernel/file_systems/dos/vcache.c +++ b/src/add-ons/kernel/file_systems/dos/vcache.c @@ -62,8 +62,8 @@ purpose. #include "util.h" struct vcache_entry { - vnode_id vnid; /* originally reported vnid */ - vnode_id loc; /* where the file is now */ + ino_t vnid; /* originally reported vnid */ + ino_t loc; /* where the file is now */ struct vcache_entry *next_vnid; /* next entry in vnid hash table */ struct vcache_entry *next_loc; /* next entry in location hash table */ }; @@ -147,7 +147,7 @@ status_t uninit_vcache(nspace *vol) return 0; } -vnode_id generate_unique_vnid(nspace *vol) +ino_t generate_unique_vnid(nspace *vol) { DPRINTF(0, ("generate_unique_vnid\n")); /* only one thread per volume will be in here at any given time anyway @@ -155,7 +155,7 @@ vnode_id generate_unique_vnid(nspace *vol) return vol->vcache.cur_vnid++; } -static status_t _add_to_vcache_(nspace *vol, vnode_id vnid, vnode_id loc) +static status_t _add_to_vcache_(nspace *vol, ino_t vnid, ino_t loc) { int hash1 = hash(vnid), hash2 = hash(loc); struct vcache_entry *e, *c, *p; @@ -205,7 +205,7 @@ static status_t _add_to_vcache_(nspace *vol, vnode_id vnid, vnode_id loc) return B_OK; } -static status_t _remove_from_vcache_(nspace *vol, vnode_id vnid) +static status_t _remove_from_vcache_(nspace *vol, ino_t vnid) { int hash1 = hash(vnid), hash2; struct vcache_entry *c, *p, *e; @@ -252,7 +252,7 @@ static status_t _remove_from_vcache_(nspace *vol, vnode_id vnid) return 0; } -static struct vcache_entry *_find_vnid_in_vcache_(nspace *vol, vnode_id vnid) +static struct vcache_entry *_find_vnid_in_vcache_(nspace *vol, ino_t vnid) { int hash1 = hash(vnid); struct vcache_entry *c; @@ -268,7 +268,7 @@ static struct vcache_entry *_find_vnid_in_vcache_(nspace *vol, vnode_id vnid) return c; } -static struct vcache_entry *_find_loc_in_vcache_(nspace *vol, vnode_id loc) +static struct vcache_entry *_find_loc_in_vcache_(nspace *vol, ino_t loc) { int hash2 = hash(loc); struct vcache_entry *c; @@ -284,7 +284,7 @@ static struct vcache_entry *_find_loc_in_vcache_(nspace *vol, vnode_id loc) return c; } -status_t add_to_vcache(nspace *vol, vnode_id vnid, vnode_id loc) +status_t add_to_vcache(nspace *vol, ino_t vnid, ino_t loc) { status_t result; @@ -297,7 +297,7 @@ status_t add_to_vcache(nspace *vol, vnode_id vnid, vnode_id loc) } /* XXX: do this in a smarter fashion */ -static status_t _update_loc_in_vcache_(nspace *vol, vnode_id vnid, vnode_id loc) +static status_t _update_loc_in_vcache_(nspace *vol, ino_t vnid, ino_t loc) { status_t result; @@ -308,7 +308,7 @@ static status_t _update_loc_in_vcache_(nspace *vol, vnode_id vnid, vnode_id loc) return result; } -status_t remove_from_vcache(nspace *vol, vnode_id vnid) +status_t remove_from_vcache(nspace *vol, ino_t vnid) { status_t result; @@ -320,7 +320,7 @@ status_t remove_from_vcache(nspace *vol, vnode_id vnid) return result; } -status_t vcache_vnid_to_loc(nspace *vol, vnode_id vnid, vnode_id *loc) +status_t vcache_vnid_to_loc(nspace *vol, ino_t vnid, ino_t *loc) { struct vcache_entry *e; @@ -335,7 +335,7 @@ status_t vcache_vnid_to_loc(nspace *vol, vnode_id vnid, vnode_id *loc) return (e) ? B_OK : ENOENT; } -status_t vcache_loc_to_vnid(nspace *vol, vnode_id loc, vnode_id *vnid) +status_t vcache_loc_to_vnid(nspace *vol, ino_t loc, ino_t *vnid) { struct vcache_entry *e; @@ -350,7 +350,7 @@ status_t vcache_loc_to_vnid(nspace *vol, vnode_id loc, vnode_id *vnid) return (e) ? B_OK : ENOENT; } -status_t vcache_set_entry(nspace *vol, vnode_id vnid, vnode_id loc) +status_t vcache_set_entry(nspace *vol, ino_t vnid, ino_t loc) { struct vcache_entry *e; status_t result = B_OK; @@ -400,7 +400,7 @@ int debug_dfvnid(int argc, char **argv) return B_OK; for (i=2;i loc %Lx @ %p\n", vnid, e->loc, e); @@ -412,7 +412,9 @@ int debug_dfvnid(int argc, char **argv) return B_OK; } -int debug_dfloc(int argc, char **argv) + +int +debug_dfloc(int argc, char **argv) { int i; nspace *vol; @@ -426,8 +428,8 @@ int debug_dfloc(int argc, char **argv) if (vol == NULL) return B_OK; - for (i=2;i vnid %Lx @ %p\n", loc, e->vnid, e); diff --git a/src/add-ons/kernel/file_systems/dos/vcache.h b/src/add-ons/kernel/file_systems/dos/vcache.h index 25c072ba5f..fe73db8d85 100644 --- a/src/add-ons/kernel/file_systems/dos/vcache.h +++ b/src/add-ons/kernel/file_systems/dos/vcache.h @@ -10,14 +10,14 @@ void dump_vcache(nspace *vol); status_t init_vcache(nspace *vol); status_t uninit_vcache(nspace *vol); -vnode_id generate_unique_vnid(nspace *vol); +ino_t generate_unique_vnid(nspace *vol); -status_t add_to_vcache(nspace *vol, vnode_id vnid, vnode_id loc); -status_t remove_from_vcache(nspace *vol, vnode_id vnid); -status_t vcache_vnid_to_loc(nspace *vol, vnode_id vnid, vnode_id *loc); -status_t vcache_loc_to_vnid(nspace *vol, vnode_id loc, vnode_id *vnid); +status_t add_to_vcache(nspace *vol, ino_t vnid, ino_t loc); +status_t remove_from_vcache(nspace *vol, ino_t vnid); +status_t vcache_vnid_to_loc(nspace *vol, ino_t vnid, ino_t *loc); +status_t vcache_loc_to_vnid(nspace *vol, ino_t loc, ino_t *vnid); -status_t vcache_set_entry(nspace *vol, vnode_id vnid, vnode_id loc); +status_t vcache_set_entry(nspace *vol, ino_t vnid, ino_t loc); #define find_vnid_in_vcache(vol,vnid) vcache_vnid_to_loc(vol,vnid,NULL) #define find_loc_in_vcache(vol,loc) vcache_loc_to_vnid(vol,loc,NULL) diff --git a/src/add-ons/kernel/file_systems/googlefs/fsproto.h b/src/add-ons/kernel/file_systems/googlefs/fsproto.h index f0d6421275..c368607148 100644 --- a/src/add-ons/kernel/file_systems/googlefs/fsproto.h +++ b/src/add-ons/kernel/file_systems/googlefs/fsproto.h @@ -14,7 +14,6 @@ #include typedef dev_t nspace_id; -typedef ino_t vnode_id; /* UGLY UGLY UGLY */ #ifndef _DRIVERS_H @@ -63,18 +62,18 @@ typedef struct selectsync selectsync; struct attr_info; struct index_info; -typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node); +typedef int op_read_vnode(void *ns, ino_t vnid, char r, void **node); typedef int op_write_vnode(void *ns, void *node, char r); typedef int op_remove_vnode(void *ns, void *node, char r); typedef int op_secure_vnode(void *ns, void *node); typedef int op_walk(void *ns, void *base, const char *file, char **newpath, - vnode_id *vnid); + ino_t *vnid); typedef int op_access(void *ns, void *node, int mode); typedef int op_create(void *ns, void *dir, const char *name, - int omode, int perms, vnode_id *vnid, void **cookie); + int omode, int perms, ino_t *vnid, void **cookie); typedef int op_mkdir(void *ns, void *dir, const char *name, int perms); typedef int op_symlink(void *ns, void *dir, const char *name, const char *path); @@ -119,7 +118,7 @@ typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event, typedef int op_initialize(const char *devname, void *parms, size_t len); typedef int op_mount(nspace_id nsid, const char *devname, ulong flags, - void *parms, size_t len, void **data, vnode_id *vnid); + void *parms, size_t len, void **data, ino_t *vnid); typedef int op_unmount(void *ns); typedef int op_sync(void *ns); typedef int op_rfsstat(void *ns, struct fs_info *); @@ -228,20 +227,20 @@ extern _IMPEXP_KERNEL int new_path(const char *path, char **copy); extern _IMPEXP_KERNEL void free_path(char *p); extern _IMPEXP_KERNEL int notify_listener(int op, nspace_id nsid, - vnode_id vnida, vnode_id vnidb, - vnode_id vnidc, const char *name); + ino_t vnida, ino_t vnidb, + ino_t vnidc, const char *name); extern _IMPEXP_KERNEL void notify_select_event(selectsync *sync, uint32 ref); extern _IMPEXP_KERNEL int send_notification(port_id port, long token, ulong what, long op, nspace_id nsida, - nspace_id nsidb, vnode_id vnida, - vnode_id vnidb, vnode_id vnidc, + nspace_id nsidb, ino_t vnida, + ino_t vnidb, ino_t vnidc, const char *name); -extern _IMPEXP_KERNEL int get_vnode(nspace_id nsid, vnode_id vnid, void **data); -extern _IMPEXP_KERNEL int put_vnode(nspace_id nsid, vnode_id vnid); -extern _IMPEXP_KERNEL int new_vnode(nspace_id nsid, vnode_id vnid, void *data); -extern _IMPEXP_KERNEL int remove_vnode(nspace_id nsid, vnode_id vnid); -extern _IMPEXP_KERNEL int unremove_vnode(nspace_id nsid, vnode_id vnid); -extern _IMPEXP_KERNEL int is_vnode_removed(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int get_vnode(nspace_id nsid, ino_t vnid, void **data); +extern _IMPEXP_KERNEL int put_vnode(nspace_id nsid, ino_t vnid); +extern _IMPEXP_KERNEL int new_vnode(nspace_id nsid, ino_t vnid, void *data); +extern _IMPEXP_KERNEL int remove_vnode(nspace_id nsid, ino_t vnid); +extern _IMPEXP_KERNEL int unremove_vnode(nspace_id nsid, ino_t vnid); +extern _IMPEXP_KERNEL int is_vnode_removed(nspace_id nsid, ino_t vnid); extern _EXPORT vnode_ops fs_entry; diff --git a/src/add-ons/kernel/file_systems/googlefs/googlefs.c b/src/add-ons/kernel/file_systems/googlefs/googlefs.c index 5e8d26bd83..d190e9316d 100644 --- a/src/add-ons/kernel/file_systems/googlefs/googlefs.c +++ b/src/add-ons/kernel/file_systems/googlefs/googlefs.c @@ -50,9 +50,9 @@ extern struct attr_entry mailto_me_bookmark_attrs[]; extern char *readmestr; -static int googlefs_create_gen(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, vnode_id *vnid, fs_node **node, struct attr_entry *iattrs, bool mkdir, bool uniq); +static int googlefs_create_gen(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, ino_t *vnid, fs_node **node, struct attr_entry *iattrs, bool mkdir, bool uniq); -static void fill_default_stat(struct stat *st, nspace_id nsid, vnode_id vnid, mode_t mode) +static void fill_default_stat(struct stat *st, nspace_id nsid, ino_t vnid, mode_t mode) { time_t tm = time(NULL); st->st_dev = nsid; @@ -109,10 +109,10 @@ err: #ifdef __HAIKU__ int googlefs_mount(nspace_id nsid, const char *devname, uint32 flags, - const char *parms, fs_nspace **data, vnode_id *vnid) + const char *parms, fs_nspace **data, ino_t *vnid) #else int googlefs_mount(nspace_id nsid, const char *devname, ulong flags, - const char *parms, size_t len, fs_nspace **data, vnode_id *vnid) + const char *parms, size_t len, fs_nspace **data, ino_t *vnid) #endif { fs_nspace *ns; @@ -214,7 +214,7 @@ int googlefs_unmount(fs_nspace *ns) return B_OK; } -static int compare_fs_node_by_vnid(fs_node *node, vnode_id *id) +static int compare_fs_node_by_vnid(fs_node *node, ino_t *id) { return !(node->vnid == *id); } @@ -262,9 +262,9 @@ int googlefs_remove_vnode(fs_nspace *ns, fs_node *node, char r) } #ifdef __HAIKU__ -int googlefs_read_vnode(fs_nspace *ns, vnode_id vnid, fs_node **node, char r) +int googlefs_read_vnode(fs_nspace *ns, ino_t vnid, fs_node **node, char r) #else -int googlefs_read_vnode(fs_nspace *ns, vnode_id vnid, char r, fs_node **node) +int googlefs_read_vnode(fs_nspace *ns, ino_t vnid, char r, fs_node **node) #endif { fs_node *n; @@ -321,9 +321,9 @@ int googlefs_get_vnode_name(fs_nspace *ns, fs_node *node, char *buffer, size_t l #endif #ifdef __HAIKU__ -int googlefs_walk(fs_nspace *ns, fs_node *base, const char *file, vnode_id *vnid, int *type) +int googlefs_walk(fs_nspace *ns, fs_node *base, const char *file, ino_t *vnid, int *type) #else -int googlefs_walk(fs_nspace *ns, fs_node *base, const char *file, char **newpath, vnode_id *vnid) +int googlefs_walk(fs_nspace *ns, fs_node *base, const char *file, char **newpath, ino_t *vnid) #endif { fs_node *n, *dummy; @@ -658,7 +658,7 @@ int googlefs_wfsstat(fs_nspace *ns, struct fs_info *info, long mask) * @param mkdir create a directory instead of a file * @param uniq choose an unique name, appending a number if required */ -static int googlefs_create_gen(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, vnode_id *vnid, fs_node **node, struct attr_entry *iattrs, bool mkdir, bool uniq) +static int googlefs_create_gen(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, ino_t *vnid, fs_node **node, struct attr_entry *iattrs, bool mkdir, bool uniq) { char newname[GOOGLEFS_NAME_LEN]; status_t err; @@ -760,7 +760,7 @@ done: return err; } -int googlefs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, vnode_id *vnid, fs_file_cookie **cookie) +int googlefs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, ino_t *vnid, fs_file_cookie **cookie) { status_t err; fs_node *n; diff --git a/src/add-ons/kernel/file_systems/googlefs/googlefs.h b/src/add-ons/kernel/file_systems/googlefs/googlefs.h index a3526441ce..17931fcff1 100644 --- a/src/add-ons/kernel/file_systems/googlefs/googlefs.h +++ b/src/add-ons/kernel/file_systems/googlefs/googlefs.h @@ -66,7 +66,7 @@ struct fs_node struct fs_file_cookie *opened; /* opened on this node */ char name[GOOGLEFS_NAME_LEN]; - vnode_id vnid; + ino_t vnid; lock l; int is_perm:1; /* don't delete on last close */ @@ -87,7 +87,7 @@ struct vnidpool; struct fs_nspace { nspace_id nsid; - vnode_id rootid; + ino_t rootid; struct vnidpool *vnids; struct fs_node *root; /* fast access for stat time change */ struct fs_node *nodes; @@ -118,7 +118,7 @@ typedef struct fs_file_cookie fs_file_cookie; #define fs_attr_dir_cookie fs_file_cookie #define fs_query_cookie fs_file_cookie -vnode_id new_vnid(fs_nspace *ns); +ino_t new_vnid(fs_nspace *ns); int googlefs_free_vnode(fs_nspace *ns, fs_node *node); int googlefs_event(fs_nspace *ns, fs_node *node, int flags); diff --git a/src/add-ons/kernel/file_systems/googlefs/vnidpool.c b/src/add-ons/kernel/file_systems/googlefs/vnidpool.c index e7e9027a83..92f5954c66 100644 --- a/src/add-ons/kernel/file_systems/googlefs/vnidpool.c +++ b/src/add-ons/kernel/file_systems/googlefs/vnidpool.c @@ -52,7 +52,7 @@ status_t vnidpool_free(struct vnidpool *pool) { return B_OK; } -status_t vnidpool_get(struct vnidpool *pool, vnode_id *vnid) +status_t vnidpool_get(struct vnidpool *pool, ino_t *vnid) { status_t err = B_ERROR; uint32 i; @@ -76,7 +76,7 @@ status_t vnidpool_get(struct vnidpool *pool, vnode_id *vnid) return err; } -status_t vnidpool_put(struct vnidpool *pool, vnode_id vnid) +status_t vnidpool_put(struct vnidpool *pool, ino_t vnid) { status_t err = B_ERROR; uint32 i; diff --git a/src/add-ons/kernel/file_systems/googlefs/vnidpool.h b/src/add-ons/kernel/file_systems/googlefs/vnidpool.h index c4c8521dd6..e64530ae78 100644 --- a/src/add-ons/kernel/file_systems/googlefs/vnidpool.h +++ b/src/add-ons/kernel/file_systems/googlefs/vnidpool.h @@ -5,14 +5,14 @@ typedef struct vnidpool { lock lock; - vnode_id nextvnid; + ino_t nextvnid; uint32 *bitmap; size_t bmsize; } vnidpool; status_t vnidpool_alloc(struct vnidpool **pool, size_t size); status_t vnidpool_free(struct vnidpool *pool); -status_t vnidpool_get(struct vnidpool *pool, vnode_id *vnid); -status_t vnidpool_put(struct vnidpool *pool, vnode_id vnid); +status_t vnidpool_get(struct vnidpool *pool, ino_t *vnid); +status_t vnidpool_put(struct vnidpool *pool, ino_t vnid); #endif /* _VNIDPOOL_H */ diff --git a/src/add-ons/kernel/file_systems/iso9660/iso.c b/src/add-ons/kernel/file_systems/iso9660/iso.c index 4564f4c244..f8c94944b7 100644 --- a/src/add-ons/kernel/file_systems/iso9660/iso.c +++ b/src/add-ons/kernel/file_systems/iso9660/iso.c @@ -1,31 +1,29 @@ /* -** Copyright 1999, Be Incorporated. All Rights Reserved. -** This file may be used under the terms of the Be Sample Code License. -** -** Copyright 2001, pinc Software. All Rights Reserved. -** -** iso9960/multi-session -** 2001-03-11: added multi-session support, axeld. -*/ + * Copyright 1999, Be Incorporated. All Rights Reserved. + * This file may be used under the terms of the Be Sample Code License. + * + * Copyright 2001, pinc Software. All Rights Reserved. + */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "rock.h" #include "iso.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + //#define TRACE_ISO9660 1 #if TRACE_ISO9660 # define TRACE(x) dprintf x diff --git a/src/add-ons/kernel/file_systems/iso9660/iso.h b/src/add-ons/kernel/file_systems/iso9660/iso.h index 8ff2c050a0..d06cfb22e1 100644 --- a/src/add-ons/kernel/file_systems/iso9660/iso.h +++ b/src/add-ons/kernel/file_systems/iso9660/iso.h @@ -1,21 +1,23 @@ /* -** Copyright 1999, Be Incorporated. All Rights Reserved. -** This file may be used under the terms of the Be Sample Code License. -** -** Copyright 2001, pinc Software. All Rights Reserved. -*/ - + * Copyright 1999, Be Incorporated. All Rights Reserved. + * This file may be used under the terms of the Be Sample Code License. + * + * Copyright 2001, pinc Software. All Rights Reserved. + */ #ifndef _ISO_H #define _ISO_H + +#include "lock.h" + +#include +#include + #include #include -#include -#include "lock.h" #include #include -#include // Size of primary volume descriptor for ISO9660 #define ISO_PVD_SIZE 882 @@ -23,8 +25,7 @@ // ISO structure has both msb and lsb first data. These let you do a // compile-time switch for different platforms. -enum -{ +enum { LSB_DATA = 0, MSB_DATA }; @@ -32,16 +33,15 @@ enum // This defines the data format for the platform we are compiling // for. #if BYTE_ORDER == __LITTLE_ENDIAN -#define FS_DATA_FORMAT LSB_DATA +# define FS_DATA_FORMAT LSB_DATA #else -#define FS_DATA_FORMAT MSB_DATA +# define FS_DATA_FORMAT MSB_DATA #endif // ISO pdf file spec I read appears to be WRONG about the date format. See // www.alumni.caltech.edu/~pje/iso9660.html, definition there seems // to match. -typedef struct ISOVolDate -{ +typedef struct ISOVolDate { char year[5]; char month[3]; char day[3]; @@ -52,8 +52,7 @@ typedef struct ISOVolDate int8 offsetGMT; } ISOVolDate; -typedef struct ISORecDate -{ +typedef struct ISORecDate { uint8 year; // Year - 1900 uint8 month; uint8 date; @@ -64,8 +63,7 @@ typedef struct ISORecDate } ISORecDate; /* This next section is data structure to hold the data found in the rock ridge extensions. */ -typedef struct RRAttr -{ +typedef struct RRAttr { char* slName; struct stat stat[2]; uint8 nmVer; @@ -84,11 +82,10 @@ typedef struct RRAttr fs_write_vnode (somewhat of a misnomer) where you should deallocate the struct. */ -typedef struct vnode -{ +typedef struct vnode { /* Most drivers will probably want the first things defined here. */ - vnode_id id; - vnode_id parID; // parent vnode ID. + ino_t id; + ino_t parID; // parent vnode ID. void *cache; // for file cache // End of members other drivers will definitely want. @@ -124,8 +121,7 @@ typedef struct vnode } vnode; // These go with the flags member of the nspace struct. -enum -{ +enum { ISO_ISHIDDEN = 0, ISO_ISDIR = 2, ISO_ISASSOCFILE = 4, @@ -144,8 +140,7 @@ enum need to determine where you are at in reading the directory entries, incremented every time readdir is called, until finally the end is reached, when readdir returns NULL. */ -typedef struct dircookie -{ +typedef struct dircookie { off_t startBlock; off_t block; // Current block off_t pos; // Position within block. @@ -158,8 +153,7 @@ typedef struct dircookie cookie function is called. For ISO, we didn't need one. */ -typedef struct attrfilemap -{ +typedef struct attrfilemap { char *name; off_t offset; } attrfilemap; @@ -169,10 +163,9 @@ typedef struct attrfilemap global information you need. You'll need to change this struct to suit your purposes. */ -typedef struct nspace -{ +typedef struct nspace { // Start of members other drivers will definitely want. - mount_id id; // ID passed in to fs_mount + dev_t id; // ID passed in to fs_mount int fd; // File descriptor int fdOfSession; // File descriptor of the (mounted) session //unsigned int blockSize; // usually need this, but it's part of ISO @@ -186,7 +179,7 @@ typedef struct nspace // attribute extensions int32 readAttributes; attrfilemap *attrFileMap; - vnode_id attributesID; + ino_t attributesID; // JOLIET extension: joliet_level for this volume uint8 joliet_level; @@ -240,4 +233,4 @@ int ConvertRecDate(ISORecDate* inDate, time_t* outDate); } #endif -#endif +#endif /* _ISO_H */ diff --git a/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp b/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp index 0d92d4a9f2..8f3acd44b7 100644 --- a/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp @@ -1,12 +1,15 @@ /* -** Copyright 1999, Be Incorporated. All Rights Reserved. -** This file may be used under the terms of the Be Sample Code License. -** -** Copyright 2001, pinc Software. All Rights Reserved. -** -** iso9960/multi-session, 1.0.0 -** 2001-03-11: added multi-session support, axeld. -*/ + * Copyright 1999, Be Incorporated. All Rights Reserved. + * This file may be used under the terms of the Be Sample Code License. + * + * Copyright 2001, pinc Software. All Rights Reserved. + * + * iso9960/multi-session, 1.0.0 + */ + + +#include "iso.h" +#include "iso9660.h" #include #include @@ -33,9 +36,6 @@ #include -#include "iso.h" -#include "iso9660.h" - //#define TRACE_ISO9660 1 #if TRACE_ISO9660 # define TRACE(x) dprintf x @@ -45,51 +45,51 @@ /* Start of fundamental (read-only) required functions */ -static status_t fs_mount(mount_id mountID, const char *device, uint32 flags, - const char *args, void **_data, vnode_id *_rootID); -static status_t fs_unmount(void *ns); +static status_t fs_mount(dev_t mountID, const char *device, uint32 flags, + const char *args, void **_data, ino_t *_rootID); +static status_t fs_unmount(void *ns); -static status_t fs_get_vnode_name(void *_ns, void *_node, - char *buffer, size_t bufferSize); -static status_t fs_walk(void *_ns, void *_base, const char *file, - vnode_id *_vnodeID, int *_type); +static status_t fs_get_vnode_name(void *_ns, void *_node, + char *buffer, size_t bufferSize); +static status_t fs_walk(void *_ns, void *_base, const char *file, + ino_t *_vnodeID, int *_type); -static status_t fs_read_vnode(void *_ns, vnode_id vnid, void **node, bool reenter); -static status_t fs_release_vnode(void *_ns, void *_node, bool reenter); -static status_t fs_get_file_map(fs_volume _fs, fs_vnode _node, off_t offset, size_t size, - struct file_io_vec *vecs, size_t *_count); -static status_t fs_read_stat(void *_ns, void *_node, struct stat *st); -static status_t fs_open(void *_ns, void *_node, int omode, void **cookie); -static status_t fs_read(void *_ns, void *_node, void *cookie, off_t pos, - void *buf, size_t *len); +static status_t fs_read_vnode(void *_ns, ino_t vnid, void **node, bool reenter); +static status_t fs_release_vnode(void *_ns, void *_node, bool reenter); +static status_t fs_get_file_map(fs_volume _fs, fs_vnode _node, off_t offset, size_t size, + struct file_io_vec *vecs, size_t *_count); +static status_t fs_read_stat(void *_ns, void *_node, struct stat *st); +static status_t fs_open(void *_ns, void *_node, int omode, void **cookie); +static status_t fs_read(void *_ns, void *_node, void *cookie, off_t pos, + void *buf, size_t *len); /// fs_free_cookie - free cookie for file created in open. -static status_t fs_free_cookie(void *ns, void *node, void *cookie); -static status_t fs_close(void *ns, void *node, void *cookie); +static status_t fs_free_cookie(void *ns, void *node, void *cookie); +static status_t fs_close(void *ns, void *node, void *cookie); // fs_access - checks permissions for access. -static status_t fs_access(void *_ns, void *_node, int mode); +static status_t fs_access(void *_ns, void *_node, int mode); // fs_opendir - creates fs-specific "cookie" struct that can tell where // we are at in the directory list. -static status_t fs_open_dir(void* _ns, void* _node, void** cookie); +static status_t fs_open_dir(void* _ns, void* _node, void** cookie); // fs_readdir - read 1 or more dirents, keep state in cookie, return // 0 when no more entries. -static status_t fs_read_dir(void *_ns, void *_node, void *cookie, struct dirent *buf, - size_t bufsize, uint32 *_num); +static status_t fs_read_dir(void *_ns, void *_node, void *cookie, struct dirent *buf, + size_t bufsize, uint32 *_num); // fs_rewinddir - set cookie to represent beginning of directory, so // later fs_readdir calls start at beginning. -static status_t fs_rewind_dir(void *_ns, void *_node, void *cookie); +static status_t fs_rewind_dir(void *_ns, void *_node, void *cookie); // fs_closedir - Do whatever you need to to close a directory (sometimes // nothing), but DON'T free the cookie! -static status_t fs_close_dir(void *_ns, void *_node, void *cookie); +static status_t fs_close_dir(void *_ns, void *_node, void *cookie); // fs_free_dircookie - Free the fs-specific cookie struct -static status_t fs_free_dir_cookie(void *_ns, void *_node, void *cookie); +static status_t fs_free_dir_cookie(void *_ns, void *_node, void *cookie); // fs_rfsstat - Fill in fs_info struct for device. -static status_t fs_read_fs_stat(void *_ns, struct fs_info *); +static status_t fs_read_fs_stat(void *_ns, struct fs_info *); // fs_readlink - Read in the name of a symbolic link. -static status_t fs_read_link(void *_ns, void *_node, char *buf, size_t *bufsize); +static status_t fs_read_link(void *_ns, void *_node, char *buf, size_t *bufsize); // #pragma mark - Scanning @@ -142,8 +142,8 @@ fs_free_identify_partition_cookie(partition_data *partition, void *_cookie) static status_t -fs_mount(mount_id mountID, const char *device, uint32 flags, - const char *args, void **_data, vnode_id *_rootID) +fs_mount(dev_t mountID, const char *device, uint32 flags, + const char *args, void **_data, ino_t *_rootID) { /* Kernel passes in nspace_id, (representing a disk or partition?) @@ -191,7 +191,7 @@ fs_mount(mount_id mountID, const char *device, uint32 flags, // If it is ISO … if (result == B_NO_ERROR) { - //vnode_id rootID = vol->rootDirRec.startLBN[FS_DATA_FORMAT]; + //ino_t rootID = vol->rootDirRec.startLBN[FS_DATA_FORMAT]; //*vnid = rootID; *_rootID = ISO_ROOTNODE_ID; *_data = (void*)vol; @@ -299,7 +299,7 @@ fs_get_vnode_name(void *ns, void *_node, char *buffer, size_t bufferSize) it for the kernel. */ static status_t -fs_walk(void *_ns, void *base, const char *file, vnode_id *_vnodeID, int *_type) +fs_walk(void *_ns, void *base, const char *file, ino_t *_vnodeID, int *_type) { /* Starting at the base, find file in the subdir, and return path string and vnode id of file. */ @@ -420,7 +420,7 @@ fs_walk(void *_ns, void *base, const char *file, vnode_id *_vnodeID, int *_type) static status_t -fs_read_vnode(void *_ns, vnode_id vnid, void **node, bool reenter) +fs_read_vnode(void *_ns, ino_t vnid, void **node, bool reenter) { uint32 block, pos; nspace *ns = (nspace*)_ns; diff --git a/src/add-ons/kernel/file_systems/nfs/fsproto.h b/src/add-ons/kernel/file_systems/nfs/fsproto.h index 900c3b29cf..1099f2eac3 100644 --- a/src/add-ons/kernel/file_systems/nfs/fsproto.h +++ b/src/add-ons/kernel/file_systems/nfs/fsproto.h @@ -14,7 +14,6 @@ #include typedef dev_t nspace_id; -typedef ino_t vnode_id; /* UGLY UGLY UGLY */ #ifndef _DRIVERS_H @@ -60,18 +59,18 @@ typedef struct selectsync selectsync; struct attr_info; struct index_info; -typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node); +typedef int op_read_vnode(void *ns, ino_t vnid, char r, void **node); typedef int op_write_vnode(void *ns, void *node, char r); typedef int op_remove_vnode(void *ns, void *node, char r); typedef int op_secure_vnode(void *ns, void *node); typedef int op_walk(void *ns, void *base, const char *file, char **newpath, - vnode_id *vnid); + ino_t *vnid); typedef int op_access(void *ns, void *node, int mode); typedef int op_create(void *ns, void *dir, const char *name, - int omode, int perms, vnode_id *vnid, void **cookie); + int omode, int perms, ino_t *vnid, void **cookie); typedef int op_mkdir(void *ns, void *dir, const char *name, int perms); typedef int op_symlink(void *ns, void *dir, const char *name, const char *path); @@ -116,7 +115,7 @@ typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event, typedef int op_initialize(const char *devname, void *parms, size_t len); typedef int op_mount(nspace_id nsid, const char *devname, ulong flags, - void *parms, size_t len, void **data, vnode_id *vnid); + void *parms, size_t len, void **data, ino_t *vnid); typedef int op_unmount(void *ns); typedef int op_sync(void *ns); typedef int op_rfsstat(void *ns, struct fs_info *); @@ -225,20 +224,20 @@ extern int new_path(const char *path, char **copy); extern void free_path(char *p); extern int notify_listener(int op, nspace_id nsid, - vnode_id vnida, vnode_id vnidb, - vnode_id vnidc, const char *name); + ino_t vnida, ino_t vnidb, + ino_t vnidc, const char *name); extern void notify_select_event(selectsync *sync, uint32 ref); extern int send_notification(port_id port, long token, ulong what, long op, nspace_id nsida, - nspace_id nsidb, vnode_id vnida, - vnode_id vnidb, vnode_id vnidc, + nspace_id nsidb, ino_t vnida, + ino_t vnidb, ino_t vnidc, const char *name); -extern int get_vnode(nspace_id nsid, vnode_id vnid, void **data); -extern int put_vnode(nspace_id nsid, vnode_id vnid); -extern int new_vnode(nspace_id nsid, vnode_id vnid, void *data); -extern int remove_vnode(nspace_id nsid, vnode_id vnid); -extern int unremove_vnode(nspace_id nsid, vnode_id vnid); -extern int is_vnode_removed(nspace_id nsid, vnode_id vnid); +extern int get_vnode(nspace_id nsid, ino_t vnid, void **data); +extern int put_vnode(nspace_id nsid, ino_t vnid); +extern int new_vnode(nspace_id nsid, ino_t vnid, void *data); +extern int remove_vnode(nspace_id nsid, ino_t vnid); +extern int unremove_vnode(nspace_id nsid, ino_t vnid); +extern int is_vnode_removed(nspace_id nsid, ino_t vnid); extern _EXPORT vnode_ops fs_entry; diff --git a/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c b/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c index b8bdce0e79..d9a00be5d8 100644 --- a/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c +++ b/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c @@ -747,7 +747,7 @@ status_t map_nfs_to_system_error (status_t nfsstatus) } extern nfs_fhandle -handle_from_vnid(fs_nspace *ns, vnode_id vnid) +handle_from_vnid(fs_nspace *ns, ino_t vnid) { fs_node *current; @@ -787,7 +787,7 @@ void insert_node (fs_nspace *ns, fs_node *node) while (release_sem (ns->sem)==B_INTERRUPTED); } -void remove_node (fs_nspace *ns, vnode_id vnid) +void remove_node (fs_nspace *ns, ino_t vnid) { fs_node *current; fs_node *previous; @@ -818,9 +818,9 @@ void remove_node (fs_nspace *ns, vnode_id vnid) extern int #ifdef __HAIKU__ -fs_read_vnode(fs_nspace *ns, vnode_id vnid, fs_node **node, char r) +fs_read_vnode(fs_nspace *ns, ino_t vnid, fs_node **node, char r) #else -fs_read_vnode(fs_nspace *ns, vnode_id vnid, char r, fs_node **node) +fs_read_vnode(fs_nspace *ns, ino_t vnid, char r, fs_node **node) #endif { fs_node *current; @@ -875,9 +875,9 @@ fs_get_vnode_name(fs_nspace *ns, fs_node *node, char *buffer, size_t len) extern int #ifdef __HAIKU__ -fs_walk(fs_nspace *ns, fs_node *base, const char *file, vnode_id *vnid, int *type) +fs_walk(fs_nspace *ns, fs_node *base, const char *file, ino_t *vnid, int *type) #else -fs_walk(fs_nspace *ns, fs_node *base, const char *file, char **newpath, vnode_id *vnid) +fs_walk(fs_nspace *ns, fs_node *base, const char *file, char **newpath, ino_t *vnid) #endif { bool isLink; @@ -1000,7 +1000,7 @@ fs_readdir(fs_nspace *ns, fs_node *node, nfs_cookie *cookie, long *num, struct d do { - vnode_id vnid; + ino_t vnid; char *filename; uint8 *replyBuf; struct XDROutPacket call; @@ -1241,9 +1241,9 @@ dprintf("nfs:gid!\n"); extern int #ifdef __HAIKU__ -fs_mount(nspace_id nsid, const char *devname, uint32 flags, const char *_parms, fs_nspace **data, vnode_id *vnid) +fs_mount(nspace_id nsid, const char *devname, uint32 flags, const char *_parms, fs_nspace **data, ino_t *vnid) #else -fs_mount(nspace_id nsid, const char *devname, ulong flags, const char *_parms, size_t len, fs_nspace **data, vnode_id *vnid) +fs_mount(nspace_id nsid, const char *devname, ulong flags, const char *_parms, size_t len, fs_nspace **data, ino_t *vnid) #endif { #ifndef PARAMS_AS_STRING @@ -1742,9 +1742,9 @@ fs_wfsstat(fs_nspace *ns, struct fs_info *info, long mask) extern int #ifdef __HAIKU__ -fs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, fs_file_cookie **cookie, vnode_id *vnid) +fs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, fs_file_cookie **cookie, ino_t *vnid) #else -fs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, vnode_id *vnid, fs_file_cookie **cookie) +fs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, ino_t *vnid, fs_file_cookie **cookie) #endif { nfs_fhandle fhandle; diff --git a/src/add-ons/kernel/file_systems/nfs/nfs_add_on.h b/src/add-ons/kernel/file_systems/nfs/nfs_add_on.h index 0298da8686..278562abac 100644 --- a/src/add-ons/kernel/file_systems/nfs/nfs_add_on.h +++ b/src/add-ons/kernel/file_systems/nfs/nfs_add_on.h @@ -44,7 +44,7 @@ struct mount_nfs_params struct fs_node { - vnode_id vnid; + ino_t vnid; struct nfs_fhandle fhandle; struct fs_node *next; }; @@ -62,7 +62,7 @@ struct fs_nspace int32 xid; - vnode_id rootid; + ino_t rootid; sem_id sem; struct fs_node *first; @@ -90,11 +90,11 @@ typedef struct fs_file_cookie fs_file_cookie; typedef struct nfs_fhandle nfs_fhandle; #if 0 -int fs_read_vnode(fs_nspace *ns, vnode_id vnid, char r, fs_node **node); +int fs_read_vnode(fs_nspace *ns, ino_t vnid, char r, fs_node **node); int fs_write_vnode(fs_nspace *ns, fs_node *node, char r); int fs_walk(fs_nspace *ns, fs_node *base, const char *file, char **newpath, - vnode_id *vnid); + ino_t *vnid); int fs_opendir(fs_nspace *ns, fs_node *node, nfs_cookie **cookie); int fs_closedir(fs_nspace *ns, fs_node *node, nfs_cookie *cookie); @@ -105,7 +105,7 @@ int fs_readdir(fs_nspace *ns, fs_node *node, nfs_cookie *cookie, long *num, int fs_free_dircookie(fs_nspace *ns, fs_node *node, nfs_cookie *cookie); int fs_rstat(fs_nspace *ns, fs_node *node, struct stat *); int fs_mount(nspace_id nsid, const char *devname, ulong flags, - struct mount_nfs_params *parms, size_t len, fs_nspace **data, vnode_id *vnid); + struct mount_nfs_params *parms, size_t len, fs_nspace **data, ino_t *vnid); int fs_unmount(fs_nspace *ns); int fs_rfsstat(fs_nspace *ns, struct fs_info *); @@ -121,7 +121,7 @@ int fs_write(fs_nspace *ns, fs_node *node, fs_file_cookie *cookie, off_t pos, int fs_wstat(fs_nspace *ns, fs_node *node, struct stat *, long mask); int fs_wfsstat(fs_nspace *ns, struct fs_info *, long mask); int fs_create(fs_nspace *ns, fs_node *dir, const char *name, - int omode, int perms, vnode_id *vnid, fs_file_cookie **cookie); + int omode, int perms, ino_t *vnid, fs_file_cookie **cookie); int fs_unlink(fs_nspace *ns, fs_node *dir, const char *name); int fs_remove_vnode(fs_nspace *ns, fs_node *node, char r); @@ -153,11 +153,11 @@ extern void get_nfs_attr(struct XDRInPacket *reply, struct stat *st); extern status_t nfs_lookup(fs_nspace *ns, const nfs_fhandle *dir, const char *filename, nfs_fhandle *fhandle, struct stat *st); extern status_t nfs_truncate_file(fs_nspace *ns, const nfs_fhandle *fhandle, struct stat *st); -nfs_fhandle handle_from_vnid (fs_nspace *ns, vnode_id vnid); +nfs_fhandle handle_from_vnid (fs_nspace *ns, ino_t vnid); extern status_t nfs_getattr(fs_nspace *ns, const nfs_fhandle *fhandle, struct stat *st); extern void insert_node(fs_nspace *ns, fs_node *node); -extern void remove_node(fs_nspace *ns, vnode_id vnid); +extern void remove_node(fs_nspace *ns, ino_t vnid); extern int fs_access(void *ns, void *node, int mode); diff --git a/src/add-ons/kernel/file_systems/ntfs/fs_func.c b/src/add-ons/kernel/file_systems/ntfs/fs_func.c index 7b5bd1d0ee..86adc3f9fb 100644 --- a/src/add-ons/kernel/file_systems/ntfs/fs_func.c +++ b/src/add-ons/kernel/file_systems/ntfs/fs_func.c @@ -121,10 +121,10 @@ fs_free_identify_partition_cookie(partition_data *partition, void *_cookie) #ifdef __HAIKU__ status_t -fs_mount( mount_id nsid, const char *device, ulong flags, const char *args, void **data, vnode_id *vnid ) +fs_mount(dev_t nsid, const char *device, ulong flags, const char *args, void **data, ino_t *vnid) #else int -fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t len, void **data, vnode_id *vnid) +fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t len, void **data, ino_t *vnid) #endif { nspace *ns; @@ -141,8 +141,7 @@ fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t le result = ENOMEM; goto exit; } - - + *ns = (nspace) { .state = NF_FreeClustersOutdate | NF_FreeMFTOutdate, .show_sys_files = false, @@ -326,10 +325,10 @@ exit: #ifdef __HAIKU__ status_t -fs_walk(void *_ns, void *_base, const char *file, vnode_id *vnid,int *_type) +fs_walk(void *_ns, void *_base, const char *file, ino_t *vnid,int *_type) #else int -fs_walk(void *_ns, void *_base, const char *file, char **newpath, vnode_id *vnid) +fs_walk(void *_ns, void *_base, const char *file, char **newpath, ino_t *vnid) #endif { nspace *ns = (nspace*)_ns; @@ -441,10 +440,10 @@ exit: #ifdef __HAIKU__ status_t -fs_read_vnode(void *_ns, vnode_id vnid, void **node, bool reenter) +fs_read_vnode(void *_ns, ino_t vnid, void **node, bool reenter) #else int -fs_read_vnode(void *_ns, vnode_id vnid, char reenter, void **node) +fs_read_vnode(void *_ns, ino_t vnid, char reenter, void **node) #endif { nspace *ns = (nspace*)_ns; @@ -876,10 +875,10 @@ exit: #ifdef __HAIKU__ status_t -fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, vnode_id *_vnid) +fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, ino_t *_vnid) #else int -fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, vnode_id *_vnid, void **_cookie) +fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, ino_t *_vnid, void **_cookie) #endif { nspace *ns = (nspace*)_ns; @@ -1427,7 +1426,7 @@ exit: #ifdef __HAIKU__ status_t -fs_mkdir(void *_ns, void *_node, const char *name, int perms, vnode_id *_vnid) +fs_mkdir(void *_ns, void *_node, const char *name, int perms, ino_t *_vnid) #else int fs_mkdir(void *_ns, void *_node, const char *name, int perms) @@ -1484,7 +1483,7 @@ fs_mkdir(void *_ns, void *_node, const char *name, int perms) ni = ntfs_create(bi, uname, uname_len, S_IFDIR); if (ni) { - vnode_id vnid = MREF( ni->mft_no ); + ino_t vnid = MREF( ni->mft_no ); newNode = (vnode*)ntfs_calloc( sizeof(vnode) ); if(newNode==NULL) { @@ -1544,7 +1543,7 @@ fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char * vnode *onode = NULL; vnode *nnode = NULL; - vnode_id ovnid,nvnid; + ino_t ovnid,nvnid; ntfs_inode *oi = NULL; ntfs_inode *ndi = NULL; @@ -1733,7 +1732,7 @@ exit: status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir) { - vnode_id vnid; + ino_t vnid; vnode *node = NULL; ntfs_inode *ni = NULL; ntfs_inode *bi = NULL; diff --git a/src/add-ons/kernel/file_systems/ntfs/fs_func.h b/src/add-ons/kernel/file_systems/ntfs/fs_func.h index 1b78f4f06a..d48c692794 100644 --- a/src/add-ons/kernel/file_systems/ntfs/fs_func.h +++ b/src/add-ons/kernel/file_systems/ntfs/fs_func.h @@ -49,16 +49,16 @@ float fs_identify_partition(int fd, partition_data *partition, void **_cookie); status_t fs_scan_partition(int fd, partition_data *partition, void *_cookie); void fs_free_identify_partition_cookie(partition_data *partition, void *_cookie); -status_t fs_mount( mount_id nsid, const char *device, ulong flags, const char *args, void **data, vnode_id *vnid ); +status_t fs_mount(dev_t nsid, const char *device, ulong flags, const char *args, void **data, ino_t *vnid); status_t fs_create_symlink(void *_ns, void *_dir, const char *name, const char *target, int mode); -status_t fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, vnode_id *_vnid); -status_t fs_walk(void *_ns, void *_base, const char *file, vnode_id *vnid,int *_type); +status_t fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, ino_t *_vnid); +status_t fs_walk(void *_ns, void *_base, const char *file, ino_t *vnid,int *_type); status_t fs_get_vnode_name(void *_ns, void *_node, char *buffer, size_t bufferSize); status_t fs_unmount(void *_ns); status_t fs_rfsstat(void *_ns, struct fs_info *); status_t fs_wfsstat(void *_vol, const struct fs_info *fss, uint32 mask); status_t fs_sync(void *_ns); -status_t fs_read_vnode(void *_ns, vnode_id vnid, void **_node, bool reenter); +status_t fs_read_vnode(void *_ns, ino_t vnid, void **_node, bool reenter); status_t fs_write_vnode(void *_ns, void *_node, bool reenter); status_t fs_remove_vnode( void *_ns, void *_node, bool reenter ); status_t fs_access( void *ns, void *node, int mode ); @@ -69,7 +69,7 @@ status_t fs_close(void *ns, void *node, void *cookie); status_t fs_free_cookie(void *ns, void *node, void *cookie); status_t fs_read(void *_ns, void *_node, void *cookie, off_t pos, void *buf, size_t *len); status_t fs_write(void *ns, void *node, void *cookie, off_t pos, const void *buf, size_t *len); -status_t fs_mkdir(void *_ns, void *_node, const char *name, int perms, vnode_id *_vnid); +status_t fs_mkdir(void *_ns, void *_node, const char *name, int perms, ino_t *_vnid); status_t fs_rmdir(void *_ns, void *dir, const char *name); status_t fs_opendir(void* _ns, void* _node, void** cookie); status_t fs_readdir( void *_ns, void *_node, void *_cookie, struct dirent *buf, size_t bufsize, uint32 *num ); @@ -83,10 +83,10 @@ status_t fs_unlink(void *_ns, void *_node, const char *name); #else -int fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t len, void **data, vnode_id *vnid); +int fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t len, void **data, ino_t *vnid); int fs_unmount(void *_ns); -int fs_walk(void *_ns, void *_base, const char *file, char **newpath, vnode_id *vnid); -int fs_read_vnode(void *_ns, vnode_id vnid, char r, void **node); +int fs_walk(void *_ns, void *_base, const char *file, char **newpath, ino_t *vnid); +int fs_read_vnode(void *_ns, ino_t vnid, char r, void **node); int fs_write_vnode(void *_ns, void *_node, char r); int fs_rstat(void *_ns, void *_node, struct stat *st); int fs_wstat(void *_vol, void *_node, struct stat *st, long mask); @@ -108,7 +108,7 @@ int fs_mkdir(void *_ns, void *_node, const char *name, int perms); int fs_rmdir(void *_ns, void *dir, const char *name); int fs_remove_vnode( void *_ns, void *_node, char reenter ); int fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname); -int fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, vnode_id *_vnid, void **_cookie); +int fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, ino_t *_vnid, void **_cookie); int fs_unlink(void *_ns, void *_node, const char *name); int fs_fsync(void *_ns, void *_node); int fs_sync(void *_ns); diff --git a/src/add-ons/kernel/file_systems/ntfs/fsproto.h b/src/add-ons/kernel/file_systems/ntfs/fsproto.h index 900c3b29cf..1099f2eac3 100644 --- a/src/add-ons/kernel/file_systems/ntfs/fsproto.h +++ b/src/add-ons/kernel/file_systems/ntfs/fsproto.h @@ -14,7 +14,6 @@ #include typedef dev_t nspace_id; -typedef ino_t vnode_id; /* UGLY UGLY UGLY */ #ifndef _DRIVERS_H @@ -60,18 +59,18 @@ typedef struct selectsync selectsync; struct attr_info; struct index_info; -typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node); +typedef int op_read_vnode(void *ns, ino_t vnid, char r, void **node); typedef int op_write_vnode(void *ns, void *node, char r); typedef int op_remove_vnode(void *ns, void *node, char r); typedef int op_secure_vnode(void *ns, void *node); typedef int op_walk(void *ns, void *base, const char *file, char **newpath, - vnode_id *vnid); + ino_t *vnid); typedef int op_access(void *ns, void *node, int mode); typedef int op_create(void *ns, void *dir, const char *name, - int omode, int perms, vnode_id *vnid, void **cookie); + int omode, int perms, ino_t *vnid, void **cookie); typedef int op_mkdir(void *ns, void *dir, const char *name, int perms); typedef int op_symlink(void *ns, void *dir, const char *name, const char *path); @@ -116,7 +115,7 @@ typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event, typedef int op_initialize(const char *devname, void *parms, size_t len); typedef int op_mount(nspace_id nsid, const char *devname, ulong flags, - void *parms, size_t len, void **data, vnode_id *vnid); + void *parms, size_t len, void **data, ino_t *vnid); typedef int op_unmount(void *ns); typedef int op_sync(void *ns); typedef int op_rfsstat(void *ns, struct fs_info *); @@ -225,20 +224,20 @@ extern int new_path(const char *path, char **copy); extern void free_path(char *p); extern int notify_listener(int op, nspace_id nsid, - vnode_id vnida, vnode_id vnidb, - vnode_id vnidc, const char *name); + ino_t vnida, ino_t vnidb, + ino_t vnidc, const char *name); extern void notify_select_event(selectsync *sync, uint32 ref); extern int send_notification(port_id port, long token, ulong what, long op, nspace_id nsida, - nspace_id nsidb, vnode_id vnida, - vnode_id vnidb, vnode_id vnidc, + nspace_id nsidb, ino_t vnida, + ino_t vnidb, ino_t vnidc, const char *name); -extern int get_vnode(nspace_id nsid, vnode_id vnid, void **data); -extern int put_vnode(nspace_id nsid, vnode_id vnid); -extern int new_vnode(nspace_id nsid, vnode_id vnid, void *data); -extern int remove_vnode(nspace_id nsid, vnode_id vnid); -extern int unremove_vnode(nspace_id nsid, vnode_id vnid); -extern int is_vnode_removed(nspace_id nsid, vnode_id vnid); +extern int get_vnode(nspace_id nsid, ino_t vnid, void **data); +extern int put_vnode(nspace_id nsid, ino_t vnid); +extern int new_vnode(nspace_id nsid, ino_t vnid, void *data); +extern int remove_vnode(nspace_id nsid, ino_t vnid); +extern int unremove_vnode(nspace_id nsid, ino_t vnid); +extern int is_vnode_removed(nspace_id nsid, ino_t vnid); extern _EXPORT vnode_ops fs_entry; diff --git a/src/add-ons/kernel/file_systems/ntfs/ntfs.h b/src/add-ons/kernel/file_systems/ntfs/ntfs.h index 32a267ca43..735ede10da 100644 --- a/src/add-ons/kernel/file_systems/ntfs/ntfs.h +++ b/src/add-ons/kernel/file_systems/ntfs/ntfs.h @@ -112,7 +112,7 @@ typedef struct nspace ntfs_volume *ntvol; char devicePath[MAX_PATH]; #ifdef __HAIKU__ - mount_id id; + dev_t id; #else nspace_id id; #endif diff --git a/src/add-ons/kernel/file_systems/ramfs/Node.h b/src/add-ons/kernel/file_systems/ramfs/Node.h index 4c8d2d2e4e..d5048b06e2 100644 --- a/src/add-ons/kernel/file_systems/ramfs/Node.h +++ b/src/add-ons/kernel/file_systems/ramfs/Node.h @@ -39,7 +39,7 @@ public: inline void SetVolume(Volume *volume) { fVolume = volume; } inline Volume *GetVolume() const { return fVolume; } - inline vnode_id GetID() const { return fID; } + inline ino_t GetID() const { return fID; } status_t AddReference(); void RemoveReference(); @@ -108,7 +108,7 @@ public: private: Volume *fVolume; - vnode_id fID; + ino_t fID; int32 fRefCount; mode_t fMode; uid_t fUID; diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h b/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h index a350f6a2c0..0781e8a581 100644 --- a/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h +++ b/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h @@ -21,7 +21,7 @@ public: fNext = -1; } - static inline uint32 HashFor(vnode_id id, const char *name) + static inline uint32 HashFor(ino_t id, const char *name) { return node_child_hash(id, name); } @@ -36,7 +36,7 @@ public: return HashFor(fID, fChild->GetName()); } - inline bool Equals(vnode_id id, const char *name) + inline bool Equals(ino_t id, const char *name) { return (fID == id && !strcmp(fChild->GetName(), name)); } @@ -53,7 +53,7 @@ public: fChild = element.fChild; } - vnode_id fID; + ino_t fID; NodeChild *fChild; }; @@ -67,17 +67,17 @@ public: status_t InitCheck() const; status_t AddNodeChild(ParentNode *node, NodeChild *child); - status_t AddNodeChild(vnode_id, NodeChild *child); + status_t AddNodeChild(ino_t, NodeChild *child); status_t RemoveNodeChild(ParentNode *node, NodeChild *child); - status_t RemoveNodeChild(vnode_id id, NodeChild *child); - status_t RemoveNodeChild(vnode_id id, const char *name); - NodeChild *GetNodeChild(vnode_id id, const char *name); + status_t RemoveNodeChild(ino_t id, NodeChild *child); + status_t RemoveNodeChild(ino_t id, const char *name); + NodeChild *GetNodeChild(ino_t id, const char *name); protected: typedef NodeChildHashElement Element; private: - Element *_FindElement(vnode_id id, const char *name) const; + Element *_FindElement(ino_t id, const char *name) const; protected: OpenHashElementArray fElementArray; @@ -157,7 +157,7 @@ NodeChildTable::AddNodeChild(ParentNode *node, // AddNodeChild template status_t -NodeChildTable::AddNodeChild(vnode_id id, +NodeChildTable::AddNodeChild(ino_t id, NodeChild *child) { status_t error = (child ? B_OK : B_BAD_VALUE); @@ -187,7 +187,7 @@ NodeChildTable::RemoveNodeChild(ParentNode *node, // RemoveNodeChild template status_t -NodeChildTable::RemoveNodeChild(vnode_id id, +NodeChildTable::RemoveNodeChild(ino_t id, NodeChild *child) { status_t error = (child ? B_OK : B_BAD_VALUE); @@ -199,7 +199,7 @@ NodeChildTable::RemoveNodeChild(vnode_id id, // RemoveNodeChild template status_t -NodeChildTable::RemoveNodeChild(vnode_id id, +NodeChildTable::RemoveNodeChild(ino_t id, const char *name) { status_t error = B_OK; @@ -213,7 +213,7 @@ NodeChildTable::RemoveNodeChild(vnode_id id, // GetNodeChild template NodeChild * -NodeChildTable::GetNodeChild(vnode_id id, +NodeChildTable::GetNodeChild(ino_t id, const char *name) { NodeChild *child = NULL; @@ -225,7 +225,7 @@ NodeChildTable::GetNodeChild(vnode_id id, // _FindElement template typename NodeChildTable::Element * -NodeChildTable::_FindElement(vnode_id id, +NodeChildTable::_FindElement(ino_t id, const char *name) const { Element *element = fTable.FindFirst(Element::HashFor(id, name)); diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp b/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp index 479fbb2644..c75b4aa42f 100644 --- a/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp +++ b/src/add-ons/kernel/file_systems/ramfs/NodeTable.cpp @@ -51,7 +51,7 @@ NodeTable::RemoveNode(Node *node) // RemoveNode status_t -NodeTable::RemoveNode(vnode_id id) +NodeTable::RemoveNode(ino_t id) { status_t error = B_OK; if (NodeHashElement *element = _FindElement(id)) @@ -63,7 +63,7 @@ NodeTable::RemoveNode(vnode_id id) // GetNode Node * -NodeTable::GetNode(vnode_id id) +NodeTable::GetNode(ino_t id) { Node *node = NULL; if (NodeHashElement *element = _FindElement(id)) @@ -82,7 +82,7 @@ NodeTable::GetAllocationInfo(AllocationInfo &info) // _FindElement NodeHashElement * -NodeTable::_FindElement(vnode_id id) const +NodeTable::_FindElement(ino_t id) const { NodeHashElement *element = fNodes.FindFirst(NodeHashElement::HashForID(id)); diff --git a/src/add-ons/kernel/file_systems/ramfs/NodeTable.h b/src/add-ons/kernel/file_systems/ramfs/NodeTable.h index 381a14b118..03a9dfcead 100644 --- a/src/add-ons/kernel/file_systems/ramfs/NodeTable.h +++ b/src/add-ons/kernel/file_systems/ramfs/NodeTable.h @@ -15,7 +15,7 @@ public: fNext = -1; } - static inline uint32 HashForID(vnode_id id) + static inline uint32 HashForID(ino_t id) { return uint32(id & 0xffffffff); } @@ -53,14 +53,14 @@ public: status_t AddNode(Node *node); status_t RemoveNode(Node *node); - status_t RemoveNode(vnode_id id); - Node *GetNode(vnode_id id); + status_t RemoveNode(ino_t id); + Node *GetNode(ino_t id); // debugging void GetAllocationInfo(AllocationInfo &info); private: - NodeHashElement *_FindElement(vnode_id id) const; + NodeHashElement *_FindElement(ino_t id) const; private: OpenHashElementArray fElementArray; diff --git a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp index ca1c7b066f..b9c63b7d7b 100644 --- a/src/add-ons/kernel/file_systems/ramfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/ramfs/Volume.cpp @@ -164,7 +164,7 @@ Volume::~Volume() // Mount status_t -Volume::Mount(mount_id id) +Volume::Mount(dev_t id) { Unmount(); @@ -369,7 +369,7 @@ Volume::PublishVNode(Node *node) // GetVNode status_t -Volume::GetVNode(vnode_id id, Node **node) +Volume::GetVNode(ino_t id, Node **node) { return (fMounted ? get_vnode(GetID(), id, (void**)node) : B_BAD_VALUE); } @@ -391,7 +391,7 @@ Volume::GetVNode(Node *node) // PutVNode status_t -Volume::PutVNode(vnode_id id) +Volume::PutVNode(ino_t id) { return (fMounted ? put_vnode(GetID(), id) : B_BAD_VALUE); } @@ -485,7 +485,7 @@ Volume::NodeRemoved(Node *node) } // FindNode -/*! \brief Finds the node identified by a vnode_id. +/*! \brief Finds the node identified by a ino_t. \note The method does not initialize the parent ID for non-directory nodes. @@ -494,7 +494,7 @@ Volume::NodeRemoved(Node *node) \return \c B_OK, if everything went fine. */ status_t -Volume::FindNode(vnode_id id, Node **node) +Volume::FindNode(ino_t id, Node **node) { status_t error = (node ? B_OK : B_BAD_VALUE); if (error == B_OK) { @@ -544,7 +544,7 @@ Volume::RemoveNodeListener(NodeListener *listener, Node *node) // EntryAdded status_t -Volume::EntryAdded(vnode_id id, Entry *entry) +Volume::EntryAdded(ino_t id, Entry *entry) { status_t error = (entry ? B_OK : B_BAD_VALUE); if (error == B_OK) { @@ -575,7 +575,7 @@ Volume::EntryAdded(vnode_id id, Entry *entry) // EntryRemoved status_t -Volume::EntryRemoved(vnode_id id, Entry *entry) +Volume::EntryRemoved(ino_t id, Entry *entry) { status_t error = (entry ? B_OK : B_BAD_VALUE); if (error == B_OK) { @@ -606,7 +606,7 @@ Volume::EntryRemoved(vnode_id id, Entry *entry) // FindEntry status_t -Volume::FindEntry(vnode_id id, const char *name, Entry **entry) +Volume::FindEntry(ino_t id, const char *name, Entry **entry) { status_t error = (entry ? B_OK : B_BAD_VALUE); if (error == B_OK) { @@ -656,7 +656,7 @@ Volume::RemoveEntryListener(EntryListener *listener, Entry *entry) // NodeAttributeAdded status_t -Volume::NodeAttributeAdded(vnode_id id, Attribute *attribute) +Volume::NodeAttributeAdded(ino_t id, Attribute *attribute) { status_t error = (attribute ? B_OK : B_BAD_VALUE); if (error == B_OK) { @@ -674,7 +674,7 @@ Volume::NodeAttributeAdded(vnode_id id, Attribute *attribute) // NodeAttributeRemoved status_t -Volume::NodeAttributeRemoved(vnode_id id, Attribute *attribute) +Volume::NodeAttributeRemoved(ino_t id, Attribute *attribute) { status_t error = (attribute ? B_OK : B_BAD_VALUE); if (error == B_OK) { @@ -701,7 +701,7 @@ Volume::NodeAttributeRemoved(vnode_id id, Attribute *attribute) // FindNodeAttribute status_t -Volume::FindNodeAttribute(vnode_id id, const char *name, Attribute **attribute) +Volume::FindNodeAttribute(ino_t id, const char *name, Attribute **attribute) { status_t error = (attribute ? B_OK : B_BAD_VALUE); if (error == B_OK) { diff --git a/src/add-ons/kernel/file_systems/ramfs/Volume.h b/src/add-ons/kernel/file_systems/ramfs/Volume.h index e5717f861a..892703bfbf 100644 --- a/src/add-ons/kernel/file_systems/ramfs/Volume.h +++ b/src/add-ons/kernel/file_systems/ramfs/Volume.h @@ -52,7 +52,7 @@ class NodeListenerTree; class NodeTable; class SizeIndex; -const vnode_id kRootParentID = 0; +const ino_t kRootParentID = 0; // NodeListenerValue class NodeListenerValue { @@ -93,10 +93,10 @@ public: Volume(); ~Volume(); - status_t Mount(mount_id nsid); + status_t Mount(dev_t nsid); status_t Unmount(); - mount_id GetID() const { return fID; } + dev_t GetID() const { return fID; } off_t GetBlockSize() const; off_t CountBlocks() const; @@ -109,9 +109,9 @@ public: status_t NewVNode(Node *node); status_t PublishVNode(Node *node); - status_t GetVNode(vnode_id id, Node **node); + status_t GetVNode(ino_t id, Node **node); status_t GetVNode(Node *node); - status_t PutVNode(vnode_id id); + status_t PutVNode(ino_t id); status_t PutVNode(Node *node); status_t RemoveVNode(Node *node); status_t UnremoveVNode(Node *node); @@ -119,23 +119,23 @@ public: // node table and listeners status_t NodeAdded(Node *node); status_t NodeRemoved(Node *node); - status_t FindNode(vnode_id id, Node **node); + status_t FindNode(ino_t id, Node **node); status_t AddNodeListener(NodeListener *listener, Node *node, uint32 flags); status_t RemoveNodeListener(NodeListener *listener, Node *node); // entry table and listeners - status_t EntryAdded(vnode_id id, Entry *entry); - status_t EntryRemoved(vnode_id id, Entry *entry); - status_t FindEntry(vnode_id id, const char *name, Entry **entry); + status_t EntryAdded(ino_t id, Entry *entry); + status_t EntryRemoved(ino_t id, Entry *entry); + status_t FindEntry(ino_t id, const char *name, Entry **entry); status_t AddEntryListener(EntryListener *listener, Entry *entry, uint32 flags); status_t RemoveEntryListener(EntryListener *listener, Entry *entry); // node attribute table - status_t NodeAttributeAdded(vnode_id id, Attribute *attribute); - status_t NodeAttributeRemoved(vnode_id id, Attribute *attribute); - status_t FindNodeAttribute(vnode_id id, const char *name, + status_t NodeAttributeAdded(ino_t id, Attribute *attribute); + status_t NodeAttributeRemoved(ino_t id, Attribute *attribute); + status_t FindNodeAttribute(ino_t id, const char *name, Attribute **attribute); // indices @@ -153,7 +153,7 @@ public: int32 type, const uint8 *oldKey, size_t oldLength, const uint8 *newKey, size_t newLength); - vnode_id NextNodeID() { return fNextNodeID++; } + ino_t NextNodeID() { return fNextNodeID++; } status_t AllocateBlock(size_t size, BlockReference **block); void FreeBlock(BlockReference *block); @@ -176,8 +176,8 @@ public: private: typedef DLList QueryList; - mount_id fID; - vnode_id fNextNodeID; + dev_t fID; + ino_t fNextNodeID; NodeTable *fNodeTable; DirectoryEntryTable *fDirectoryEntryTable; NodeAttributeTable *fNodeAttributeTable; 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 7b0a7aaf1b..d116fd64a3 100644 --- a/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp @@ -79,8 +79,8 @@ notify_if_stat_changed(Volume *volume, Node *node) // ramfs_mount static status_t -ramfs_mount(mount_id nsid, const char* /*device*/, uint32 flags, - const char* /*args*/, fs_volume* _volume, vnode_id* rootID) +ramfs_mount(dev_t nsid, const char* /*device*/, uint32 flags, + const char* /*args*/, fs_volume* _volume, ino_t* rootID) { FUNCTION_START(); // parameters are ignored for now @@ -176,7 +176,7 @@ ramfs_sync(fs_volume /*fs*/) // ramfs_lookup static status_t -ramfs_lookup(fs_volume fs, fs_vnode _dir, const char *entryName, vnode_id *vnid, +ramfs_lookup(fs_volume fs, fs_vnode _dir, const char *entryName, ino_t *vnid, int *type) { // FUNCTION_START(); @@ -223,7 +223,7 @@ SET_ERROR(error, error); // ramfs_read_vnode static status_t -ramfs_read_vnode(fs_volume fs, vnode_id vnid, fs_vnode *node, bool reenter) +ramfs_read_vnode(fs_volume fs, ino_t vnid, fs_vnode *node, bool reenter) { // FUNCTION_START(); FUNCTION(("node: %Ld\n", vnid)); @@ -489,7 +489,7 @@ ramfs_unlink(fs_volume fs, fs_vnode _dir, const char *name) NodeMTimeUpdater mTimeUpdater(dir); // check directory write permissions error = dir->CheckPermissions(ACCESS_W); - vnode_id nodeID = -1; + ino_t nodeID = -1; if (error == B_OK) { // check if entry exists Node *node = NULL; @@ -761,7 +761,7 @@ private: // ramfs_create static status_t ramfs_create(fs_volume fs, fs_vnode _dir, const char *name, int openMode, - int mode, fs_cookie *_cookie, vnode_id *vnid) + int mode, fs_cookie *_cookie, ino_t *vnid) { // FUNCTION_START(); FUNCTION(("name: `%s', open mode: %x, mode: %x\n", name, openMode, mode)); @@ -1075,7 +1075,7 @@ vint32 DirectoryCookie::fNextIteratorID = 0; // ramfs_create_dir static status_t ramfs_create_dir(fs_volume fs, fs_vnode _dir, const char *name, - int mode, vnode_id *_vnid) + int mode, ino_t *_vnid) { FUNCTION(("name: `%s', mode: %x\n", name, mode)); Volume *volume = (Volume*)fs; @@ -1147,7 +1147,7 @@ ramfs_remove_dir(fs_volume fs, fs_vnode _dir, const char *name) NodeMTimeUpdater mTimeUpdater(dir); // check directory write permissions error = dir->CheckPermissions(ACCESS_W); - vnode_id nodeID = -1; + ino_t nodeID = -1; if (error == B_OK) { // check if entry exists Node *node = NULL; diff --git a/src/add-ons/kernel/file_systems/reiserfs/VNode.cpp b/src/add-ons/kernel/file_systems/reiserfs/VNode.cpp index b197f8f058..16cdff0f49 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/VNode.cpp +++ b/src/add-ons/kernel/file_systems/reiserfs/VNode.cpp @@ -27,7 +27,7 @@ This class bundles all information relevant to a vnode, i.e. its ID, the ID of its parent node and its stat data (for fast and convenient - access). VNode knows how to convert between the VFS vnode_id + access). VNode knows how to convert between the VFS ino_t and the object+dir ID representation in ReiserFS. */ @@ -51,7 +51,7 @@ VNode::VNode(const VNode &node) } // constructor -VNode::VNode(vnode_id id) +VNode::VNode(ino_t id) : fParentID(0), fDirID(GetDirIDFor(id)), fObjectID(GetObjectIDFor(id)), @@ -75,7 +75,7 @@ VNode::~VNode() // SetTo status_t -VNode::SetTo(vnode_id id) +VNode::SetTo(ino_t id) { return SetTo(GetDirIDFor(id), GetObjectIDFor(id)); } @@ -92,7 +92,7 @@ VNode::SetTo(uint32 dirID, uint32 objectID) } // GetID -vnode_id +ino_t VNode::GetID() const { return GetIDFor(fDirID, fObjectID); diff --git a/src/add-ons/kernel/file_systems/reiserfs/VNode.h b/src/add-ons/kernel/file_systems/reiserfs/VNode.h index ab92c12488..b0d44d8156 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/VNode.h +++ b/src/add-ons/kernel/file_systems/reiserfs/VNode.h @@ -30,11 +30,11 @@ class VNode { public: VNode(); VNode(const VNode &node); - VNode(vnode_id id); + VNode(ino_t id); VNode(uint32 dirID, uint32 objectID); ~VNode(); - status_t SetTo(vnode_id id); + status_t SetTo(ino_t id); status_t SetTo(uint32 dirID, uint32 objectID); // void SetParentDirID(uint32 id) { fParentDirID = id; } @@ -46,11 +46,11 @@ public: void SetObjectID(uint32 id) { fObjectID = id; } uint32 GetObjectID() const { return fObjectID; } - vnode_id GetID() const; + ino_t GetID() const; void SetParentID(uint32 dirID, uint32 objectID); - void SetParentID(vnode_id id) { fParentID = id; } + void SetParentID(ino_t id) { fParentID = id; } // only valid for dirs! - vnode_id GetParentID() const { return fParentID; } + ino_t GetParentID() const { return fParentID; } StatData *GetStatData() { return &fStatData; } const StatData *GetStatData() const { return &fStatData; } @@ -61,16 +61,16 @@ public: bool IsEsoteric() const { return fStatData.IsEsoteric(); } // vnode ID <-> dir,object ID conversion - static vnode_id GetIDFor(uint32 dirID, uint32 objectID) - { return (vnode_id)((uint64)dirID << 32 | (uint64)objectID); } - static uint32 GetDirIDFor(vnode_id id) { return uint32((uint64)id >> 32); } - static uint32 GetObjectIDFor(vnode_id id) + static ino_t GetIDFor(uint32 dirID, uint32 objectID) + { return (ino_t)((uint64)dirID << 32 | (uint64)objectID); } + static uint32 GetDirIDFor(ino_t id) { return uint32((uint64)id >> 32); } + static uint32 GetObjectIDFor(ino_t id) { return uint32((uint64)id & 0xffffffffULL); } VNode &operator=(const VNode &node); private: - vnode_id fParentID; + ino_t fParentID; uint32 fDirID; uint32 fObjectID; StatData fStatData; diff --git a/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp b/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp index dbf0c2405c..a5e4a45114 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp @@ -84,7 +84,7 @@ Volume::~Volume() // Mount status_t -Volume::Mount(mount_id id, const char *path) +Volume::Mount(dev_t id, const char *path) { Unmount(); status_t error = (path ? B_OK : B_BAD_VALUE); @@ -255,20 +255,20 @@ Volume::GetKeyOffsetForName(const char *name, int len, uint64 *result) // GetVNode status_t -Volume::GetVNode(vnode_id id, VNode **node) +Volume::GetVNode(ino_t id, VNode **node) { return get_vnode(GetID(), id, (void**)node); } // PutVNode status_t -Volume::PutVNode(vnode_id id) +Volume::PutVNode(ino_t id) { return put_vnode(GetID(), id); } // FindVNode -/*! \brief Finds the node identified by a vnode_id. +/*! \brief Finds the node identified by a ino_t. \note The method does not initialize the parent ID for non-directory nodes. @@ -278,7 +278,7 @@ Volume::PutVNode(vnode_id id) \return \c B_OK, if everything went fine. */ status_t -Volume::FindVNode(vnode_id id, VNode *node) +Volume::FindVNode(ino_t id, VNode *node) { return FindVNode(VNode::GetDirIDFor(id), VNode::GetObjectIDFor(id), node); } @@ -460,7 +460,7 @@ PRINT(("Volume::FindEntry(`%s') done: %s\n", path, strerror(error))); // IsNegativeEntry bool -Volume::IsNegativeEntry(vnode_id id) +Volume::IsNegativeEntry(ino_t id) { for (int32 i = fNegativeEntries.CountItems() - 1; i >= 0; i--) { if (fNegativeEntries.ItemAt(i) == id) diff --git a/src/add-ons/kernel/file_systems/reiserfs/Volume.h b/src/add-ons/kernel/file_systems/reiserfs/Volume.h index d5be89a68b..5f7c69cc6e 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/Volume.h +++ b/src/add-ons/kernel/file_systems/reiserfs/Volume.h @@ -41,10 +41,10 @@ public: Volume(); ~Volume(); - status_t Mount(mount_id nsid, const char *path); + status_t Mount(dev_t nsid, const char *path); status_t Unmount(); - mount_id GetID() const { return fID; } + dev_t GetID() const { return fID; } off_t GetBlockSize() const; off_t CountBlocks() const; @@ -60,10 +60,10 @@ public: VNode *GetRootVNode() const { return fRootVNode; } - status_t GetVNode(vnode_id id, VNode **node); - status_t PutVNode(vnode_id id); + status_t GetVNode(ino_t id, VNode **node); + status_t PutVNode(ino_t id); - status_t FindVNode(vnode_id id, VNode *node); + status_t FindVNode(ino_t id, VNode *node); status_t FindVNode(uint32 dirID, uint32 objectID, VNode *node); status_t FindDirEntry(VNode *dir, const char *entryName, @@ -76,7 +76,7 @@ public: status_t FindEntry(const VNode *rootDir, const char *path, VNode *foundNode); - bool IsNegativeEntry(vnode_id id); + bool IsNegativeEntry(ino_t id); bool IsNegativeEntry(uint32 dirID, uint32 objectID); bool GetHideEsoteric() const; @@ -89,7 +89,7 @@ private: void _InitNegativeEntries(); private: - mount_id fID; + dev_t fID; int fDevice; BlockCache *fBlockCache; Tree *fTree; @@ -98,7 +98,7 @@ private: VNode *fRootVNode; char *fDeviceName; Settings *fSettings; - List fNegativeEntries; + List fNegativeEntries; }; #endif // VOLUME_H diff --git a/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp index 9b436e19dd..ebd9a8807d 100644 --- a/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp @@ -55,8 +55,8 @@ inline static bool is_user_in_group(gid_t gid); // reiserfs_mount static status_t -reiserfs_mount(mount_id nsid, const char *device, uint32 flags, - const char *parameters, fs_volume *data, vnode_id *rootID) +reiserfs_mount(dev_t nsid, const char *device, uint32 flags, + const char *parameters, fs_volume *data, ino_t *rootID) { TOUCH(flags); TOUCH(parameters); FUNCTION_START(); @@ -118,7 +118,7 @@ reiserfs_read_fs_info(fs_volume fs, struct fs_info *info) // reiserfs_lookup static status_t reiserfs_lookup(fs_volume fs, fs_vnode _dir, const char *entryName, - vnode_id *vnid, int *type) + ino_t *vnid, int *type) { // FUNCTION_START(); Volume *volume = (Volume*)fs; @@ -170,7 +170,7 @@ FUNCTION(("dir: (%Ld: %lu, %lu), entry: `%s'\n", dir->GetID(), dir->GetDirID(), // reiserfs_read_vnode static status_t -reiserfs_read_vnode(fs_volume fs, vnode_id vnid, fs_vnode *node, bool reenter) +reiserfs_read_vnode(fs_volume fs, ino_t vnid, fs_vnode *node, bool reenter) { TOUCH(reenter); // FUNCTION_START(); diff --git a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp index 64fdfcaf4a..91f6e7f2ce 100644 --- a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp +++ b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp @@ -1,6 +1,6 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. +// This software is part of the Haiku distribution and is covered +// by the MIT license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net //--------------------------------------------------------------------- @@ -21,7 +21,7 @@ using namespace Udf; status_t -DirectoryIterator::GetNextEntry(char *name, uint32 *length, vnode_id *id) +DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id) { DEBUG_INIT_ETC("DirectoryIterator", ("name: %p, length: %p, id: %p", name, length, id)); diff --git a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h index 7b8c2dd7db..265eef5aa0 100644 --- a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h +++ b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h @@ -1,6 +1,6 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. +// This software is part of the Haiku distribution and is covered +// by the MIT license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net //--------------------------------------------------------------------- @@ -31,7 +31,7 @@ class Icb; class DirectoryIterator { public: - status_t GetNextEntry(char *name, uint32 *length, vnode_id *id); + status_t GetNextEntry(char *name, uint32 *length, ino_t *id); void Rewind(); Icb* Parent() { return fParent; } diff --git a/src/add-ons/kernel/file_systems/udf/Icb.cpp b/src/add-ons/kernel/file_systems/udf/Icb.cpp index 6860188c46..fa909fc834 100644 --- a/src/add-ons/kernel/file_systems/udf/Icb.cpp +++ b/src/add-ons/kernel/file_systems/udf/Icb.cpp @@ -1,6 +1,6 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. +// This software is part of the Haiku distribution and is covered +// by the MIT license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net //--------------------------------------------------------------------- @@ -136,7 +136,7 @@ Icb::GetDirectoryIterator(DirectoryIterator **iterator) } status_t -Icb::Find(const char *filename, vnode_id *id) +Icb::Find(const char *filename, ino_t *id) { DEBUG_INIT_ETC("Icb", ("filename: `%s', id: %p", filename, id)); @@ -147,7 +147,7 @@ Icb::Find(const char *filename, vnode_id *id) DirectoryIterator *i; status_t error = GetDirectoryIterator(&i); if (!error) { - vnode_id entryId; + ino_t entryId; uint32 length = B_FILE_NAME_LENGTH; char name[B_FILE_NAME_LENGTH]; diff --git a/src/add-ons/kernel/file_systems/udf/Icb.h b/src/add-ons/kernel/file_systems/udf/Icb.h index d340f8330a..de2b8297f0 100644 --- a/src/add-ons/kernel/file_systems/udf/Icb.h +++ b/src/add-ons/kernel/file_systems/udf/Icb.h @@ -1,6 +1,6 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. +// This software is part of the Haiku distribution and is covered +// by the MIT license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net //--------------------------------------------------------------------- @@ -67,7 +67,7 @@ class Icb { public: Icb(Volume *volume, long_address address); status_t InitCheck(); - vnode_id Id() { return fId; } + ino_t Id() { return fId; } // categorization uint8 Type() { return IcbTag().file_type(); } @@ -90,7 +90,7 @@ public: // for directories only status_t GetDirectoryIterator(DirectoryIterator **iterator); - status_t Find(const char *filename, vnode_id *id); + status_t Find(const char *filename, ino_t *id); Volume* GetVolume() const { return fVolume; } @@ -118,7 +118,7 @@ private: Volume *fVolume; CachedBlock fData; status_t fInitStatus; - vnode_id fId; + ino_t fId; SinglyLinkedList fIteratorList; /* [zooey]: gcc-2.95.3 requires the explicit namespace here, otherwise it complains about a syntax error(!). This is most probably a bug. */ diff --git a/src/add-ons/kernel/file_systems/udf/Utils.cpp b/src/add-ons/kernel/file_systems/udf/Utils.cpp index 7a76361260..6ffc601ea7 100644 --- a/src/add-ons/kernel/file_systems/udf/Utils.cpp +++ b/src/add-ons/kernel/file_systems/udf/Utils.cpp @@ -1,6 +1,6 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. +// This software is part of the Haiku distribution and is covered +// by the MIT license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net //--------------------------------------------------------------------- @@ -24,9 +24,9 @@ extern "C" { namespace Udf { long_address -to_long_address(vnode_id id, uint32 length) +to_long_address(ino_t id, uint32 length) { - DEBUG_INIT_ETC(NULL, ("vnode_id: %Ld (0x%Lx), length: %ld", id, id, length)); + DEBUG_INIT_ETC(NULL, ("ino_t: %Ld (0x%Lx), length: %ld", id, id, length)); long_address result; result.set_block((id >> 16) & 0xffffffff); result.set_partition(id & 0xffff); @@ -35,17 +35,17 @@ to_long_address(vnode_id id, uint32 length) return result; } -vnode_id +ino_t to_vnode_id(long_address address) { DEBUG_INIT(NULL); - vnode_id result = address.block(); + ino_t result = address.block(); result <<= 16; result |= address.partition(); PRINT(("block: %ld, 0x%lx\n", address.block(), address.block())); PRINT(("partition: %d, 0x%x\n", address.partition(), address.partition())); PRINT(("length: %ld, 0x%lx\n", address.length(), address.length())); - PRINT(("vnode_id: %Ld, 0x%Lx\n", result, result)); + PRINT(("ino_t: %Ld, 0x%Lx\n", result, result)); return result; } diff --git a/src/add-ons/kernel/file_systems/udf/Utils.h b/src/add-ons/kernel/file_systems/udf/Utils.h index 325287ddaa..2e3f11e175 100644 --- a/src/add-ons/kernel/file_systems/udf/Utils.h +++ b/src/add-ons/kernel/file_systems/udf/Utils.h @@ -1,6 +1,6 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. +// This software is part of the Haiku distribution and is covered +// by the MIT license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net //--------------------------------------------------------------------- @@ -27,9 +27,9 @@ extern "C" { namespace Udf { -long_address to_long_address(vnode_id id, uint32 length = 0); +long_address to_long_address(ino_t id, uint32 length = 0); -vnode_id to_vnode_id(long_address address); +ino_t to_vnode_id(long_address address); time_t make_time(timestamp ×tamp); diff --git a/src/add-ons/kernel/file_systems/udf/fsproto.h b/src/add-ons/kernel/file_systems/udf/fsproto.h index 818ffcdd9d..d60d3adaa0 100644 --- a/src/add-ons/kernel/file_systems/udf/fsproto.h +++ b/src/add-ons/kernel/file_systems/udf/fsproto.h @@ -2,7 +2,6 @@ Copyright 1999-2001, Be Incorporated. All Rights Reserved. This file may be used under the terms of the Be Sample Code License. */ - #ifndef _FSPROTO_H #define _FSPROTO_H @@ -20,7 +19,6 @@ #include typedef dev_t nspace_id; -typedef ino_t vnode_id; /* * PUBLIC PART OF THE FILE SYSTEM PROTOCOL @@ -63,7 +61,7 @@ typedef ino_t vnode_id; struct attr_info; struct index_info; -typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node); +typedef int op_read_vnode(void *ns, ino_t vnid, char r, void **node); typedef int op_write_vnode(void *ns, void *node, char r); typedef int op_remove_vnode(void *ns, void *node, char r); typedef int op_secure_vnode(void *ns, void *node); @@ -71,12 +69,12 @@ typedef int op_wake_vnode(void *ns, void *node); typedef int op_suspend_vnode(void *ns, void *node); typedef int op_walk(void *ns, void *base, const char *file, char **newpath, - vnode_id *vnid); + ino_t *vnid); typedef int op_access(void *ns, void *node, int mode); typedef int op_create(void *ns, void *dir, const char *name, - int omode, int perms, vnode_id *vnid, void **cookie); + int omode, int perms, ino_t *vnid, void **cookie); typedef int op_mkdir(void *ns, void *dir, const char *name, int perms); typedef int op_symlink(void *ns, void *dir, const char *name, const char *path); @@ -121,7 +119,7 @@ typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event, typedef int op_initialize(const char *devname, void *parms, size_t len); typedef int op_mount(nspace_id nsid, const char *devname, ulong flags, - void *parms, size_t len, void **data, vnode_id *vnid); + void *parms, size_t len, void **data, ino_t *vnid); typedef int op_unmount(void *ns); typedef int op_sync(void *ns); typedef int op_rfsstat(void *ns, struct fs_info *); @@ -237,19 +235,19 @@ extern _IMPEXP_KERNEL int new_path(const char *path, char **copy); extern _IMPEXP_KERNEL void free_path(char *p); extern _IMPEXP_KERNEL int notify_listener(int op, nspace_id nsid, - vnode_id vnida, vnode_id vnidb, - vnode_id vnidc, const char *name); + ino_t vnida, ino_t vnidb, + ino_t vnidc, const char *name); extern _IMPEXP_KERNEL int send_notification(port_id port, long token, ulong what, long op, nspace_id nsida, - nspace_id nsidb, vnode_id vnida, - vnode_id vnidb, vnode_id vnidc, + nspace_id nsidb, ino_t vnida, + ino_t vnidb, ino_t vnidc, const char *name); -extern _IMPEXP_KERNEL int get_vnode(nspace_id nsid, vnode_id vnid, void **data); -extern _IMPEXP_KERNEL int put_vnode(nspace_id nsid, vnode_id vnid); -extern _IMPEXP_KERNEL int new_vnode(nspace_id nsid, vnode_id vnid, void *data); -extern _IMPEXP_KERNEL int remove_vnode(nspace_id nsid, vnode_id vnid); -extern _IMPEXP_KERNEL int unremove_vnode(nspace_id nsid, vnode_id vnid); -extern _IMPEXP_KERNEL int is_vnode_removed(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int get_vnode(nspace_id nsid, ino_t vnid, void **data); +extern _IMPEXP_KERNEL int put_vnode(nspace_id nsid, ino_t vnid); +extern _IMPEXP_KERNEL int new_vnode(nspace_id nsid, ino_t vnid, void *data); +extern _IMPEXP_KERNEL int remove_vnode(nspace_id nsid, ino_t vnid); +extern _IMPEXP_KERNEL int unremove_vnode(nspace_id nsid, ino_t vnid); +extern _IMPEXP_KERNEL int is_vnode_removed(nspace_id nsid, ino_t vnid); #ifdef __cplusplus } diff --git a/src/add-ons/kernel/file_systems/udf/udf.cpp b/src/add-ons/kernel/file_systems/udf/udf.cpp index a6c0386077..4a15270e06 100644 --- a/src/add-ons/kernel/file_systems/udf/udf.cpp +++ b/src/add-ons/kernel/file_systems/udf/udf.cpp @@ -1,6 +1,6 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. +// This software is part of the Haiku distribution and is covered +// by the MIT license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net // Mucho respecto to Axel Dörfler and his BFS implementation, from @@ -47,7 +47,7 @@ extern "C" { extern "C" { // general/volume stuff static int udf_mount(nspace_id nsid, const char *device, ulong flags, - void *parms, size_t len, void **data, vnode_id *vnid); + void *parms, size_t len, void **data, ino_t *vnid); static int udf_unmount(void *_ns); static int udf_read_fs_stat(void *_ns, struct fs_info *); static int udf_write_fs_stat(void *ns, struct fs_info *, long mode); @@ -55,12 +55,12 @@ extern "C" { static int udf_sync(void *ns); - static int udf_read_vnode(void *_ns, vnode_id vnid, char r, void **node); + static int udf_read_vnode(void *_ns, ino_t vnid, char r, void **node); static int udf_release_vnode(void *_ns, void *_node, char r); static int udf_remove_vnode(void *ns, void *node, char r); static int udf_walk(void *_ns, void *_base, const char *file, - char **newpath, vnode_id *vnid); + char **newpath, ino_t *vnid); static int udf_ioctl(void *ns, void *node, void *cookie, int cmd, void *buf,size_t len); static int udf_setflags(void *ns, void *node, void *cookie, int flags); @@ -73,7 +73,7 @@ extern "C" { // file stuff static int udf_create(void *ns, void *dir, const char *name, - int perms, int omode, vnode_id *vnid, void **cookie); + int perms, int omode, ino_t *vnid, void **cookie); static int udf_symlink(void *ns, void *dir, const char *name, const char *path); static int udf_link(void *ns, void *dir, const char *name, void *node); @@ -239,7 +239,7 @@ int32 api_version = B_CUR_FS_API_VERSION; */ int udf_mount(nspace_id nsid, const char *name, ulong flags, void *parms, - size_t parmsLength, void **volumeCookie, vnode_id *rootID) + size_t parmsLength, void **volumeCookie, ino_t *rootID) { INITIALIZE_DEBUGGING_OUTPUT_FILE("/boot/home/Desktop/udf_debug.txt"); DEBUG_INIT_ETC(NULL, ("name: `%s'", name)); @@ -397,7 +397,7 @@ udf_sync(void *ns) int -udf_read_vnode(void *ns, vnode_id id, char reenter, void **node) +udf_read_vnode(void *ns, ino_t id, char reenter, void **node) { DEBUG_INIT_ETC(NULL, ("id: %Ld, reenter: %s", id, (reenter ? "true" : "false"))); @@ -467,7 +467,7 @@ udf_suspend_vnode(void *ns, void *node) int -udf_walk(void *ns, void *_dir, const char *filename, char **resolvedPath, vnode_id *vnodeId) +udf_walk(void *ns, void *_dir, const char *filename, char **resolvedPath, ino_t *vnodeId) { DEBUG_INIT_ETC(NULL, ("dir: %p, filename = `%s'", _dir, filename)); @@ -591,7 +591,7 @@ udf_write_stat(void *ns, void *node, struct stat *stat, long mask) int udf_create(void *ns, void *dir, const char *name, int omode, int mode, - vnode_id *newID, void **newNode) + ino_t *newID, void **newNode) { DEBUG_INIT(NULL); // FUNCTION_START(("name: `%s\', perms: %d, omode: %d\n", name, mode, omode)); diff --git a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp index 989922213b..649c9f6175 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp @@ -179,7 +179,7 @@ FileSystem::GetPortPool() // Mount status_t -FileSystem::Mount(mount_id id, const char* device, uint32 flags, +FileSystem::Mount(dev_t id, const char* device, uint32 flags, const char* parameters, Volume** _volume) { // check initialization and parameters @@ -257,7 +257,7 @@ FileSystem::VolumeUnmounted(Volume* volume) // GetVolume Volume* -FileSystem::GetVolume(mount_id id) +FileSystem::GetVolume(dev_t id) { AutoLocker _(fVolumeLock); for (Vector::Iterator it = fVolumes.Begin(); diff --git a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h index f530e6194b..9f893ca61e 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h +++ b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h @@ -35,14 +35,14 @@ public: RequestPortPool* GetPortPool(); - status_t Mount(mount_id id, const char* device, + status_t Mount(dev_t id, const char* device, ulong flags, const char* parameters, Volume** volume); // status_t Initialize(const char* deviceName, // const char* parameters, size_t len); void VolumeUnmounted(Volume* volume); - Volume* GetVolume(mount_id id); + Volume* GetVolume(dev_t id); const IOCtlInfo* GetIOCtlInfo(int command) const; diff --git a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp index 3fa3139645..7c2d204019 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp @@ -458,7 +458,7 @@ KernelRequestHandler::_HandleRequest(GetVNodeRemovedRequest* request) // _GetVolume status_t -KernelRequestHandler::_GetVolume(mount_id id, Volume** volume) +KernelRequestHandler::_GetVolume(dev_t id, Volume** volume) { if (fVolume) { if (fVolume->GetID() != id) { diff --git a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h index a96fc1ed97..c2eb705b9e 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h +++ b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h @@ -60,7 +60,7 @@ private: status_t _HandleRequest(UnremoveVNodeRequest* request); status_t _HandleRequest(GetVNodeRemovedRequest* request); - status_t _GetVolume(mount_id id, Volume** volume); + status_t _GetVolume(dev_t id, Volume** volume); private: FileSystem* fFileSystem; diff --git a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp index a87be29cf4..4f41e4f513 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp @@ -32,12 +32,12 @@ static const bigtime_t kUserlandServerlandPortTimeout = 10000000; // 10s // MountVNodeMap -struct Volume::MountVNodeMap : public HashMap, void*> { +struct Volume::MountVNodeMap : public HashMap, void*> { }; // VNodeCountMap struct Volume::VNodeCountMap - : public SynchronizedHashMap, int32*> { + : public SynchronizedHashMap, int32*> { }; // AutoIncrementer @@ -66,7 +66,7 @@ private: }; // constructor -Volume::Volume(FileSystem* fileSystem, mount_id id) +Volume::Volume(FileSystem* fileSystem, dev_t id) : Referencable(true), fFileSystem(fileSystem), fID(id), @@ -98,7 +98,7 @@ Volume::GetFileSystem() const } // GetID -mount_id +dev_t Volume::GetID() const { return fID; @@ -112,7 +112,7 @@ Volume::GetUserlandVolume() const } // GetRootID -vnode_id +ino_t Volume::GetRootID() const { return fRootID; @@ -130,7 +130,7 @@ Volume::IsMounting() const // GetVNode status_t -Volume::GetVNode(vnode_id vnid, fs_vnode* node) +Volume::GetVNode(ino_t vnid, fs_vnode* node) { PRINT(("get_vnode(%ld, %lld)\n", fID, vnid)); if (IsMounting() && !fMountVNodes->ContainsKey(vnid)) { @@ -145,7 +145,7 @@ PRINT(("get_vnode(%ld, %lld)\n", fID, vnid)); // PutVNode status_t -Volume::PutVNode(vnode_id vnid) +Volume::PutVNode(ino_t vnid) { PRINT(("put_vnode(%ld, %lld)\n", fID, vnid)); status_t error = put_vnode(fID, vnid); @@ -156,7 +156,7 @@ PRINT(("put_vnode(%ld, %lld)\n", fID, vnid)); // NewVNode status_t -Volume::NewVNode(vnode_id vnid, fs_vnode node) +Volume::NewVNode(ino_t vnid, fs_vnode node) { PRINT(("new_vnode(%ld, %lld)\n", fID, vnid)); status_t error = new_vnode(fID, vnid, node); @@ -179,7 +179,7 @@ PRINT(("new_vnode(%ld, %lld)\n", fID, vnid)); // PublishVNode status_t -Volume::PublishVNode(vnode_id vnid, fs_vnode node) +Volume::PublishVNode(ino_t vnid, fs_vnode node) { PRINT(("publish_vnode(%ld, %lld, %p)\n", fID, vnid, node)); status_t error = publish_vnode(fID, vnid, node); @@ -200,7 +200,7 @@ PRINT(("publish_vnode(%ld, %lld, %p)\n", fID, vnid, node)); // RemoveVNode status_t -Volume::RemoveVNode(vnode_id vnid) +Volume::RemoveVNode(ino_t vnid) { PRINT(("remove_vnode(%ld, %lld)\n", fID, vnid)); return remove_vnode(fID, vnid); @@ -208,7 +208,7 @@ PRINT(("remove_vnode(%ld, %lld)\n", fID, vnid)); // UnremoveVNode status_t -Volume::UnremoveVNode(vnode_id vnid) +Volume::UnremoveVNode(ino_t vnid) { PRINT(("unremove_vnode(%ld, %lld)\n", fID, vnid)); return unremove_vnode(fID, vnid); @@ -216,7 +216,7 @@ PRINT(("unremove_vnode(%ld, %lld)\n", fID, vnid)); // GetVNodeRemoved status_t -Volume::GetVNodeRemoved(vnode_id vnid, bool* removed) +Volume::GetVNodeRemoved(ino_t vnid, bool* removed) { PRINT(("get_vnode_removed(%ld, %lld, %p)\n", fID, vnid, removed)); return get_vnode_removed(fID, vnid, removed); @@ -230,7 +230,7 @@ PRINT(("get_vnode_removed(%ld, %lld, %p)\n", fID, vnid, removed)); status_t Volume::Mount(const char* device, uint32 flags, const char* parameters) { - // Create a map that holds vnode_id->void* mappings of all vnodes + // Create a map that holds ino_t->void* mappings of all vnodes // created while mounting. We need it to get the root node. MountVNodeMap vnodeMap; status_t error = vnodeMap.InitCheck(); @@ -384,7 +384,7 @@ Volume::WriteFSInfo(const struct fs_info *info, uint32 mask) // Lookup status_t -Volume::Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, int* type) +Volume::Lookup(fs_vnode dir, const char* entryName, ino_t* vnid, int* type) { // When the connection to the userland server is lost, we serve // lookup(fRootNode, `.') requests manually to allow clean unmounting. @@ -455,7 +455,7 @@ Volume::GetVNodeName(fs_vnode node, char* buffer, size_t bufferSize) // ReadVNode status_t -Volume::ReadVNode(vnode_id vnid, bool reenter, fs_vnode* node) +Volume::ReadVNode(ino_t vnid, bool reenter, fs_vnode* node) { // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); @@ -1210,7 +1210,7 @@ Volume::WriteStat(fs_vnode node, const struct stat* st, uint32 mask) // Create status_t Volume::Create(fs_vnode dir, const char* name, int openMode, int mode, - void** cookie, vnode_id* vnid) + void** cookie, ino_t* vnid) { // check capability if (!fFileSystem->HasCapability(FS_CAPABILITY_CREATE)) @@ -1439,7 +1439,7 @@ Volume::Write(fs_vnode node, fs_cookie cookie, off_t pos, const void* buffer, // CreateDir status_t -Volume::CreateDir(fs_vnode dir, const char* name, int mode, vnode_id *newDir) +Volume::CreateDir(fs_vnode dir, const char* name, int mode, ino_t *newDir) { // check capability if (!fFileSystem->HasCapability(FS_CAPABILITY_CREATE_DIR)) @@ -2894,7 +2894,7 @@ Volume::_ReadFSInfo(fs_info* info) // _Lookup status_t -Volume::_Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, int* type) +Volume::_Lookup(fs_vnode dir, const char* entryName, ino_t* vnid, int* type) { // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); @@ -3501,7 +3501,7 @@ Volume::_SendReceiptAck(RequestPort* port) // _IncrementVNodeCount void -Volume::_IncrementVNodeCount(vnode_id vnid) +Volume::_IncrementVNodeCount(ino_t vnid) { if (!fVNodeCountingEnabled) return; @@ -3534,7 +3534,7 @@ Volume::_IncrementVNodeCount(vnode_id vnid) // _DecrementVNodeCount void -Volume::_DecrementVNodeCount(vnode_id vnid) +Volume::_DecrementVNodeCount(ino_t vnid) { if (!fVNodeCountingEnabled) return; diff --git a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h index e1c3a74986..fa4b7f6b4e 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h +++ b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h @@ -27,24 +27,24 @@ class FileSystem; class Volume : public Referencable { public: - Volume(FileSystem* fileSystem, mount_id id); + Volume(FileSystem* fileSystem, dev_t id); ~Volume(); FileSystem* GetFileSystem() const; - mount_id GetID() const; + dev_t GetID() const; void* GetUserlandVolume() const; - vnode_id GetRootID() const; + ino_t GetRootID() const; bool IsMounting() const; // client methods - status_t GetVNode(vnode_id vnid, fs_vnode* node); - status_t PutVNode(vnode_id vnid); - status_t NewVNode(vnode_id vnid, fs_vnode node); - status_t PublishVNode(vnode_id vnid, fs_vnode node); - status_t RemoveVNode(vnode_id vnid); - status_t UnremoveVNode(vnode_id vnid); - status_t GetVNodeRemoved(vnode_id vnid, bool* removed); + status_t GetVNode(ino_t vnid, fs_vnode* node); + status_t PutVNode(ino_t vnid); + status_t NewVNode(ino_t vnid, fs_vnode node); + status_t PublishVNode(ino_t vnid, fs_vnode node); + status_t RemoveVNode(ino_t vnid); + status_t UnremoveVNode(ino_t vnid); + status_t GetVNodeRemoved(ino_t vnid, bool* removed); // FS status_t Mount(const char* device, uint32 flags, @@ -57,10 +57,10 @@ public: // vnodes status_t Lookup(fs_vnode dir, const char* entryName, - vnode_id* vnid, int* type); + ino_t* vnid, int* type); status_t GetVNodeName(fs_vnode node, char* buffer, size_t bufferSize); - status_t ReadVNode(vnode_id vnid, bool reenter, + status_t ReadVNode(ino_t vnid, bool reenter, fs_vnode* node); status_t WriteVNode(fs_vnode node, bool reenter); status_t RemoveVNode(fs_vnode node, bool reenter); @@ -96,7 +96,7 @@ public: // files status_t Create(fs_vnode dir, const char* name, int openMode, int mode, fs_cookie* cookie, - vnode_id* vnid); + ino_t* vnid); status_t Open(fs_vnode node, int openMode, fs_cookie* cookie); status_t Close(fs_vnode node, fs_cookie cookie); @@ -110,7 +110,7 @@ public: // directories status_t CreateDir(fs_vnode dir, const char* name, - int mode, vnode_id *newDir); + int mode, ino_t *newDir); status_t RemoveDir(fs_vnode dir, const char* name); status_t OpenDir(fs_vnode node, fs_cookie* cookie); status_t CloseDir(fs_vnode node, fs_vnode cookie); @@ -184,7 +184,7 @@ private: status_t _Unmount(); status_t _ReadFSInfo(fs_info* info); status_t _Lookup(fs_vnode dir, const char* entryName, - vnode_id* vnid, int* type); + ino_t* vnid, int* type); status_t _WriteVNode(fs_vnode node, bool reenter); status_t _ReadStat(fs_vnode node, struct stat* st); status_t _Close(fs_vnode node, fs_cookie cookie); @@ -207,8 +207,8 @@ private: RequestHandler* handler, Request** reply); status_t _SendReceiptAck(RequestPort* port); - void _IncrementVNodeCount(vnode_id vnid); - void _DecrementVNodeCount(vnode_id vnid); + void _IncrementVNodeCount(ino_t vnid); + void _DecrementVNodeCount(ino_t vnid); status_t _InternalIOCtl(userlandfs_ioctl* buffer, int32 bufferSize); @@ -221,9 +221,9 @@ private: class AutoIncrementer; FileSystem* fFileSystem; - mount_id fID; + dev_t fID; void* fUserlandVolume; - vnode_id fRootID; + ino_t fRootID; fs_vnode fRootNode; MountVNodeMap* fMountVNodes; vint32 fOpenFiles; diff --git a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp index 64f33849ab..1a06cbe94c 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp @@ -64,8 +64,8 @@ parse_parameters(const char *parameters, String &fsName, // userlandfs_mount static status_t -userlandfs_mount(mount_id id, const char *device, uint32 flags, - const char *args, fs_volume *fsCookie, vnode_id *rootVnodeID) +userlandfs_mount(dev_t id, const char *device, uint32 flags, + const char *args, fs_volume *fsCookie, ino_t *rootVnodeID) { PRINT(("userlandfs_mount(%ld, %s, 0x%lx, %s, %p, %p)\n", id, device, flags, args, fsCookie, rootVnodeID)); @@ -165,7 +165,7 @@ userlandfs_write_fs_info(fs_volume fs, const struct fs_info *info, uint32 mask) // userlandfs_lookup static status_t userlandfs_lookup(fs_volume fs, fs_vnode dir, const char *entryName, - vnode_id *vnid, int *type) + ino_t *vnid, int *type) { Volume* volume = (Volume*)fs; PRINT(("userlandfs_lookup(%p, %p, `%s', %p, %p)\n", fs, dir, @@ -192,7 +192,7 @@ userlandfs_get_vnode_name(fs_volume fs, fs_vnode node, char *buffer, // userlandfs_get_vnode static status_t -userlandfs_get_vnode(fs_volume fs, vnode_id vnid, fs_vnode *node, bool reenter) +userlandfs_get_vnode(fs_volume fs, ino_t vnid, fs_vnode *node, bool reenter) { Volume* volume = (Volume*)fs; PRINT(("userlandfs_get_vnode(%p, %lld, %p, %d)\n", fs, vnid, node, @@ -413,7 +413,7 @@ userlandfs_write_stat(fs_volume fs, fs_vnode node, const struct stat *st, // userlandfs_create static status_t userlandfs_create(fs_volume fs, fs_vnode dir, const char *name, int openMode, - int perms, fs_cookie *cookie, vnode_id *vnid) + int perms, fs_cookie *cookie, ino_t *vnid) { Volume* volume = (Volume*)fs; PRINT(("userlandfs_create(%p, %p, `%s', %d, %d, %p, %p)\n", fs, dir, @@ -491,7 +491,7 @@ userlandfs_write(fs_volume fs, fs_vnode node, fs_cookie cookie, off_t pos, // userlandfs_create_dir static status_t userlandfs_create_dir(fs_volume fs, fs_vnode parent, const char *name, - int perms, vnode_id *newDir) + int perms, ino_t *newDir) { Volume* volume = (Volume*)fs; PRINT(("userlandfs_create_dir(%p, %p, `%s', %d, %p)\n", fs, parent, name, diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp index a355a5f932..6ccadcc62d 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp @@ -24,7 +24,7 @@ BeOSKernelFileSystem::~BeOSKernelFileSystem() // CreateVolume status_t -BeOSKernelFileSystem::CreateVolume(Volume** volume, mount_id id) +BeOSKernelFileSystem::CreateVolume(Volume** volume, dev_t id) { // check initialization and parameters if (!fFSOps || !volume) diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h index 26a8042bd5..a2ef1a208a 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h @@ -14,7 +14,7 @@ public: BeOSKernelFileSystem(beos_vnode_ops* fsOps); virtual ~BeOSKernelFileSystem(); - virtual status_t CreateVolume(Volume** volume, mount_id id); + virtual status_t CreateVolume(Volume** volume, dev_t id); virtual status_t DeleteVolume(Volume* volume); private: diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp index d5f09011be..1159efc1cc 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp @@ -39,7 +39,7 @@ public: // constructor -BeOSKernelVolume::BeOSKernelVolume(FileSystem* fileSystem, mount_id id, +BeOSKernelVolume::BeOSKernelVolume(FileSystem* fileSystem, dev_t id, beos_vnode_ops* fsOps) : Volume(fileSystem, id), fFSOps(fsOps), @@ -58,7 +58,7 @@ BeOSKernelVolume::~BeOSKernelVolume() // Mount status_t BeOSKernelVolume::Mount(const char* device, uint32 flags, - const char* parameters, vnode_id* rootID) + const char* parameters, ino_t* rootID) { if (!fFSOps->mount) return B_BAD_VALUE; @@ -114,7 +114,7 @@ BeOSKernelVolume::WriteFSInfo(const struct fs_info* info, uint32 mask) // Lookup status_t -BeOSKernelVolume::Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, +BeOSKernelVolume::Lookup(fs_vnode dir, const char* entryName, ino_t* vnid, int* type) { if (!fFSOps->walk) @@ -160,7 +160,7 @@ BeOSKernelVolume::Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, // LookupNoType status_t BeOSKernelVolume::LookupNoType(fs_vnode dir, const char* entryName, - vnode_id* vnid) + ino_t* vnid) { if (!fFSOps->walk) return B_BAD_VALUE; @@ -169,7 +169,7 @@ BeOSKernelVolume::LookupNoType(fs_vnode dir, const char* entryName, // ReadVNode status_t -BeOSKernelVolume::ReadVNode(vnode_id vnid, bool reenter, fs_vnode* node) +BeOSKernelVolume::ReadVNode(ino_t vnid, bool reenter, fs_vnode* node) { if (!fFSOps->read_vnode) return B_BAD_VALUE; @@ -340,7 +340,7 @@ BeOSKernelVolume::WriteStat(fs_vnode node, const struct stat *st, uint32 mask) // Create status_t BeOSKernelVolume::Create(fs_vnode dir, const char* name, int openMode, int mode, - fs_cookie* cookie, vnode_id* vnid) + fs_cookie* cookie, ino_t* vnid) { if (!fFSOps->create) return B_BAD_VALUE; @@ -405,7 +405,7 @@ BeOSKernelVolume::Write(fs_vnode node, fs_cookie cookie, off_t pos, // CreateDir status_t BeOSKernelVolume::CreateDir(fs_vnode dir, const char* name, int mode, - vnode_id *newDir) + ino_t *newDir) { if (!fFSOps->mkdir || !fFSOps->walk) // we need walk() too return B_BAD_VALUE; @@ -415,7 +415,7 @@ BeOSKernelVolume::CreateDir(fs_vnode dir, const char* name, int mode, return error; // we need to get the node ID by invoking walk() - vnode_id id; + ino_t id; error = fFSOps->walk(fVolumeCookie, dir, name, NULL, &id); if (error != B_OK) return error; diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h index c71b5468dd..6f55ecf84a 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h @@ -12,12 +12,12 @@ namespace UserlandFS { class BeOSKernelVolume : public Volume { public: BeOSKernelVolume(FileSystem* fileSystem, - mount_id id, beos_vnode_ops* fsOps); + dev_t id, beos_vnode_ops* fsOps); virtual ~BeOSKernelVolume(); // FS virtual status_t Mount(const char* device, uint32 flags, - const char* parameters, vnode_id* rootID); + const char* parameters, ino_t* rootID); virtual status_t Unmount(); virtual status_t Sync(); virtual status_t ReadFSInfo(fs_info* info); @@ -26,11 +26,11 @@ public: // vnodes virtual status_t Lookup(fs_vnode dir, const char* entryName, - vnode_id* vnid, int* type); + ino_t* vnid, int* type); virtual status_t LookupNoType(fs_vnode dir, - const char* entryName, vnode_id* vnid); + const char* entryName, ino_t* vnid); // not required - virtual status_t ReadVNode(vnode_id vnid, bool reenter, + virtual status_t ReadVNode(ino_t vnid, bool reenter, fs_vnode* node); virtual status_t WriteVNode(fs_vnode node, bool reenter); virtual status_t RemoveVNode(fs_vnode node, bool reenter); @@ -66,7 +66,7 @@ public: // files virtual status_t Create(fs_vnode dir, const char* name, int openMode, int mode, fs_cookie* cookie, - vnode_id* vnid); + ino_t* vnid); virtual status_t Open(fs_vnode node, int openMode, fs_cookie* cookie); virtual status_t Close(fs_vnode node, fs_cookie cookie); @@ -80,7 +80,7 @@ public: // directories virtual status_t CreateDir(fs_vnode dir, const char* name, - int mode, vnode_id *newDir); + int mode, ino_t *newDir); virtual status_t RemoveDir(fs_vnode dir, const char* name); virtual status_t OpenDir(fs_vnode node, fs_cookie* cookie); virtual status_t CloseDir(fs_vnode node, fs_vnode cookie); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h b/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h index 262cb8c855..6ea3295375 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h @@ -17,7 +17,7 @@ public: FileSystem(); virtual ~FileSystem(); - virtual status_t CreateVolume(Volume** volume, mount_id id) = 0; + virtual status_t CreateVolume(Volume** volume, dev_t id) = 0; virtual status_t DeleteVolume(Volume* volume) = 0; void GetCapabilities( diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp index 47ec002700..4b8e759ac8 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp @@ -38,7 +38,7 @@ HaikuKernelFileSystem::Init() // CreateVolume status_t -HaikuKernelFileSystem::CreateVolume(Volume** volume, mount_id id) +HaikuKernelFileSystem::CreateVolume(Volume** volume, dev_t id) { // check initialization and parameters if (!fFSModule || !volume) diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h index c71210fbc7..5b1072ec0e 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h @@ -17,7 +17,7 @@ public: status_t Init(); - virtual status_t CreateVolume(Volume** volume, mount_id id); + virtual status_t CreateVolume(Volume** volume, dev_t id); virtual status_t DeleteVolume(Volume* volume); private: diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp index a77869b95f..66e76a35ad 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp @@ -13,7 +13,7 @@ // constructor -HaikuKernelVolume::HaikuKernelVolume(FileSystem* fileSystem, mount_id id, +HaikuKernelVolume::HaikuKernelVolume(FileSystem* fileSystem, dev_t id, file_system_module_info* fsModule) : Volume(fileSystem, id), fFSModule(fsModule), @@ -32,7 +32,7 @@ HaikuKernelVolume::~HaikuKernelVolume() // Mount status_t HaikuKernelVolume::Mount(const char* device, uint32 flags, - const char* parameters, vnode_id* rootID) + const char* parameters, ino_t* rootID) { if (!fFSModule->mount) return B_BAD_VALUE; @@ -118,7 +118,7 @@ HaikuKernelVolume::GetFileMap(fs_vnode node, off_t offset, size_t size, // Lookup status_t -HaikuKernelVolume::Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, +HaikuKernelVolume::Lookup(fs_vnode dir, const char* entryName, ino_t* vnid, int* type) { if (!fFSModule->lookup) @@ -139,7 +139,7 @@ HaikuKernelVolume::GetVNodeName(fs_vnode node, char* buffer, size_t bufferSize) // ReadVNode status_t -HaikuKernelVolume::ReadVNode(vnode_id vnid, bool reenter, fs_vnode* node) +HaikuKernelVolume::ReadVNode(ino_t vnid, bool reenter, fs_vnode* node) { if (!fFSModule->get_vnode) return B_BAD_VALUE; @@ -304,7 +304,7 @@ HaikuKernelVolume::WriteStat(fs_vnode node, const struct stat *st, uint32 mask) // Create status_t HaikuKernelVolume::Create(fs_vnode dir, const char* name, int openMode, int mode, - fs_cookie* cookie, vnode_id* vnid) + fs_cookie* cookie, ino_t* vnid) { if (!fFSModule->create) return B_BAD_VALUE; @@ -373,7 +373,7 @@ HaikuKernelVolume::Write(fs_vnode node, fs_cookie cookie, off_t pos, // CreateDir status_t HaikuKernelVolume::CreateDir(fs_vnode dir, const char* name, int mode, - vnode_id *newDir) + ino_t *newDir) { if (!fFSModule->create_dir) return B_BAD_VALUE; diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h index 2692b4ed78..de53c2faff 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h @@ -12,13 +12,13 @@ namespace UserlandFS { class HaikuKernelVolume : public Volume { public: HaikuKernelVolume(FileSystem* fileSystem, - mount_id id, + dev_t id, file_system_module_info* fsModule); virtual ~HaikuKernelVolume(); // FS virtual status_t Mount(const char* device, uint32 flags, - const char* parameters, vnode_id* rootID); + const char* parameters, ino_t* rootID); virtual status_t Unmount(); virtual status_t Sync(); virtual status_t ReadFSInfo(fs_info* info); @@ -32,10 +32,10 @@ public: // vnodes virtual status_t Lookup(fs_vnode dir, const char* entryName, - vnode_id* vnid, int* type); + ino_t* vnid, int* type); virtual status_t GetVNodeName(fs_vnode node, char* buffer, size_t bufferSize); - virtual status_t ReadVNode(vnode_id vnid, bool reenter, + virtual status_t ReadVNode(ino_t vnid, bool reenter, fs_vnode* node); virtual status_t WriteVNode(fs_vnode node, bool reenter); virtual status_t RemoveVNode(fs_vnode node, bool reenter); @@ -71,7 +71,7 @@ public: // files virtual status_t Create(fs_vnode dir, const char* name, int openMode, int mode, fs_cookie* cookie, - vnode_id* vnid); + ino_t* vnid); virtual status_t Open(fs_vnode node, int openMode, fs_cookie* cookie); virtual status_t Close(fs_vnode node, fs_cookie cookie); @@ -85,7 +85,7 @@ public: // directories virtual status_t CreateDir(fs_vnode dir, const char* name, - int mode, vnode_id *newDir); + int mode, ino_t *newDir); virtual status_t RemoveDir(fs_vnode dir, const char* name); virtual status_t OpenDir(fs_vnode node, fs_cookie* cookie); virtual status_t CloseDir(fs_vnode node, fs_vnode cookie); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp index 957464bafc..247b6cf208 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp @@ -234,7 +234,7 @@ UserlandRequestHandler::_HandleRequest(MountVolumeRequest* request) result = fFileSystem->CreateVolume(&volume, request->nsid); // mount it - vnode_id rootID; + ino_t rootID; if (result == B_OK) { RequestThreadContext context(volume); result = volume->Mount(device, request->flags, @@ -377,7 +377,7 @@ UserlandRequestHandler::_HandleRequest(LookupRequest* request) if (!volume) result = B_BAD_VALUE; - vnode_id vnid = 0; + ino_t vnid = 0; int type = 0; if (result == B_OK) { RequestThreadContext context(volume); @@ -959,7 +959,7 @@ UserlandRequestHandler::_HandleRequest(CreateRequest* request) if (!volume) result = B_BAD_VALUE; - vnode_id vnid; + ino_t vnid; fs_cookie fileCookie; if (result == B_OK) { RequestThreadContext context(volume); @@ -1159,7 +1159,7 @@ UserlandRequestHandler::_HandleRequest(CreateDirRequest* request) if (!volume) result = B_BAD_VALUE; - vnode_id newDir = 0; + ino_t newDir = 0; if (result == B_OK) { RequestThreadContext context(volume); result = volume->CreateDir(request->node, diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/Volume.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/Volume.cpp index 7f624c7547..5d8eac90ec 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/Volume.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/Volume.cpp @@ -9,7 +9,7 @@ #include "kernel_emu.h" // constructor -Volume::Volume(FileSystem* fileSystem, mount_id id) +Volume::Volume(FileSystem* fileSystem, dev_t id) : fFileSystem(fileSystem), fID(id) { @@ -28,7 +28,7 @@ Volume::GetFileSystem() const } // GetID -mount_id +dev_t Volume::GetID() const { return fID; @@ -41,7 +41,7 @@ Volume::GetID() const // Mount status_t Volume::Mount(const char* device, uint32 flags, const char* parameters, - vnode_id* rootID) + ino_t* rootID) { return B_BAD_VALUE; } @@ -80,14 +80,14 @@ Volume::WriteFSInfo(const struct fs_info* info, uint32 mask) // Lookup status_t -Volume::Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, int* type) +Volume::Lookup(fs_vnode dir, const char* entryName, ino_t* vnid, int* type) { return B_BAD_VALUE; } // LookupNoType status_t -Volume::LookupNoType(fs_vnode dir, const char* entryName, vnode_id* vnid) +Volume::LookupNoType(fs_vnode dir, const char* entryName, ino_t* vnid) { int type; return Lookup(dir, entryName, vnid, &type); @@ -104,7 +104,7 @@ Volume::GetVNodeName(fs_vnode node, char* buffer, size_t bufferSize) return error; // look up the parent directory - vnode_id parentID; + ino_t parentID; error = LookupNoType(node, "..", &parentID); if (error != B_OK) return error; @@ -163,7 +163,7 @@ Volume::GetVNodeName(fs_vnode node, char* buffer, size_t bufferSize) // ReadVNode status_t -Volume::ReadVNode(vnode_id vnid, bool reenter, fs_vnode* node) +Volume::ReadVNode(ino_t vnid, bool reenter, fs_vnode* node) { return B_BAD_VALUE; } @@ -289,7 +289,7 @@ Volume::WriteStat(fs_vnode node, const struct stat *st, uint32 mask) // Create status_t Volume::Create(fs_vnode dir, const char* name, int openMode, int mode, - fs_cookie* cookie, vnode_id* vnid) + fs_cookie* cookie, ino_t* vnid) { return B_BAD_VALUE; } @@ -337,7 +337,7 @@ Volume::Write(fs_vnode node, fs_cookie cookie, off_t pos, const void* buffer, // CreateDir status_t -Volume::CreateDir(fs_vnode dir, const char* name, int mode, vnode_id *newDir) +Volume::CreateDir(fs_vnode dir, const char* name, int mode, ino_t *newDir) { return B_BAD_VALUE; } diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/Volume.h b/src/add-ons/kernel/file_systems/userlandfs/server/Volume.h index af86a39b33..2006e438ff 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/Volume.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/Volume.h @@ -12,15 +12,15 @@ class FileSystem; class Volume { public: - Volume(FileSystem* fileSystem, mount_id id); + Volume(FileSystem* fileSystem, dev_t id); virtual ~Volume(); FileSystem* GetFileSystem() const; - mount_id GetID() const; + dev_t GetID() const; // FS virtual status_t Mount(const char* device, uint32 flags, - const char* parameters, vnode_id* rootID); + const char* parameters, ino_t* rootID); virtual status_t Unmount(); virtual status_t Sync(); virtual status_t ReadFSInfo(fs_info* info); @@ -29,13 +29,13 @@ public: // vnodes virtual status_t Lookup(fs_vnode dir, const char* entryName, - vnode_id* vnid, int* type); + ino_t* vnid, int* type); virtual status_t LookupNoType(fs_vnode dir, - const char* entryName, vnode_id* vnid); + const char* entryName, ino_t* vnid); // not required virtual status_t GetVNodeName(fs_vnode node, char* buffer, size_t bufferSize); - virtual status_t ReadVNode(vnode_id vnid, bool reenter, + virtual status_t ReadVNode(ino_t vnid, bool reenter, fs_vnode* node); virtual status_t WriteVNode(fs_vnode node, bool reenter); virtual status_t RemoveVNode(fs_vnode node, bool reenter); @@ -71,7 +71,7 @@ public: // files virtual status_t Create(fs_vnode dir, const char* name, int openMode, int mode, fs_cookie* cookie, - vnode_id* vnid); + ino_t* vnid); virtual status_t Open(fs_vnode node, int openMode, fs_cookie* cookie); virtual status_t Close(fs_vnode node, fs_cookie cookie); @@ -85,7 +85,7 @@ public: // directories virtual status_t CreateDir(fs_vnode dir, const char* name, - int mode, vnode_id *newDir); + int mode, ino_t *newDir); virtual status_t RemoveDir(fs_vnode dir, const char* name); virtual status_t OpenDir(fs_vnode node, fs_cookie* cookie); virtual status_t CloseDir(fs_vnode node, fs_vnode cookie); @@ -155,7 +155,7 @@ public: protected: FileSystem* fFileSystem; - mount_id fID; + dev_t fID; }; } // namespace UserlandFS diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/beos_fs_interface.h b/src/add-ons/kernel/file_systems/userlandfs/server/beos_fs_interface.h index 99368bedb9..cb20071294 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/beos_fs_interface.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/beos_fs_interface.h @@ -74,18 +74,18 @@ typedef struct beos_index_info { // FS interface hook types -typedef int beos_op_read_vnode(void *ns, vnode_id vnid, char r, void **node); +typedef int beos_op_read_vnode(void *ns, ino_t vnid, char r, void **node); typedef int beos_op_write_vnode(void *ns, void *node, char r); typedef int beos_op_remove_vnode(void *ns, void *node, char r); typedef int beos_op_secure_vnode(void *ns, void *node); typedef int beos_op_walk(void *ns, void *base, const char *file, char **newpath, - vnode_id *vnid); + ino_t *vnid); typedef int beos_op_access(void *ns, void *node, int mode); typedef int beos_op_create(void *ns, void *dir, const char *name, - int omode, int perms, vnode_id *vnid, void **cookie); + int omode, int perms, ino_t *vnid, void **cookie); typedef int beos_op_mkdir(void *ns, void *dir, const char *name, int perms); typedef int beos_op_symlink(void *ns, void *dir, const char *name, const char *path); @@ -130,8 +130,8 @@ typedef int beos_op_deselect(void *ns, void *node, void *cookie, uint8 event, selectsync *sync); typedef int beos_op_initialize(const char *devname, void *parms, size_t len); -typedef int beos_op_mount(mount_id nsid, const char *devname, ulong flags, - void *parms, size_t len, void **data, vnode_id *vnid); +typedef int beos_op_mount(dev_t nsid, const char *devname, ulong flags, + void *parms, size_t len, void **data, ino_t *vnid); typedef int beos_op_unmount(void *ns); typedef int beos_op_sync(void *ns); typedef int beos_op_rfsstat(void *ns, struct beos_fs_info *); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp index f1dec803e8..e15f99257d 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp @@ -39,8 +39,8 @@ free_path(char *p) // notify_listener int -notify_listener(int op, nspace_id nsid, vnode_id vnida, vnode_id vnidb, - vnode_id vnidc, const char *name) +notify_listener(int op, nspace_id nsid, ino_t vnida, ino_t vnidb, + ino_t vnidc, const char *name) { switch (op) { case B_ENTRY_CREATED: @@ -88,8 +88,8 @@ notify_select_event(selectsync *sync, uint32 ref) // send_notification int send_notification(port_id port, long token, ulong what, long op, - nspace_id nsida, nspace_id /*nsidb*/, vnode_id vnida, vnode_id vnidb, - vnode_id vnidc, const char *name) + nspace_id nsida, nspace_id /*nsidb*/, ino_t vnida, ino_t vnidb, + ino_t vnidc, const char *name) { if (what != B_QUERY_UPDATE) return B_BAD_VALUE; @@ -127,21 +127,21 @@ send_notification(port_id port, long token, ulong what, long op, // get_vnode int -get_vnode(nspace_id nsid, vnode_id vnid, void **data) +get_vnode(nspace_id nsid, ino_t vnid, void **data) { return UserlandFS::KernelEmu::get_vnode(nsid, vnid, data); } // put_vnode int -put_vnode(nspace_id nsid, vnode_id vnid) +put_vnode(nspace_id nsid, ino_t vnid) { return UserlandFS::KernelEmu::put_vnode(nsid, vnid); } // new_vnode int -new_vnode(nspace_id nsid, vnode_id vnid, void *data) +new_vnode(nspace_id nsid, ino_t vnid, void *data) { // The semantics of new_vnode() has changed. The new publish_vnode() // should work like the former new_vnode(). @@ -150,21 +150,21 @@ new_vnode(nspace_id nsid, vnode_id vnid, void *data) // remove_vnode int -remove_vnode(nspace_id nsid, vnode_id vnid) +remove_vnode(nspace_id nsid, ino_t vnid) { return UserlandFS::KernelEmu::remove_vnode(nsid, vnid); } // unremove_vnode int -unremove_vnode(nspace_id nsid, vnode_id vnid) +unremove_vnode(nspace_id nsid, ino_t vnid) { return UserlandFS::KernelEmu::unremove_vnode(nsid, vnid); } // is_vnode_removed int -is_vnode_removed(nspace_id nsid, vnode_id vnid) +is_vnode_removed(nspace_id nsid, ino_t vnid) { bool removed; status_t error = UserlandFS::KernelEmu::get_vnode_removed(nsid, vnid, diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_file_cache.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_file_cache.cpp index f28756f40d..f8676b4ca5 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_file_cache.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_file_cache.cpp @@ -187,7 +187,7 @@ static status_t vfs_write_pages(int fd, off_t pos, const iovec *vecs, static status_t vfs_get_file_map(file_cache_ref *cache, off_t offset, size_t size, struct file_io_vec *vecs, size_t *_count); -static HaikuKernelVolume* file_cache_get_volume(mount_id mountID); +static HaikuKernelVolume* file_cache_get_volume(dev_t mountID); static status_t pages_io(file_cache_ref *ref, off_t offset, const iovec *vecs, size_t count, size_t *_numBytes, bool doWrite); @@ -203,8 +203,8 @@ typedef DoublyLinkedListcache->deviceFD : key->deviceFD); - vnode_id id = (page ? page->cache->nodeID : key->nodeID); + ino_t id = (page ? page->cache->nodeID : key->nodeID); off_t offset = (page ? page->offset : key->offset); uint32 value = fd; @@ -925,7 +925,7 @@ file_cache_unregister_volume(HaikuKernelVolume* volume) static HaikuKernelVolume* -file_cache_get_volume(mount_id mountID) +file_cache_get_volume(dev_t mountID) { MutexLocker _(sVolumeListLock); @@ -1818,7 +1818,7 @@ cache_io(void *_cacheRef, off_t offset, addr_t buffer, size_t *_size, bool doWri void * -file_cache_create(mount_id mountID, vnode_id vnodeID, off_t size, int fd) +file_cache_create(dev_t mountID, ino_t vnodeID, off_t size, int fd) { TRACE(("file_cache_create(mountID = %ld, vnodeID = %Ld, size = %Ld, fd = %d)\n", mountID, vnodeID, size, fd)); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_fs_cache.h b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_fs_cache.h index f0c98cdd85..352c048f51 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_fs_cache.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_fs_cache.h @@ -57,7 +57,7 @@ extern status_t block_cache_set_dirty(void *_cache, off_t blockNumber, extern void block_cache_put(void *_cache, off_t blockNumber); /* file cache */ -extern void *file_cache_create(mount_id mountID, vnode_id vnodeID, off_t size, +extern void *file_cache_create(dev_t mountID, ino_t vnodeID, off_t size, int fd); extern void file_cache_delete(void *_cacheRef); extern status_t file_cache_set_size(void *_cacheRef, off_t size); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp index 9904b06020..c226962831 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp @@ -19,8 +19,8 @@ // notify_entry_created status_t -notify_entry_created(mount_id device, vnode_id directory, const char *name, - vnode_id node) +notify_entry_created(dev_t device, ino_t directory, const char *name, + ino_t node) { if (!name) return B_BAD_VALUE; @@ -31,8 +31,8 @@ notify_entry_created(mount_id device, vnode_id directory, const char *name, // notify_entry_removed status_t -notify_entry_removed(mount_id device, vnode_id directory, const char *name, - vnode_id node) +notify_entry_removed(dev_t device, ino_t directory, const char *name, + ino_t node) { if (!name) return B_BAD_VALUE; @@ -43,9 +43,9 @@ notify_entry_removed(mount_id device, vnode_id directory, const char *name, // notify_entry_moved status_t -notify_entry_moved(mount_id device, vnode_id fromDirectory, - const char *fromName, vnode_id toDirectory, const char *toName, - vnode_id node) +notify_entry_moved(dev_t device, ino_t fromDirectory, + const char *fromName, ino_t toDirectory, const char *toName, + ino_t node) { if (!fromName || !toName) return B_BAD_VALUE; @@ -56,7 +56,7 @@ notify_entry_moved(mount_id device, vnode_id fromDirectory, // notify_stat_changed status_t -notify_stat_changed(mount_id device, vnode_id node, uint32 statFields) +notify_stat_changed(dev_t device, ino_t node, uint32 statFields) { return UserlandFS::KernelEmu::notify_listener(B_STAT_CHANGED, statFields, device, 0, 0, node, NULL, NULL); @@ -64,7 +64,7 @@ notify_stat_changed(mount_id device, vnode_id node, uint32 statFields) // notify_attribute_changed status_t -notify_attribute_changed(mount_id device, vnode_id node, const char *attribute, +notify_attribute_changed(dev_t device, ino_t node, const char *attribute, int32 cause) { if (!attribute) @@ -83,8 +83,8 @@ notify_select_event(selectsync *sync, uint32 ref, uint8 event) // notify_query_entry_created status_t -notify_query_entry_created(port_id port, int32 token, mount_id device, - vnode_id directory, const char *name, vnode_id node) +notify_query_entry_created(port_id port, int32 token, dev_t device, + ino_t directory, const char *name, ino_t node) { if (!name) return B_BAD_VALUE; @@ -95,8 +95,8 @@ notify_query_entry_created(port_id port, int32 token, mount_id device, // notify_query_entry_removed status_t -notify_query_entry_removed(port_id port, int32 token, mount_id device, - vnode_id directory, const char *name, vnode_id node) +notify_query_entry_removed(port_id port, int32 token, dev_t device, + ino_t directory, const char *name, ino_t node) { if (!name) return B_BAD_VALUE; @@ -111,49 +111,49 @@ notify_query_entry_removed(port_id port, int32 token, mount_id device, // new_vnode status_t -new_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode privateNode) +new_vnode(dev_t mountID, ino_t vnodeID, fs_vnode privateNode) { return UserlandFS::KernelEmu::publish_vnode(mountID, vnodeID, privateNode); } // publish_vnode status_t -publish_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode privateNode) +publish_vnode(dev_t mountID, ino_t vnodeID, fs_vnode privateNode) { return UserlandFS::KernelEmu::publish_vnode(mountID, vnodeID, privateNode); } // get_vnode status_t -get_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode *privateNode) +get_vnode(dev_t mountID, ino_t vnodeID, fs_vnode *privateNode) { return UserlandFS::KernelEmu::get_vnode(mountID, vnodeID, privateNode); } // put_vnode status_t -put_vnode(mount_id mountID, vnode_id vnodeID) +put_vnode(dev_t mountID, ino_t vnodeID) { return UserlandFS::KernelEmu::put_vnode(mountID, vnodeID); } // remove_vnode status_t -remove_vnode(mount_id mountID, vnode_id vnodeID) +remove_vnode(dev_t mountID, ino_t vnodeID) { return UserlandFS::KernelEmu::remove_vnode(mountID, vnodeID); } // unremove_vnode status_t -unremove_vnode(mount_id mountID, vnode_id vnodeID) +unremove_vnode(dev_t mountID, ino_t vnodeID) { return UserlandFS::KernelEmu::unremove_vnode(mountID, vnodeID); } // get_vnode_removed status_t -get_vnode_removed(mount_id mountID, vnode_id vnodeID, bool* removed) +get_vnode_removed(dev_t mountID, ino_t vnodeID, bool* removed) { return UserlandFS::KernelEmu::get_vnode_removed(mountID, vnodeID, removed); } @@ -342,7 +342,7 @@ block_cache_put(void *_cache, off_t blockNumber) // file_cache_create void * -file_cache_create(mount_id mountID, vnode_id vnodeID, off_t size, int fd) +file_cache_create(dev_t mountID, ino_t vnodeID, off_t size, int fd) { return UserlandFS::HaikuKernelEmu::file_cache_create(mountID, vnodeID, size, fd); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp index 9c8623d1c8..b755bc7dce 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp @@ -124,8 +124,8 @@ get_port_and_fs(RequestPort** port, FileSystem** fileSystem) // notify_listener status_t UserlandFS::KernelEmu::notify_listener(int32 operation, uint32 details, - mount_id device, vnode_id oldDirectory, vnode_id directory, - vnode_id node, const char* oldName, const char* name) + dev_t device, ino_t oldDirectory, ino_t directory, + ino_t node, const char* oldName, const char* name) { // get the request port and the file system RequestPort* port; @@ -209,8 +209,8 @@ UserlandFS::KernelEmu::notify_select_event(selectsync *sync, uint32 ref, // send_notification status_t UserlandFS::KernelEmu::notify_query(port_id targetPort, int32 token, - int32 operation, mount_id device, vnode_id directory, const char* name, - vnode_id node) + int32 operation, dev_t device, ino_t directory, const char* name, + ino_t node) { // get the request port and the file system RequestPort* port; @@ -256,7 +256,7 @@ UserlandFS::KernelEmu::notify_query(port_id targetPort, int32 token, // get_vnode status_t -UserlandFS::KernelEmu::get_vnode(mount_id nsid, vnode_id vnid, fs_vnode* data) +UserlandFS::KernelEmu::get_vnode(dev_t nsid, ino_t vnid, fs_vnode* data) { // get the request port and the file system RequestPort* port; @@ -292,7 +292,7 @@ UserlandFS::KernelEmu::get_vnode(mount_id nsid, vnode_id vnid, fs_vnode* data) // put_vnode status_t -UserlandFS::KernelEmu::put_vnode(mount_id nsid, vnode_id vnid) +UserlandFS::KernelEmu::put_vnode(dev_t nsid, ino_t vnid) { // get the request port and the file system RequestPort* port; @@ -327,7 +327,7 @@ UserlandFS::KernelEmu::put_vnode(mount_id nsid, vnode_id vnid) // new_vnode status_t -UserlandFS::KernelEmu::new_vnode(mount_id nsid, vnode_id vnid, fs_vnode data) +UserlandFS::KernelEmu::new_vnode(dev_t nsid, ino_t vnid, fs_vnode data) { // get the request port and the file system RequestPort* port; @@ -363,7 +363,7 @@ UserlandFS::KernelEmu::new_vnode(mount_id nsid, vnode_id vnid, fs_vnode data) // publish_vnode status_t -UserlandFS::KernelEmu::publish_vnode(mount_id nsid, vnode_id vnid, +UserlandFS::KernelEmu::publish_vnode(dev_t nsid, ino_t vnid, fs_vnode data) { // get the request port and the file system @@ -400,7 +400,7 @@ UserlandFS::KernelEmu::publish_vnode(mount_id nsid, vnode_id vnid, // remove_vnode status_t -UserlandFS::KernelEmu::remove_vnode(mount_id nsid, vnode_id vnid) +UserlandFS::KernelEmu::remove_vnode(dev_t nsid, ino_t vnid) { // get the request port and the file system RequestPort* port; @@ -435,7 +435,7 @@ UserlandFS::KernelEmu::remove_vnode(mount_id nsid, vnode_id vnid) // unremove_vnode status_t -UserlandFS::KernelEmu::unremove_vnode(mount_id nsid, vnode_id vnid) +UserlandFS::KernelEmu::unremove_vnode(dev_t nsid, ino_t vnid) { // get the request port and the file system RequestPort* port; @@ -470,7 +470,7 @@ UserlandFS::KernelEmu::unremove_vnode(mount_id nsid, vnode_id vnid) // get_vnode_removed status_t -UserlandFS::KernelEmu::get_vnode_removed(mount_id nsid, vnode_id vnid, +UserlandFS::KernelEmu::get_vnode_removed(dev_t nsid, ino_t vnid, bool* removed) { // get the request port and the file system diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h index a2b4dfd901..ab71cb170a 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h @@ -9,28 +9,26 @@ struct selectsync; namespace UserlandFS { namespace KernelEmu { -typedef int32 mount_id; -typedef int64 vnode_id; typedef void* fs_vnode; int new_path(const char *path, char **copy); void free_path(char *p); -status_t notify_listener(int32 operation, uint32 details, mount_id device, - vnode_id oldDirectory, vnode_id directory, vnode_id node, +status_t notify_listener(int32 operation, uint32 details, dev_t device, + ino_t oldDirectory, ino_t directory, ino_t node, const char* oldName, const char* name); status_t notify_select_event(selectsync *sync, uint32 ref, uint8 event, bool unspecifiedEvent); status_t notify_query(port_id port, int32 token, int32 operation, - mount_id device, vnode_id directory, const char* name, vnode_id node); + dev_t device, ino_t directory, const char* name, ino_t node); -status_t get_vnode(mount_id nsid, vnode_id vnid, fs_vnode* data); -status_t put_vnode(mount_id nsid, vnode_id vnid); -status_t new_vnode(mount_id nsid, vnode_id vnid, fs_vnode data); -status_t publish_vnode(mount_id nsid, vnode_id vnid, fs_vnode data); -status_t remove_vnode(mount_id nsid, vnode_id vnid); -status_t unremove_vnode(mount_id nsid, vnode_id vnid); -status_t get_vnode_removed(mount_id nsid, vnode_id vnid, bool* removed); +status_t get_vnode(dev_t nsid, ino_t vnid, fs_vnode* data); +status_t put_vnode(dev_t nsid, ino_t vnid); +status_t new_vnode(dev_t nsid, ino_t vnid, fs_vnode data); +status_t publish_vnode(dev_t nsid, ino_t vnid, fs_vnode data); +status_t remove_vnode(dev_t nsid, ino_t vnid); +status_t unremove_vnode(dev_t nsid, ino_t vnid); +status_t get_vnode_removed(dev_t nsid, ino_t vnid, bool* removed); void kernel_debugger(const char *message); void vpanic(const char *format, va_list args); diff --git a/src/system/kernel/cache/file_cache.cpp b/src/system/kernel/cache/file_cache.cpp index b59e81cf0e..bd869b35b9 100644 --- a/src/system/kernel/cache/file_cache.cpp +++ b/src/system/kernel/cache/file_cache.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -1142,7 +1142,7 @@ out: extern "C" void -cache_prefetch(mount_id mountID, vnode_id vnodeID, off_t offset, size_t size) +cache_prefetch(dev_t mountID, ino_t vnodeID, off_t offset, size_t size) { void *vnode; @@ -1160,8 +1160,8 @@ cache_prefetch(mount_id mountID, vnode_id vnodeID, off_t offset, size_t size) extern "C" void -cache_node_opened(void *vnode, int32 fdType, vm_cache_ref *cache, mount_id mountID, - vnode_id parentID, vnode_id vnodeID, const char *name) +cache_node_opened(void *vnode, int32 fdType, vm_cache_ref *cache, dev_t mountID, + ino_t parentID, ino_t vnodeID, const char *name) { if (sCacheModule == NULL || sCacheModule->node_opened == NULL) return; @@ -1179,7 +1179,7 @@ cache_node_opened(void *vnode, int32 fdType, vm_cache_ref *cache, mount_id mount extern "C" void cache_node_closed(void *vnode, int32 fdType, vm_cache_ref *cache, - mount_id mountID, vnode_id vnodeID) + dev_t mountID, ino_t vnodeID) { if (sCacheModule == NULL || sCacheModule->node_closed == NULL) return; @@ -1229,7 +1229,7 @@ file_cache_init(void) extern "C" void * -file_cache_create(mount_id mountID, vnode_id vnodeID, off_t size, int fd) +file_cache_create(dev_t mountID, ino_t vnodeID, off_t size, int fd) { TRACE(("file_cache_create(mountID = %ld, vnodeID = %Ld, size = %Ld, fd = %d)\n", mountID, vnodeID, size, fd)); diff --git a/src/system/kernel/fs/devfs.cpp b/src/system/kernel/fs/devfs.cpp index 2f84cadce8..3bb2cdcb00 100644 --- a/src/system/kernel/fs/devfs.cpp +++ b/src/system/kernel/fs/devfs.cpp @@ -81,7 +81,7 @@ struct devfs_stream { struct devfs_vnode { struct devfs_vnode *all_next; - vnode_id id; + ino_t id; char *name; time_t modification_time; time_t creation_time; @@ -95,7 +95,7 @@ struct devfs_vnode { #define DEVFS_HASH_SIZE 16 struct devfs { - mount_id id; + dev_t id; recursive_lock lock; int32 next_vnode_id; hash_table *vnode_hash; @@ -124,8 +124,8 @@ enum { struct driver_entry { driver_entry *next; const char *path; - mount_id device; - vnode_id node; + dev_t device; + ino_t node; time_t last_modified; image_id image; }; @@ -148,7 +148,7 @@ static uint32 driver_entry_hash(void *_driver, const void *_key, uint32 range) { driver_entry *driver = (driver_entry *)_driver; - const vnode_id *key = (const vnode_id *)_key; + const ino_t *key = (const ino_t *)_key; if (driver != NULL) return driver->node % range; @@ -161,7 +161,7 @@ static int driver_entry_compare(void *_driver, const void *_key) { driver_entry *driver = (driver_entry *)_driver; - const vnode_id *key = (const vnode_id *)_key; + const ino_t *key = (const ino_t *)_key; if (driver->node == *key) return 0; @@ -349,7 +349,7 @@ static uint32 devfs_vnode_hash(void *_vnode, const void *_key, uint32 range) { struct devfs_vnode *vnode = (struct devfs_vnode *)_vnode; - const vnode_id *key = (const vnode_id *)_key; + const ino_t *key = (const ino_t *)_key; if (vnode != NULL) return vnode->id % range; @@ -362,7 +362,7 @@ static int devfs_vnode_compare(void *_vnode, const void *_key) { struct devfs_vnode *vnode = (struct devfs_vnode *)_vnode; - const vnode_id *key = (const vnode_id *)_key; + const ino_t *key = (const ino_t *)_key; if (vnode->id == *key) return 0; @@ -968,8 +968,8 @@ dump_node(int argc, char **argv) static status_t -devfs_mount(mount_id id, const char *devfs, uint32 flags, const char *args, - fs_volume *_fs, vnode_id *root_vnid) +devfs_mount(dev_t id, const char *devfs, uint32 flags, const char *args, + fs_volume *_fs, ino_t *root_vnid) { struct devfs_vnode *vnode; struct devfs *fs; @@ -1087,7 +1087,7 @@ devfs_sync(fs_volume fs) static status_t -devfs_lookup(fs_volume _fs, fs_vnode _dir, const char *name, vnode_id *_id, int *_type) +devfs_lookup(fs_volume _fs, fs_vnode _dir, const char *name, ino_t *_id, int *_type) { struct devfs *fs = (struct devfs *)_fs; struct devfs_vnode *dir = (struct devfs_vnode *)_dir; @@ -1159,7 +1159,7 @@ devfs_get_vnode_name(fs_volume _fs, fs_vnode _vnode, char *buffer, size_t buffer static status_t -devfs_get_vnode(fs_volume _fs, vnode_id id, fs_vnode *_vnode, bool reenter) +devfs_get_vnode(fs_volume _fs, ino_t id, fs_vnode *_vnode, bool reenter) { struct devfs *fs = (struct devfs *)_fs; struct devfs_vnode *vnode; @@ -1220,7 +1220,7 @@ devfs_remove_vnode(fs_volume _fs, fs_vnode _v, bool reenter) static status_t devfs_create(fs_volume _fs, fs_vnode _dir, const char *name, int openMode, int perms, - fs_cookie *_cookie, vnode_id *_newVnodeID) + fs_cookie *_cookie, ino_t *_newVnodeID) { struct devfs_vnode *dir = (struct devfs_vnode *)_dir; struct devfs *fs = (struct devfs *)_fs; @@ -1449,7 +1449,7 @@ devfs_write(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, off_t pos, static status_t devfs_create_dir(fs_volume _fs, fs_vnode _dir, const char *name, - int perms, vnode_id *_newVnodeID) + int perms, ino_t *_newVnodeID) { struct devfs *fs = (struct devfs *)_fs; struct devfs_vnode *dir = (struct devfs_vnode *)_dir; diff --git a/src/system/kernel/fs/node_monitor.cpp b/src/system/kernel/fs/node_monitor.cpp index e10589acf8..24876e32d6 100644 --- a/src/system/kernel/fs/node_monitor.cpp +++ b/src/system/kernel/fs/node_monitor.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -50,14 +50,14 @@ struct monitor_listener { struct node_monitor { node_monitor *next; - mount_id device; - vnode_id node; + dev_t device; + ino_t node; struct list listeners; }; struct monitor_hash_key { - mount_id device; - vnode_id node; + dev_t device; + ino_t node; }; struct interested_monitor_listener_list { @@ -106,7 +106,7 @@ monitor_hash(void *_monitor, const void *_key, uint32 range) */ static node_monitor * -get_monitor_for(mount_id device, vnode_id node) +get_monitor_for(dev_t device, ino_t node) { struct monitor_hash_key key; key.device = device; @@ -171,7 +171,7 @@ remove_listener(monitor_listener *listener) static status_t -add_node_monitor(io_context *context, mount_id device, vnode_id node, +add_node_monitor(io_context *context, dev_t device, ino_t node, uint32 flags, port_id port, uint32 token) { monitor_listener *listener; @@ -255,7 +255,7 @@ out: static status_t -remove_node_monitor(struct io_context *context, mount_id device, vnode_id node, +remove_node_monitor(struct io_context *context, dev_t device, ino_t node, uint32 flags, port_id port, uint32 token) { monitor_listener *listener; @@ -348,7 +348,7 @@ remove_node_monitors_by_target(struct io_context *context, port_id port, uint32 */ static void -get_interested_monitor_listeners(mount_id device, vnode_id node, +get_interested_monitor_listeners(dev_t device, ino_t node, uint32 flags, interested_monitor_listener_list *interestedListeners, int32 &interestedListenerCount) { @@ -443,8 +443,8 @@ send_notification_message(KMessage &message, */ static status_t -notify_entry_created_or_removed(int32 opcode, mount_id device, - vnode_id directory, const char *name, vnode_id node) +notify_entry_created_or_removed(int32 opcode, dev_t device, + ino_t directory, const char *name, ino_t node) { if (!name) return B_BAD_VALUE; @@ -497,7 +497,7 @@ notify_entry_created_or_removed(int32 opcode, mount_id device, static status_t notify_query_entry_created_or_removed(int32 opcode, port_id port, int32 token, - mount_id device, vnode_id directory, const char *name, vnode_id node) + dev_t device, ino_t directory, const char *name, ino_t node) { if (!name) return B_BAD_VALUE; @@ -554,7 +554,7 @@ node_monitor_init(void) status_t -notify_unmount(mount_id device) +notify_unmount(dev_t device) { TRACE(("unmounted device: %ld\n", device)); @@ -584,7 +584,7 @@ notify_unmount(mount_id device) status_t -notify_mount(mount_id device, mount_id parentDevice, vnode_id parentDirectory) +notify_mount(dev_t device, dev_t parentDevice, ino_t parentDirectory) { TRACE(("mounted device: %ld, parent %ld:%Ld\n", device, parentDevice, parentDirectory)); @@ -684,8 +684,8 @@ stop_notifying(port_id port, uint32 token) status_t -notify_listener(int op, mount_id device, vnode_id parentNode, vnode_id toParentNode, - vnode_id node, const char *name) +notify_listener(int op, dev_t device, ino_t parentNode, ino_t toParentNode, + ino_t node, const char *name) { TRACE(("notify_listener(op = %d, device = %ld, node = %Ld, parent = %Ld, toParent = %Ld" ", name = \"%s\"\n", op, device, node, parentNode, toParentNode, name)); @@ -732,8 +732,8 @@ notify_listener(int op, mount_id device, vnode_id parentNode, vnode_id toParentN */ status_t -notify_entry_created(mount_id device, vnode_id directory, const char *name, - vnode_id node) +notify_entry_created(dev_t device, ino_t directory, const char *name, + ino_t node) { return notify_entry_created_or_removed(B_ENTRY_CREATED, device, directory, name, node); @@ -751,8 +751,8 @@ notify_entry_created(mount_id device, vnode_id directory, const char *name, */ status_t -notify_entry_removed(mount_id device, vnode_id directory, const char *name, - vnode_id node) +notify_entry_removed(dev_t device, ino_t directory, const char *name, + ino_t node) { return notify_entry_created_or_removed(B_ENTRY_REMOVED, device, directory, name, node); @@ -772,16 +772,16 @@ notify_entry_removed(mount_id device, vnode_id directory, const char *name, */ status_t -notify_entry_moved(mount_id device, vnode_id fromDirectory, - const char *fromName, vnode_id toDirectory, const char *toName, - vnode_id node) +notify_entry_moved(dev_t device, ino_t fromDirectory, + const char *fromName, ino_t toDirectory, const char *toName, + ino_t node) { if (!fromName || !toName) return B_BAD_VALUE; // If node is a mount point, we need to resolve it to the mounted // volume's root node. - mount_id nodeDevice = device; + dev_t nodeDevice = device; resolve_mount_point_to_volume_root(device, node, &nodeDevice, &node); MutexLocker locker(gMonitorMutex); @@ -835,7 +835,7 @@ notify_entry_moved(mount_id device, vnode_id fromDirectory, */ status_t -notify_stat_changed(mount_id device, vnode_id node, uint32 statFields) +notify_stat_changed(dev_t device, ino_t node, uint32 statFields) { MutexLocker locker(gMonitorMutex); @@ -875,7 +875,7 @@ notify_stat_changed(mount_id device, vnode_id node, uint32 statFields) */ status_t -notify_attribute_changed(mount_id device, vnode_id node, const char *attribute, +notify_attribute_changed(dev_t device, ino_t node, const char *attribute, int32 cause) { if (!attribute) @@ -922,8 +922,8 @@ notify_attribute_changed(mount_id device, vnode_id node, const char *attribute, */ status_t -notify_query_entry_created(port_id port, int32 token, mount_id device, - vnode_id directory, const char *name, vnode_id node) +notify_query_entry_created(port_id port, int32 token, dev_t device, + ino_t directory, const char *name, ino_t node) { return notify_query_entry_created_or_removed(B_ENTRY_CREATED, port, token, device, directory, name, node); @@ -944,8 +944,8 @@ notify_query_entry_created(port_id port, int32 token, mount_id device, */ status_t -notify_query_entry_removed(port_id port, int32 token, - mount_id device, vnode_id directory, const char *name, vnode_id node) +notify_query_entry_removed(port_id port, int32 token, dev_t device, + ino_t directory, const char *name, ino_t node) { return notify_query_entry_created_or_removed(B_ENTRY_REMOVED, port, token, device, directory, name, node); diff --git a/src/system/kernel/fs/pipefs.cpp b/src/system/kernel/fs/pipefs.cpp index 0f381b4294..c53216b9e7 100644 --- a/src/system/kernel/fs/pipefs.cpp +++ b/src/system/kernel/fs/pipefs.cpp @@ -94,17 +94,17 @@ typedef DoublyLinkedList RequestList; class Volume { public: - Volume(mount_id id); + Volume(dev_t id); ~Volume(); status_t InitCheck(); - mount_id ID() const { return fID; } + dev_t ID() const { return fID; } Inode &RootNode() const { return *fRootNode; } void Lock(); void Unlock(); - Inode *Lookup(vnode_id id); + Inode *Lookup(ino_t id); Inode *Lookup(const char *name); Inode *CreateNode(Inode *parent, const char *name, int32 type); @@ -112,7 +112,7 @@ class Volume { status_t RemoveNode(Inode *directory, const char *name); status_t RemoveNode(Inode *inode); - vnode_id GetNextNodeID() { return fNextNodeID++; } + ino_t GetNextNodeID() { return fNextNodeID++; } Inode *FirstEntry() const { return fFirstEntry; } @@ -127,9 +127,9 @@ class Volume { status_t _InsertNode(Inode *inode); mutex fLock; - mount_id fID; + dev_t fID; Inode *fRootNode; - vnode_id fNextNodeID; + ino_t fNextNodeID; hash_table *fNodeHash; hash_table *fNameHash; @@ -145,7 +145,7 @@ class Inode { ~Inode(); status_t InitCheck(); - vnode_id ID() const { return fID; } + ino_t ID() const { return fID; } const char *Name() const { return fName; } int32 Type() const { return fType; } @@ -200,7 +200,7 @@ class Inode { Inode *fNext; Inode *fHashNext; Inode *fNameHashNext; - vnode_id fID; + ino_t fID; int32 fType; const char *fName; gid_t fGroupID; @@ -302,7 +302,7 @@ RingBuffer::Writable() const // #pragma mark - -Volume::Volume(mount_id id) +Volume::Volume(dev_t id) : fID(id), fRootNode(NULL), @@ -464,7 +464,7 @@ Volume::_UpdateDirCookies(Inode *inode) Inode * -Volume::Lookup(vnode_id id) +Volume::Lookup(ino_t id) { return (Inode *)hash_lookup(fNodeHash, &id); } @@ -847,7 +847,7 @@ uint32 Inode::hash_func(void *_node, const void *_key, uint32 range) { Inode *inode = (Inode *)_node; - const vnode_id *key = (const vnode_id *)_key; + const ino_t *key = (const ino_t *)_key; if (inode != NULL) return inode->ID() % range; @@ -860,7 +860,7 @@ int Inode::compare_func(void *_node, const void *_key) { Inode *inode = (Inode *)_node; - const vnode_id *key = (const vnode_id *)_key; + const ino_t *key = (const ino_t *)_key; if (inode->ID() == *key) return 0; @@ -1059,8 +1059,8 @@ ReadRequest::PutData(const void **_buffer, size_t *_bytesLeft) static status_t -pipefs_mount(mount_id id, const char *device, uint32 flags, const char *args, - fs_volume *_volume, vnode_id *_rootVnodeID) +pipefs_mount(dev_t id, const char *device, uint32 flags, const char *args, + fs_volume *_volume, ino_t *_rootVnodeID) { TRACE(("pipefs_mount: entry\n")); @@ -1104,7 +1104,7 @@ pipefs_sync(fs_volume fs) static status_t pipefs_lookup(fs_volume _volume, fs_vnode _dir, const char *name, - vnode_id *_id, int *_type) + ino_t *_id, int *_type) { Volume *volume = (Volume *)_volume; status_t status; @@ -1153,7 +1153,7 @@ pipefs_get_vnode_name(fs_volume _volume, fs_vnode _node, char *buffer, static status_t -pipefs_get_vnode(fs_volume _volume, vnode_id id, fs_vnode *_inode, +pipefs_get_vnode(fs_volume _volume, ino_t id, fs_vnode *_inode, bool reenter) { Volume *volume = (Volume *)_volume; @@ -1221,7 +1221,7 @@ pipefs_remove_vnode(fs_volume _volume, fs_vnode _node, bool reenter) static status_t pipefs_create(fs_volume _volume, fs_vnode _dir, const char *name, int openMode, - int mode, fs_cookie *_cookie, vnode_id *_newVnodeID) + int mode, fs_cookie *_cookie, ino_t *_newVnodeID) { Volume *volume = (Volume *)_volume; bool wasCreated = true; @@ -1434,7 +1434,7 @@ pipefs_write(fs_volume _volume, fs_vnode _node, fs_cookie _cookie, static status_t pipefs_create_dir(fs_volume _volume, fs_vnode _dir, const char *name, - int perms, vnode_id *_newID) + int perms, ino_t *_newID) { TRACE(("pipefs: create directory \"%s\" requested...\n", name)); return B_NOT_SUPPORTED; diff --git a/src/system/kernel/fs/rootfs.c b/src/system/kernel/fs/rootfs.c index 9509a32ece..252ef39d3a 100644 --- a/src/system/kernel/fs/rootfs.c +++ b/src/system/kernel/fs/rootfs.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -44,7 +44,7 @@ struct rootfs_stream { struct rootfs_vnode { struct rootfs_vnode *all_next; - vnode_id id; + ino_t id; char *name; time_t modification_time; time_t creation_time; @@ -56,9 +56,9 @@ struct rootfs_vnode { }; struct rootfs { - mount_id id; - mutex lock; - vnode_id next_vnode_id; + dev_t id; + mutex lock; + ino_t next_vnode_id; hash_table *vnode_list_hash; struct rootfs_vnode *root_vnode; }; @@ -85,7 +85,7 @@ static uint32 rootfs_vnode_hash_func(void *_v, const void *_key, uint32 range) { struct rootfs_vnode *vnode = _v; - const vnode_id *key = _key; + const ino_t *key = _key; if (vnode != NULL) return vnode->id % range; @@ -98,7 +98,7 @@ static int rootfs_vnode_compare_func(void *_v, const void *_key) { struct rootfs_vnode *v = _v; - const vnode_id *key = _key; + const ino_t *key = _key; if (v->id == *key) return 0; @@ -303,8 +303,8 @@ err: static status_t -rootfs_mount(mount_id id, const char *device, uint32 flags, const char *args, - fs_volume *_fs, vnode_id *root_vnid) +rootfs_mount(dev_t id, const char *device, uint32 flags, const char *args, + fs_volume *_fs, ino_t *root_vnid) { struct rootfs *fs; struct rootfs_vnode *vnode; @@ -395,7 +395,7 @@ rootfs_sync(fs_volume fs) static status_t -rootfs_lookup(fs_volume _fs, fs_vnode _dir, const char *name, vnode_id *_id, int *_type) +rootfs_lookup(fs_volume _fs, fs_vnode _dir, const char *name, ino_t *_id, int *_type) { struct rootfs *fs = (struct rootfs *)_fs; struct rootfs_vnode *dir = (struct rootfs_vnode *)_dir; @@ -442,7 +442,7 @@ rootfs_get_vnode_name(fs_volume _fs, fs_vnode _vnode, char *buffer, size_t buffe static status_t -rootfs_get_vnode(fs_volume _fs, vnode_id id, fs_vnode *_vnode, bool reenter) +rootfs_get_vnode(fs_volume _fs, ino_t id, fs_vnode *_vnode, bool reenter) { struct rootfs *fs = (struct rootfs *)_fs; struct rootfs_vnode *vnode; @@ -505,7 +505,8 @@ rootfs_remove_vnode(fs_volume _fs, fs_vnode _vnode, bool reenter) static status_t -rootfs_create(fs_volume _fs, fs_vnode _dir, const char *name, int omode, int perms, fs_cookie *_cookie, vnode_id *new_vnid) +rootfs_create(fs_volume _fs, fs_vnode _dir, const char *name, int omode, + int perms, fs_cookie *_cookie, ino_t *new_vnid) { return B_BAD_VALUE; } @@ -568,7 +569,8 @@ rootfs_write(fs_volume fs, fs_vnode vnode, fs_cookie cookie, static status_t -rootfs_create_dir(fs_volume _fs, fs_vnode _dir, const char *name, int mode, vnode_id *_newID) +rootfs_create_dir(fs_volume _fs, fs_vnode _dir, const char *name, int mode, + ino_t *_newID) { struct rootfs *fs = _fs; struct rootfs_vnode *dir = _dir; diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 463744af80..57342624c5 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -6,7 +6,8 @@ * Distributed under the terms of the NewOS License. */ -/* Virtual File System and File System Interface Layer */ +/*! Virtual File System and File System Interface Layer */ + #include #include @@ -65,10 +66,10 @@ const static uint32 kMaxUnusedVnodes = 8192; struct vnode { struct vnode *next; vm_cache_ref *cache; - mount_id device; + dev_t device; list_link mount_link; list_link unused_link; - vnode_id id; + ino_t id; fs_vnode private_node; struct fs_mount *mount; struct vnode *covered_by; @@ -81,8 +82,8 @@ struct vnode { }; struct vnode_hash_key { - mount_id device; - vnode_id vnode; + dev_t device; + ino_t vnode; }; #define FS_CALL(vnode, op) (vnode->mount->fs->op) @@ -103,7 +104,7 @@ struct vnode_hash_key { struct fs_mount { struct fs_mount *next; file_system_module_info *fs; - mount_id id; + dev_t id; void *cookie; char *device_name; char *fs_name; @@ -186,7 +187,7 @@ static struct vnode *sRoot; #define MOUNTS_HASH_TABLE_SIZE 16 static hash_table *sMountsTable; -static mount_id sNextMountID = 1; +static dev_t sNextMountID = 1; mode_t __gUmask = 022; @@ -232,10 +233,10 @@ static status_t common_read_stat(struct file_descriptor *, struct stat *); static status_t common_write_stat(struct file_descriptor *, const struct stat *, int statMask); static status_t vnode_path_to_vnode(struct vnode *vnode, char *path, - bool traverseLeafLink, int count, struct vnode **_vnode, vnode_id *_parentID, int *_type); + bool traverseLeafLink, int count, struct vnode **_vnode, ino_t *_parentID, int *_type); static status_t dir_vnode_to_path(struct vnode *vnode, char *buffer, size_t bufferSize); static status_t fd_and_path_to_vnode(int fd, char *path, bool traverseLeafLink, - struct vnode **_vnode, vnode_id *_parentID, bool kernel); + struct vnode **_vnode, ino_t *_parentID, bool kernel); static void inc_vnode_ref_count(struct vnode *vnode); static status_t dec_vnode_ref_count(struct vnode *vnode, bool reenter); static inline void put_vnode(struct vnode *vnode); @@ -430,7 +431,7 @@ static int mount_compare(void *_m, const void *_key) { struct fs_mount *mount = (fs_mount *)_m; - const mount_id *id = (mount_id *)_key; + const dev_t *id = (dev_t *)_key; if (mount->id == *id) return 0; @@ -443,7 +444,7 @@ static uint32 mount_hash(void *_m, const void *_key, uint32 range) { struct fs_mount *mount = (fs_mount *)_m; - const mount_id *id = (mount_id *)_key; + const dev_t *id = (dev_t *)_key; if (mount) return mount->id % range; @@ -457,7 +458,7 @@ mount_hash(void *_m, const void *_key, uint32 range) */ static struct fs_mount * -find_mount(mount_id id) +find_mount(dev_t id) { ASSERT_LOCKED_MUTEX(&sMountMutex); @@ -466,7 +467,7 @@ find_mount(mount_id id) static status_t -get_mount(mount_id id, struct fs_mount **_mount) +get_mount(dev_t id, struct fs_mount **_mount) { struct fs_mount *mount; status_t status; @@ -626,7 +627,7 @@ remove_vnode_from_mount_list(struct vnode *vnode, struct fs_mount *mount) static status_t -create_new_vnode(struct vnode **_vnode, mount_id mountID, vnode_id vnodeID) +create_new_vnode(struct vnode **_vnode, dev_t mountID, ino_t vnodeID) { FUNCTION(("create_new_vnode()\n")); @@ -787,7 +788,7 @@ inc_vnode_ref_count(struct vnode *vnode) */ static struct vnode * -lookup_vnode(mount_id mountID, vnode_id vnodeID) +lookup_vnode(dev_t mountID, ino_t vnodeID) { struct vnode_hash_key key; @@ -814,7 +815,7 @@ lookup_vnode(mount_id mountID, vnode_id vnodeID) */ static status_t -get_vnode(mount_id mountID, vnode_id vnodeID, struct vnode **_vnode, int reenter) +get_vnode(dev_t mountID, ino_t vnodeID, struct vnode **_vnode, int reenter) { FUNCTION(("get_vnode: mountid %ld vnid 0x%Lx %p\n", mountID, vnodeID, _vnode)); @@ -1413,8 +1414,8 @@ resolve_mount_point_to_volume_root(struct vnode *vnode) */ status_t -resolve_mount_point_to_volume_root(mount_id mountID, vnode_id nodeID, - mount_id *resolvedMountID, vnode_id *resolvedNodeID) +resolve_mount_point_to_volume_root(dev_t mountID, ino_t nodeID, + dev_t *resolvedMountID, ino_t *resolvedNodeID) { // get the node struct vnode *node; @@ -1518,7 +1519,7 @@ get_dir_path_and_leaf(char *path, char *filename) static status_t -entry_ref_to_vnode(mount_id mountID, vnode_id directoryID, const char *name, struct vnode **_vnode) +entry_ref_to_vnode(dev_t mountID, ino_t directoryID, const char *name, struct vnode **_vnode) { char clonedName[B_FILE_NAME_LENGTH + 1]; if (strlcpy(clonedName, name, B_FILE_NAME_LENGTH) >= B_FILE_NAME_LENGTH) @@ -1545,10 +1546,10 @@ entry_ref_to_vnode(mount_id mountID, vnode_id directoryID, const char *name, str static status_t vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink, - int count, struct vnode **_vnode, vnode_id *_parentID, int *_type) + int count, struct vnode **_vnode, ino_t *_parentID, int *_type) { status_t status = 0; - vnode_id lastParentID = vnode->id; + ino_t lastParentID = vnode->id; int type = 0; FUNCTION(("vnode_path_to_vnode(vnode = %p, path = %s)\n", vnode, path)); @@ -1560,7 +1561,7 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink, while (true) { struct vnode *nextVnode; - vnode_id vnodeID; + ino_t vnodeID; char *nextPath; TRACE(("vnode_path_to_vnode: top of loop. p = %p, p = '%s'\n", path, path)); @@ -1715,7 +1716,7 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink, static status_t path_to_vnode(char *path, bool traverseLink, struct vnode **_vnode, - vnode_id *_parentID, bool kernel) + ino_t *_parentID, bool kernel) { struct vnode *start = NULL; @@ -1943,7 +1944,7 @@ dir_vnode_to_path(struct vnode *vnode, char *buffer, size_t bufferSize) char nameBuffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH]; char *name = &((struct dirent *)nameBuffer)->d_name[0]; struct vnode *parentVnode; - vnode_id parentID; + ino_t parentID; int type; // lookup the parent vnode @@ -2121,7 +2122,7 @@ get_vnode_from_fd(int fd, bool kernel) static status_t fd_and_path_to_vnode(int fd, char *path, bool traverseLeafLink, - struct vnode **_vnode, vnode_id *_parentID, bool kernel) + struct vnode **_vnode, ino_t *_parentID, bool kernel) { if (fd < 0 && !path) return B_BAD_VALUE; @@ -2288,7 +2289,7 @@ dump_mount(int argc, char **argv) return 0; } } else { - mount_id id = atoll(argv[1]); + dev_t id = atoll(argv[1]); mount = (fs_mount *)hash_lookup(sMountsTable, (void *)&id); if (mount == NULL) { kprintf("fs_mount not found\n"); @@ -2342,8 +2343,8 @@ dump_vnode(int argc, char **argv) } struct hash_iterator iterator; - mount_id device = -1; - vnode_id id; + dev_t device = -1; + ino_t id; if (argc > 2) { device = atoi(argv[1]); id = atoll(argv[2]); @@ -2367,7 +2368,7 @@ static int dump_vnodes(int argc, char **argv) { // restrict dumped nodes to a certain device if requested - mount_id device = -1; + dev_t device = -1; if (argc > 1) device = atoi(argv[1]); @@ -2399,7 +2400,7 @@ dump_vnode_caches(int argc, char **argv) struct vnode *vnode; // restrict dumped nodes to a certain device if requested - mount_id device = -1; + dev_t device = -1; if (argc > 1) device = atoi(argv[1]); @@ -2506,7 +2507,7 @@ dump_vnode_usage(int argc, char **argv) extern "C" status_t -new_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode privateNode) +new_vnode(dev_t mountID, ino_t vnodeID, fs_vnode privateNode) { FUNCTION(("new_vnode(mountID = %ld, vnodeID = %Ld, node = %p)\n", mountID, vnodeID, privateNode)); @@ -2541,7 +2542,7 @@ new_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode privateNode) extern "C" status_t -publish_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode privateNode) +publish_vnode(dev_t mountID, ino_t vnodeID, fs_vnode privateNode) { FUNCTION(("publish_vnode()\n")); @@ -2569,7 +2570,7 @@ publish_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode privateNode) extern "C" status_t -get_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode *_fsNode) +get_vnode(dev_t mountID, ino_t vnodeID, fs_vnode *_fsNode) { struct vnode *vnode; @@ -2583,7 +2584,7 @@ get_vnode(mount_id mountID, vnode_id vnodeID, fs_vnode *_fsNode) extern "C" status_t -put_vnode(mount_id mountID, vnode_id vnodeID) +put_vnode(dev_t mountID, ino_t vnodeID) { struct vnode *vnode; @@ -2599,7 +2600,7 @@ put_vnode(mount_id mountID, vnode_id vnodeID) extern "C" status_t -remove_vnode(mount_id mountID, vnode_id vnodeID) +remove_vnode(dev_t mountID, ino_t vnodeID) { struct vnode *vnode; bool remove = false; @@ -2635,7 +2636,7 @@ remove_vnode(mount_id mountID, vnode_id vnodeID) extern "C" status_t -unremove_vnode(mount_id mountID, vnode_id vnodeID) +unremove_vnode(dev_t mountID, ino_t vnodeID) { struct vnode *vnode; @@ -2651,7 +2652,7 @@ unremove_vnode(mount_id mountID, vnode_id vnodeID) extern "C" status_t -get_vnode_removed(mount_id mountID, vnode_id vnodeID, bool* removed) +get_vnode_removed(dev_t mountID, ino_t vnodeID, bool* removed) { mutex_lock(&sVnodeMutex); @@ -2741,7 +2742,7 @@ vfs_get_vnode_from_path(const char *path, bool kernel, void **_vnode) extern "C" status_t -vfs_get_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode) +vfs_get_vnode(dev_t mountID, ino_t vnodeID, void **_vnode) { struct vnode *vnode; @@ -2755,7 +2756,7 @@ vfs_get_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode) extern "C" status_t -vfs_entry_ref_to_vnode(mount_id mountID, vnode_id directoryID, +vfs_entry_ref_to_vnode(dev_t mountID, ino_t directoryID, const char *name, void **_vnode) { return entry_ref_to_vnode(mountID, directoryID, name, (struct vnode **)_vnode); @@ -2763,7 +2764,7 @@ vfs_entry_ref_to_vnode(mount_id mountID, vnode_id directoryID, extern "C" void -vfs_vnode_to_node_ref(void *_vnode, mount_id *_mountID, vnode_id *_vnodeID) +vfs_vnode_to_node_ref(void *_vnode, dev_t *_mountID, ino_t *_vnodeID) { struct vnode *vnode = (struct vnode *)_vnode; @@ -2779,7 +2780,7 @@ vfs_vnode_to_node_ref(void *_vnode, mount_id *_mountID, vnode_id *_vnodeID) */ extern "C" status_t -vfs_lookup_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode) +vfs_lookup_vnode(dev_t mountID, ino_t vnodeID, void **_vnode) { mutex_lock(&sVnodeMutex); struct vnode *vnode = lookup_vnode(mountID, vnodeID); @@ -2794,7 +2795,7 @@ vfs_lookup_vnode(mount_id mountID, vnode_id vnodeID, void **_vnode) extern "C" status_t -vfs_get_fs_node_from_path(mount_id mountID, const char *path, bool kernel, void **_node) +vfs_get_fs_node_from_path(dev_t mountID, const char *path, bool kernel, void **_node) { TRACE(("vfs_get_fs_node_from_path(mountID = %ld, path = \"%s\", kernel %d)\n", mountID, path, kernel)); @@ -3018,7 +3019,7 @@ vfs_put_vnode(void *_vnode) extern "C" status_t -vfs_get_cwd(mount_id *_mountID, vnode_id *_vnodeID) +vfs_get_cwd(dev_t *_mountID, ino_t *_vnodeID) { // Get current working directory from io context struct io_context *context = get_current_io_context(false); @@ -3038,7 +3039,7 @@ vfs_get_cwd(mount_id *_mountID, vnode_id *_vnodeID) extern "C" status_t -vfs_disconnect_vnode(mount_id mountID, vnode_id vnodeID) +vfs_disconnect_vnode(dev_t mountID, ino_t vnodeID) { struct vnode *vnode; @@ -3563,7 +3564,7 @@ create_vnode(struct vnode *directory, const char *name, int openMode, { struct vnode *vnode; fs_cookie cookie; - vnode_id newID; + ino_t newID; int status; if (FS_CALL(directory, create) == NULL) @@ -3679,7 +3680,8 @@ open_attr_dir_vnode(struct vnode *vnode, bool kernel) static int -file_create_entry_ref(mount_id mountID, vnode_id directoryID, const char *name, int openMode, int perms, bool kernel) +file_create_entry_ref(dev_t mountID, ino_t directoryID, const char *name, + int openMode, int perms, bool kernel) { struct vnode *directory; int status; @@ -3720,7 +3722,7 @@ file_create(int fd, char *path, int openMode, int perms, bool kernel) static int -file_open_entry_ref(mount_id mountID, vnode_id directoryID, const char *name, int openMode, bool kernel) +file_open_entry_ref(dev_t mountID, ino_t directoryID, const char *name, int openMode, bool kernel) { struct vnode *vnode; int status; @@ -3756,7 +3758,7 @@ file_open(int fd, char *path, int openMode, bool kernel) // get the vnode matching the vnode + path combination struct vnode *vnode = NULL; - vnode_id parentID; + ino_t parentID; status = fd_and_path_to_vnode(fd, path, traverse, &vnode, &parentID, kernel); if (status != B_OK) return status; @@ -3905,10 +3907,10 @@ file_deselect(struct file_descriptor *descriptor, uint8 event, static status_t -dir_create_entry_ref(mount_id mountID, vnode_id parentID, const char *name, int perms, bool kernel) +dir_create_entry_ref(dev_t mountID, ino_t parentID, const char *name, int perms, bool kernel) { struct vnode *vnode; - vnode_id newID; + ino_t newID; status_t status; if (name == NULL || *name == '\0') @@ -3935,7 +3937,7 @@ dir_create(int fd, char *path, int perms, bool kernel) { char filename[B_FILE_NAME_LENGTH]; struct vnode *vnode; - vnode_id newID; + ino_t newID; status_t status; FUNCTION(("dir_create: path '%s', perms %d, kernel %d\n", path, perms, kernel)); @@ -3955,7 +3957,7 @@ dir_create(int fd, char *path, int perms, bool kernel) static int -dir_open_entry_ref(mount_id mountID, vnode_id parentID, const char *name, bool kernel) +dir_open_entry_ref(dev_t mountID, ino_t parentID, const char *name, bool kernel) { struct vnode *vnode; int status; @@ -3991,7 +3993,7 @@ dir_open(int fd, char *path, bool kernel) // get the vnode matching the vnode + path combination struct vnode *vnode = NULL; - vnode_id parentID; + ino_t parentID; status = fd_and_path_to_vnode(fd, path, true, &vnode, &parentID, kernel); if (status != B_OK) return status; @@ -4956,7 +4958,7 @@ err: static status_t -index_dir_open(mount_id mountID, bool kernel) +index_dir_open(dev_t mountID, bool kernel) { struct fs_mount *mount; fs_cookie cookie; @@ -5043,7 +5045,7 @@ index_dir_rewind(struct file_descriptor *descriptor) static status_t -index_create(mount_id mountID, const char *name, uint32 type, uint32 flags, bool kernel) +index_create(dev_t mountID, const char *name, uint32 type, uint32 flags, bool kernel) { FUNCTION(("index_create(mountID = %ld, name = %s, kernel = %d)\n", mountID, name, kernel)); @@ -5095,7 +5097,7 @@ index_free_fd(struct file_descriptor *descriptor) static status_t -index_name_read_stat(mount_id mountID, const char *name, struct stat *stat, bool kernel) +index_name_read_stat(dev_t mountID, const char *name, struct stat *stat, bool kernel) { FUNCTION(("index_remove(mountID = %ld, name = %s, kernel = %d)\n", mountID, name, kernel)); @@ -5118,7 +5120,7 @@ out: static status_t -index_remove(mount_id mountID, const char *name, bool kernel) +index_remove(dev_t mountID, const char *name, bool kernel) { FUNCTION(("index_remove(mountID = %ld, name = %s, kernel = %d)\n", mountID, name, kernel)); @@ -5396,7 +5398,7 @@ fs_mount(char *path, const char *device, const char *fsName, uint32 flags, hash_insert(sMountsTable, mount); mutex_unlock(&sMountMutex); - vnode_id rootID; + ino_t rootID; if (!sRoot) { // we haven't mounted anything yet @@ -5693,7 +5695,7 @@ fs_sync(dev_t device) struct vnode *vnode = (struct vnode *)list_get_next_item(&mount->vnodes, previousVnode); - vnode_id id = -1; + ino_t id = -1; if (vnode != NULL) id = vnode->id; diff --git a/src/system/kernel/main.c b/src/system/kernel/main.c index 60626e258a..5397f8055f 100644 --- a/src/system/kernel/main.c +++ b/src/system/kernel/main.c @@ -1,12 +1,12 @@ /* - * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. * Distributed under the terms of the NewOS License. */ -/* This is main - initializes processors and starts init */ +/*! This is main - initializes processors and starts init */ #include @@ -42,7 +42,7 @@ #define TRACE_BOOT #ifdef TRACE_BOOT -# define TRACE(x...) dprintf("INIT : " x) +# define TRACE(x...) dprintf("INIT: " x) #else # define TRACE(x...) ; #endif @@ -56,6 +56,7 @@ static uint32 sCpuRendezvous2; static int32 main2(void *); int _start(kernel_args *bootKernelArgs, int cpu); /* keep compiler happy */ + int _start(kernel_args *bootKernelArgs, int currentCPU) {