From 4688426215cfb1c29d771a788dee605c0df8d9bd Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Thu, 9 Nov 2006 12:51:35 -0500 Subject: [PATCH] [UBUNTU: nfs] Fixes FTBFS in nfs. Fix various problems with nfs4 disabled. And various other things From 2.6.17-mm1. Closes: #64423. Signed-off-by: Chuck Short --- fs/nfs/inode.c | 16 +++++++++------- fs/nfs/internal.h | 9 ++++++++- fs/nfs/nfs2xdr.c | 2 ++ include/linux/nfs_fs.h | 2 -- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 24a7139..51bc88b 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1089,13 +1089,15 @@ void nfs_destroy_inode(struct inode *ino kmem_cache_free(nfs_inode_cachep, NFS_I(inode)); } -#define nfs4_init_once(nfsi) \ - do { \ - INIT_LIST_HEAD(&(nfsi)->open_states); \ - nfsi->delegation = NULL; \ - nfsi->delegation_state = 0; \ - init_rwsem(&nfsi->rwsem); \ - } while(0) +static inline void nfs4_init_once(struct nfs_inode *nfsi) +{ +#ifdef CONFIG_NFS_V4 + INIT_LIST_HEAD(&nfsi->open_states); + nfsi->delegation = NULL; + nfsi->delegation_state = 0; + init_rwsem(&nfsi->rwsem); +#endif +} static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) { diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 5e51c45..bd2815e 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -58,11 +58,13 @@ extern int nfs_stat_to_errno(int); extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus); /* nfs4proc.c */ +#ifdef CONFIG_NFS_V4 extern struct rpc_procinfo nfs4_procedures[]; extern int nfs4_proc_fs_locations(struct inode *dir, struct dentry *dentry, struct nfs4_fs_locations *fs_locations, struct page *page); +#endif /* inode.c */ extern struct inode *nfs_alloc_inode(struct super_block *sb); @@ -92,9 +94,14 @@ extern char *nfs_path(const char *base, /* * Determine the mount path as a string */ -static inline char *nfs4_path(const struct dentry *dentry, char *buffer, ssize_t buflen) +static inline char * +nfs4_path(const struct dentry *dentry, char *buffer, ssize_t buflen) { +#ifdef CONFIG_NFS_V4 return nfs_path(NFS_SB(dentry->d_sb)->mnt_path, dentry, buffer, buflen); +#else + return NULL; +#endif } /* diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 4a006f8..50d504d 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c @@ -24,6 +24,8 @@ #include #include #include +#include "internal.h" + #define NFSDBG_FACILITY NFSDBG_XDR /* #define NFS_PARANOIA 1 */ diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index c35b18a..6f3794c 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -316,8 +316,6 @@ extern struct vfsmount *nfs_do_submount( const struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); -extern struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, - struct dentry *dentry); /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ extern u32 root_nfs_parse_addr(char *name); /*__init*/ -- 1.4.1