From 7a8f1284789ee9ded7ab0f2ee1921a35ed9ea255 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 27 Dec 2000 00:26:21 +0000 Subject: 2000-12-26 Roland McGrath * file-statfs.c (diskfs_S_file_statfs): Zero out the struct statfs before calling diskfs_set_statfs. Set f_namelen to diskfs_name_max after the call. * diskfs.h: Update comment. --- libdiskfs/file-statfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libdiskfs/file-statfs.c') diff --git a/libdiskfs/file-statfs.c b/libdiskfs/file-statfs.c index ff26819f..62eaf67b 100644 --- a/libdiskfs/file-statfs.c +++ b/libdiskfs/file-statfs.c @@ -1,5 +1,5 @@ /* libdiskfs implementation of fs.defs: file_statfs - Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation + Copyright (C) 1992,93,94,98,2000 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -28,7 +28,10 @@ diskfs_S_file_statfs (struct protid *file, if (!file) return EOPNOTSUPP; - statbuf->f_flag = 0; + /* Start will all zeros, so the fs can skip fields for which + it has no information to contribute. */ + bzero (statbuf, sizeof *statbuf); + if (diskfs_readonly) statbuf->f_flag |= ST_RDONLY; if (_diskfs_nosuid) @@ -40,5 +43,7 @@ diskfs_S_file_statfs (struct protid *file, diskfs_set_statfs (statbuf); + statbuf->f_namelen = diskfs_name_max; + return 0; } -- cgit v1.2.3