diff options
Diffstat (limited to 'fs/cifs/cache.c')
-rw-r--r-- | fs/cifs/cache.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c index 224d7bbd1fcc..545509c3313b 100644 --- a/fs/cifs/cache.c +++ b/fs/cifs/cache.c | |||
@@ -50,7 +50,7 @@ void cifs_fscache_unregister(void) | |||
50 | */ | 50 | */ |
51 | struct cifs_server_key { | 51 | struct cifs_server_key { |
52 | uint16_t family; /* address family */ | 52 | uint16_t family; /* address family */ |
53 | uint16_t port; /* IP port */ | 53 | __be16 port; /* IP port */ |
54 | union { | 54 | union { |
55 | struct in_addr ipv4_addr; | 55 | struct in_addr ipv4_addr; |
56 | struct in6_addr ipv6_addr; | 56 | struct in6_addr ipv6_addr; |
@@ -64,7 +64,9 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data, | |||
64 | void *buffer, uint16_t maxbuf) | 64 | void *buffer, uint16_t maxbuf) |
65 | { | 65 | { |
66 | const struct TCP_Server_Info *server = cookie_netfs_data; | 66 | const struct TCP_Server_Info *server = cookie_netfs_data; |
67 | const struct sockaddr *sa = (struct sockaddr *) &server->addr.sockAddr; | 67 | const struct sockaddr *sa = (struct sockaddr *) &server->dstaddr; |
68 | const struct sockaddr_in *addr = (struct sockaddr_in *) sa; | ||
69 | const struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *) sa; | ||
68 | struct cifs_server_key *key = buffer; | 70 | struct cifs_server_key *key = buffer; |
69 | uint16_t key_len = sizeof(struct cifs_server_key); | 71 | uint16_t key_len = sizeof(struct cifs_server_key); |
70 | 72 | ||
@@ -76,21 +78,21 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data, | |||
76 | */ | 78 | */ |
77 | switch (sa->sa_family) { | 79 | switch (sa->sa_family) { |
78 | case AF_INET: | 80 | case AF_INET: |
79 | key->family = server->addr.sockAddr.sin_family; | 81 | key->family = sa->sa_family; |
80 | key->port = server->addr.sockAddr.sin_port; | 82 | key->port = addr->sin_port; |
81 | key->addr[0].ipv4_addr = server->addr.sockAddr.sin_addr; | 83 | key->addr[0].ipv4_addr = addr->sin_addr; |
82 | key_len += sizeof(key->addr[0].ipv4_addr); | 84 | key_len += sizeof(key->addr[0].ipv4_addr); |
83 | break; | 85 | break; |
84 | 86 | ||
85 | case AF_INET6: | 87 | case AF_INET6: |
86 | key->family = server->addr.sockAddr6.sin6_family; | 88 | key->family = sa->sa_family; |
87 | key->port = server->addr.sockAddr6.sin6_port; | 89 | key->port = addr6->sin6_port; |
88 | key->addr[0].ipv6_addr = server->addr.sockAddr6.sin6_addr; | 90 | key->addr[0].ipv6_addr = addr6->sin6_addr; |
89 | key_len += sizeof(key->addr[0].ipv6_addr); | 91 | key_len += sizeof(key->addr[0].ipv6_addr); |
90 | break; | 92 | break; |
91 | 93 | ||
92 | default: | 94 | default: |
93 | cERROR(1, "CIFS: Unknown network family '%d'", sa->sa_family); | 95 | cERROR(1, "Unknown network family '%d'", sa->sa_family); |
94 | key_len = 0; | 96 | key_len = 0; |
95 | break; | 97 | break; |
96 | } | 98 | } |
@@ -144,13 +146,13 @@ static char *extract_sharename(const char *treename) | |||
144 | static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer, | 146 | static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer, |
145 | uint16_t maxbuf) | 147 | uint16_t maxbuf) |
146 | { | 148 | { |
147 | const struct cifsTconInfo *tcon = cookie_netfs_data; | 149 | const struct cifs_tcon *tcon = cookie_netfs_data; |
148 | char *sharename; | 150 | char *sharename; |
149 | uint16_t len; | 151 | uint16_t len; |
150 | 152 | ||
151 | sharename = extract_sharename(tcon->treeName); | 153 | sharename = extract_sharename(tcon->treeName); |
152 | if (IS_ERR(sharename)) { | 154 | if (IS_ERR(sharename)) { |
153 | cFYI(1, "CIFS: couldn't extract sharename\n"); | 155 | cFYI(1, "%s: couldn't extract sharename\n", __func__); |
154 | sharename = NULL; | 156 | sharename = NULL; |
155 | return 0; | 157 | return 0; |
156 | } | 158 | } |
@@ -171,7 +173,7 @@ cifs_fscache_super_get_aux(const void *cookie_netfs_data, void *buffer, | |||
171 | uint16_t maxbuf) | 173 | uint16_t maxbuf) |
172 | { | 174 | { |
173 | struct cifs_fscache_super_auxdata auxdata; | 175 | struct cifs_fscache_super_auxdata auxdata; |
174 | const struct cifsTconInfo *tcon = cookie_netfs_data; | 176 | const struct cifs_tcon *tcon = cookie_netfs_data; |
175 | 177 | ||
176 | memset(&auxdata, 0, sizeof(auxdata)); | 178 | memset(&auxdata, 0, sizeof(auxdata)); |
177 | auxdata.resource_id = tcon->resource_id; | 179 | auxdata.resource_id = tcon->resource_id; |
@@ -190,7 +192,7 @@ fscache_checkaux cifs_fscache_super_check_aux(void *cookie_netfs_data, | |||
190 | uint16_t datalen) | 192 | uint16_t datalen) |
191 | { | 193 | { |
192 | struct cifs_fscache_super_auxdata auxdata; | 194 | struct cifs_fscache_super_auxdata auxdata; |
193 | const struct cifsTconInfo *tcon = cookie_netfs_data; | 195 | const struct cifs_tcon *tcon = cookie_netfs_data; |
194 | 196 | ||
195 | if (datalen != sizeof(auxdata)) | 197 | if (datalen != sizeof(auxdata)) |
196 | return FSCACHE_CHECKAUX_OBSOLETE; | 198 | return FSCACHE_CHECKAUX_OBSOLETE; |
@@ -300,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data) | |||
300 | pagevec_init(&pvec, 0); | 302 | pagevec_init(&pvec, 0); |
301 | first = 0; | 303 | first = 0; |
302 | 304 | ||
303 | cFYI(1, "cifs inode 0x%p now uncached", cifsi); | 305 | cFYI(1, "%s: cifs inode 0x%p now uncached", __func__, cifsi); |
304 | 306 | ||
305 | for (;;) { | 307 | for (;;) { |
306 | nr_pages = pagevec_lookup(&pvec, | 308 | nr_pages = pagevec_lookup(&pvec, |