From 6d3667845fc9d55ff3ab2aa21cfd7f8e0a006d58 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 1 Mar 2007 02:55:41 +0000 Subject: [PATCH] Be nicer to FSs and fill in the known part of the fs_info *after* the FS had its go. BeOS does the same. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20262 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 1b4f95bb34..b9f00850fd 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -5716,17 +5716,22 @@ fs_read_info(dev_t device, struct fs_info *info) if (status < B_OK) return status; - // 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)); if (FS_MOUNT_CALL(mount, read_fs_info)) status = FS_MOUNT_CALL(mount, read_fs_info)(mount->cookie, info); + // fill in info the file system doesn't (have to) know about + if (status == B_OK) { + 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)); + } + } + // if the call is not supported by the file system, there are still // the parts that we filled out ourselves