From: Randy Dunlap <rdunlap@infradead.org>
To: "open list:NFS, SUNRPC, AND..." <linux-nfs@vger.kernel.org>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>,
Al Viro <viro@ZenIV.linux.org.uk>,
David Howells <dhowells@redhat.com>,
Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled
Date: Fri, 15 May 2020 10:27:39 -0700 [thread overview]
Message-ID: <f91b8f29-271a-b5cd-410b-a43a399d34aa@infradead.org> (raw)
From: Randy Dunlap <rdunlap@infradead.org>
Fix multiple build errors when CONFIG_NFS_V4 is not enabled.
../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_supports':
../fs/nfs/fsinfo.c:153:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
^~
../fs/nfs/fsinfo.c:155:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
^~
../fs/nfs/fsinfo.c:158:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
if (server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE)
^~
../fs/nfs/fsinfo.c:160:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
if (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN)
^~
../fs/nfs/fsinfo.c:162:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
^~
../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_features':
../fs/nfs/fsinfo.c:205:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
^~
../fs/nfs/fsinfo.c:207:13: error: 'const struct nfs_server' has no member named 'attr_bitmask'
if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
^~
../fs/nfs/fsinfo.c:208:13: error: 'const struct nfs_server' has no member named 'attr_bitmask'
(server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
^~
../fs/nfs/fsinfo.c:209:13: error: 'const struct nfs_server' has no member named 'attr_bitmask'
(server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
^~
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-nfs@vger.kernel.org
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>
---
fs/nfs/fsinfo.c | 5 +++++
1 file changed, 5 insertions(+)
--- linux-next-20200515.orig/fs/nfs/fsinfo.c
+++ linux-next-20200515/fs/nfs/fsinfo.c
@@ -5,6 +5,7 @@
* Written by David Howells (dhowells@redhat.com)
*/
+#include <linux/kconfig.h>
#include <linux/nfs_fs.h>
#include <linux/windows.h>
#include "internal.h"
@@ -150,6 +151,7 @@ static int nfs_fsinfo_get_supports(struc
sup->stx_mask |= STATX_CTIME;
if (server->caps & NFS_CAP_MTIME)
sup->stx_mask |= STATX_MTIME;
+#if IS_ENABLED(CONFIG_NFS_V4)
if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
sup->stx_mask |= STATX_SIZE;
if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
@@ -161,6 +163,7 @@ static int nfs_fsinfo_get_supports(struc
sup->win_file_attrs |= ATTR_HIDDEN;
if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
sup->win_file_attrs |= ATTR_SYSTEM;
+#endif
sup->stx_attributes = STATX_ATTR_AUTOMOUNT;
return sizeof(*sup);
@@ -202,12 +205,14 @@ static int nfs_fsinfo_get_features(struc
if (server->caps & NFS_CAP_MTIME)
fsinfo_set_feature(ft, FSINFO_FEAT_HAS_MTIME);
+#if IS_ENABLED(CONFIG_NFS_V4)
if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
fsinfo_set_feature(ft, FSINFO_FEAT_NAME_CASE_INDEP);
if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
(server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
(server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
fsinfo_set_feature(ft, FSINFO_FEAT_WINDOWS_ATTRS);
+#endif
return sizeof(*ft);
}
next reply other threads:[~2020-05-15 17:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-15 17:27 Randy Dunlap [this message]
2020-05-15 17:33 ` [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled Trond Myklebust
2020-05-15 17:36 ` Randy Dunlap
2020-05-16 10:53 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f91b8f29-271a-b5cd-410b-a43a399d34aa@infradead.org \
--to=rdunlap@infradead.org \
--cc=anna.schumaker@netapp.com \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.