* Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41118 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010, Axel Dörfler, [email protected].
|
||||
* Copyright 2002-2011, Axel Dörfler, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
@@ -147,7 +147,7 @@ static status_t publish_device(struct devfs *fs, const char *path,
|
||||
BaseDevice* device);
|
||||
|
||||
|
||||
/* the one and only allowed devfs instance */
|
||||
// The one and only allowed devfs instance
|
||||
static struct devfs* sDeviceFileSystem = NULL;
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ static status_t
|
||||
devfs_delete_vnode(struct devfs* fs, struct devfs_vnode* vnode,
|
||||
bool forceDelete)
|
||||
{
|
||||
// cant delete it if it's in a directory or is a directory
|
||||
// Can't delete it if it's in a directory or is a directory
|
||||
// and has children
|
||||
if (!forceDelete && ((S_ISDIR(vnode->stream.type)
|
||||
&& vnode->stream.u.dir.dir_head != NULL)
|
||||
@@ -867,7 +867,7 @@ dump_cookie(int argc, char** argv)
|
||||
|
||||
static status_t
|
||||
devfs_mount(fs_volume* volume, const char* devfs, uint32 flags,
|
||||
const char *args, ino_t *root_vnid)
|
||||
const char* args, ino_t* _rootNodeID)
|
||||
{
|
||||
struct devfs_vnode* vnode;
|
||||
struct devfs* fs;
|
||||
@@ -920,7 +920,7 @@ devfs_mount(fs_volume *volume, const char *devfs, uint32 flags,
|
||||
hash_insert(fs->vnode_hash, vnode);
|
||||
publish_vnode(volume, vnode->id, vnode, &kVnodeOps, vnode->stream.type, 0);
|
||||
|
||||
*root_vnid = vnode->id;
|
||||
*_rootNodeID = vnode->id;
|
||||
sDeviceFileSystem = fs;
|
||||
return B_OK;
|
||||
|
||||
@@ -1545,10 +1545,9 @@ devfs_ioctl(fs_volume *_volume, fs_vnode *_vnode, void *_cookie, uint32 op,
|
||||
case B_GET_PATH_FOR_DEVICE:
|
||||
{
|
||||
char path[256];
|
||||
/* TODO: we might want to actually find the mountpoint
|
||||
* of that instance of devfs...
|
||||
* but for now we assume it's mounted on /dev
|
||||
*/
|
||||
// TODO: we might want to actually find the mountpoint
|
||||
// of that instance of devfs...
|
||||
// but for now we assume it's mounted on /dev
|
||||
strcpy(path, "/dev/");
|
||||
get_device_name(vnode, path + 5, sizeof(path) - 5);
|
||||
if (length && (length <= strlen(path)))
|
||||
@@ -2113,17 +2112,16 @@ extern "C" status_t
|
||||
devfs_rename_partition(const char* devicePath, const char* oldName,
|
||||
const char* newName)
|
||||
{
|
||||
status_t status;
|
||||
devfs_vnode *device, *node;
|
||||
if (oldName == NULL || newName == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
status = get_node_for_path(sDeviceFileSystem, devicePath, &device);
|
||||
devfs_vnode* device;
|
||||
status_t status = get_node_for_path(sDeviceFileSystem, devicePath, &device);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
RecursiveLocker locker(sDeviceFileSystem->lock);
|
||||
node = devfs_find_in_dir(device->parent, oldName);
|
||||
devfs_vnode* node = devfs_find_in_dir(device->parent, oldName);
|
||||
if (node == NULL)
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user