nfs: Fix misparsing of nfsv4 fs_locations attribute
[safe/jmp/linux-2.6] / fs / nfs / internal.h
index 4c1122a..5d2a5d3 100644 (file)
@@ -46,9 +46,9 @@ struct nfs_parsed_mount_data {
                struct sockaddr_storage address;
                size_t                  addrlen;
                char                    *hostname;
-               unsigned int            version;
+               u32                     version;
                unsigned short          port;
-               int                     protocol;
+               unsigned short          protocol;
        } mount_server;
 
        struct {
@@ -56,7 +56,8 @@ struct nfs_parsed_mount_data {
                size_t                  addrlen;
                char                    *hostname;
                char                    *export_path;
-               int                     protocol;
+               unsigned short          port;
+               unsigned short          protocol;
        } nfs_server;
 
        struct security_mnt_opts lsm_opts;
@@ -115,13 +116,8 @@ extern void nfs_destroy_readpagecache(void);
 extern int __init nfs_init_writepagecache(void);
 extern void nfs_destroy_writepagecache(void);
 
-#ifdef CONFIG_NFS_DIRECTIO
 extern int __init nfs_init_directcache(void);
 extern void nfs_destroy_directcache(void);
-#else
-#define nfs_init_directcache() (0)
-#define nfs_destroy_directcache() do {} while(0)
-#endif
 
 /* nfs2xdr.c */
 extern int nfs_stat_to_errno(int);
@@ -154,8 +150,10 @@ extern void nfs_clear_inode(struct inode *);
 #ifdef CONFIG_NFS_V4
 extern void nfs4_clear_inode(struct inode *);
 #endif
+void nfs_zap_acl_cache(struct inode *inode);
 
 /* super.c */
+void nfs_parse_ip_address(char *, size_t, struct sockaddr *, size_t *);
 extern struct file_system_type nfs_xdev_fs_type;
 #ifdef CONFIG_NFS_V4
 extern struct file_system_type nfs4_xdev_fs_type;
@@ -166,8 +164,8 @@ extern struct rpc_stat nfs_rpcstat;
 
 extern int __init register_nfs_fs(void);
 extern void __exit unregister_nfs_fs(void);
-extern void nfs_sb_active(struct nfs_server *server);
-extern void nfs_sb_deactive(struct nfs_server *server);
+extern void nfs_sb_active(struct super_block *sb);
+extern void nfs_sb_deactive(struct super_block *sb);
 
 /* namespace.c */
 extern char *nfs_path(const char *base,
@@ -279,3 +277,24 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len)
                PAGE_SIZE - 1) >> PAGE_SHIFT;
 }
 
+#define IPV6_SCOPE_DELIMITER   '%'
+
+/*
+ * Set the port number in an address.  Be agnostic about the address
+ * family.
+ */
+static inline void nfs_set_port(struct sockaddr *sap, unsigned short port)
+{
+       switch (sap->sa_family) {
+       case AF_INET: {
+             struct sockaddr_in *ap = (struct sockaddr_in *)sap;
+             ap->sin_port = htons(port);
+             break;
+       }
+       case AF_INET6: {
+              struct sockaddr_in6 *ap = (struct sockaddr_in6 *)sap;
+              ap->sin6_port = htons(port);
+              break;
+       }
+       }
+}