From 0ebb4701b9ab9ba572bd224ea3b9db5b3098b870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 31 Aug 2004 03:41:29 +0000 Subject: [PATCH] fs_read_info() will now also succeed if the file system in question does not support the read_fs_info() function - only the values that the VFS does know about are filled in, then. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8735 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/fs/vfs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kernel/core/fs/vfs.cpp b/src/kernel/core/fs/vfs.cpp index 15b0a57d53..2a277f952c 100755 --- a/src/kernel/core/fs/vfs.cpp +++ b/src/kernel/core/fs/vfs.cpp @@ -3510,29 +3510,29 @@ static status_t fs_read_info(dev_t device, struct fs_info *info) { struct fs_mount *mount; - int status; + status_t status = B_OK; mutex_lock(&sMountMutex); mount = find_mount(device); if (mount == NULL) { - status = EINVAL; + status = B_BAD_VALUE; goto out; } // fill in info the file system doesn't (have to) know about + memset(info, 0, sizeof(struct fs_info)); info->dev = mount->id; info->root = mount->root_vnode->id; strlcpy(info->fsh_name, mount->fs_name, sizeof(info->fsh_name)); if (mount->device_name != NULL) strlcpy(info->device_name, mount->device_name, sizeof(info->device_name)); - else - info->device_name[0] = '\0'; if (FS_MOUNT_CALL(mount, read_fs_info)) status = FS_MOUNT_CALL(mount, read_fs_info)(mount->cookie, info); - else - status = EOPNOTSUPP; + + // if the call is not supported by the file system, there are still + // the parts that we filled out ourselves out: mutex_unlock(&sMountMutex);