aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/afs/server.h')
-rw-r--r--fs/afs/server.h41
1 files changed, 18 insertions, 23 deletions
diff --git a/fs/afs/server.h b/fs/afs/server.h
index c3d24115578f..e1a006829b5d 100644
--- a/fs/afs/server.h
+++ b/fs/afs/server.h
@@ -1,4 +1,4 @@
1/* server.h: AFS server record 1/* AFS server record
2 * 2 *
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. 3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 4 * Written by David Howells (dhowells@redhat.com)
@@ -9,8 +9,8 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#ifndef _LINUX_AFS_SERVER_H 12#ifndef AFS_SERVER_H
13#define _LINUX_AFS_SERVER_H 13#define AFS_SERVER_H
14 14
15#include "types.h" 15#include "types.h"
16#include "kafstimod.h" 16#include "kafstimod.h"
@@ -19,12 +19,10 @@
19 19
20extern spinlock_t afs_server_peer_lock; 20extern spinlock_t afs_server_peer_lock;
21 21
22/*****************************************************************************/
23/* 22/*
24 * AFS server record 23 * AFS server record
25 */ 24 */
26struct afs_server 25struct afs_server {
27{
28 atomic_t usage; 26 atomic_t usage;
29 struct afs_cell *cell; /* cell in which server resides */ 27 struct afs_cell *cell; /* cell in which server resides */
30 struct list_head link; /* link in cell's server list */ 28 struct list_head link; /* link in cell's server list */
@@ -50,20 +48,19 @@ struct afs_server
50 spinlock_t cb_lock; /* access lock */ 48 spinlock_t cb_lock; /* access lock */
51}; 49};
52 50
53extern int afs_server_lookup(struct afs_cell *cell, 51extern int afs_server_lookup(struct afs_cell *, const struct in_addr *,
54 const struct in_addr *addr, 52 struct afs_server **);
55 struct afs_server **_server);
56 53
57#define afs_get_server(S) do { atomic_inc(&(S)->usage); } while(0) 54#define afs_get_server(S) do { atomic_inc(&(S)->usage); } while(0)
58 55
59extern void afs_put_server(struct afs_server *server); 56extern void afs_put_server(struct afs_server *);
60extern void afs_server_do_timeout(struct afs_server *server); 57extern void afs_server_do_timeout(struct afs_server *);
61 58
62extern int afs_server_find_by_peer(const struct rxrpc_peer *peer, 59extern int afs_server_find_by_peer(const struct rxrpc_peer *,
63 struct afs_server **_server); 60 struct afs_server **);
64 61
65extern int afs_server_get_vlconn(struct afs_server *server, 62extern int afs_server_get_vlconn(struct afs_server *,
66 struct rxrpc_connection **_conn); 63 struct rxrpc_connection **);
67 64
68static inline 65static inline
69struct afs_server *afs_server_get_from_peer(struct rxrpc_peer *peer) 66struct afs_server *afs_server_get_from_peer(struct rxrpc_peer *peer)
@@ -79,12 +76,10 @@ struct afs_server *afs_server_get_from_peer(struct rxrpc_peer *peer)
79 return server; 76 return server;
80} 77}
81 78
82/*****************************************************************************/
83/* 79/*
84 * AFS server callslot grant record 80 * AFS server callslot grant record
85 */ 81 */
86struct afs_server_callslot 82struct afs_server_callslot {
87{
88 struct list_head link; /* link in server's list */ 83 struct list_head link; /* link in server's list */
89 struct task_struct *task; /* process waiting to make call */ 84 struct task_struct *task; /* process waiting to make call */
90 struct rxrpc_connection *conn; /* connection to use (or NULL on error) */ 85 struct rxrpc_connection *conn; /* connection to use (or NULL on error) */
@@ -93,10 +88,10 @@ struct afs_server_callslot
93 int errno; /* error number if nconn==-1 */ 88 int errno; /* error number if nconn==-1 */
94}; 89};
95 90
96extern int afs_server_request_callslot(struct afs_server *server, 91extern int afs_server_request_callslot(struct afs_server *,
97 struct afs_server_callslot *callslot); 92 struct afs_server_callslot *);
98 93
99extern void afs_server_release_callslot(struct afs_server *server, 94extern void afs_server_release_callslot(struct afs_server *,
100 struct afs_server_callslot *callslot); 95 struct afs_server_callslot *);
101 96
102#endif /* _LINUX_AFS_SERVER_H */ 97#endif /* AFS_SERVER_H */