diff options
author | David Howells <dhowells@redhat.com> | 2007-04-26 18:55:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-26 18:55:03 -0400 |
commit | 08e0e7c82eeadec6f4871a386b86bf0f0fbcb4eb (patch) | |
tree | 1c4f7e91e20e56ff2ec755e988a6ee828b1a21c0 /fs/afs/server.h | |
parent | 651350d10f93bed7003c9a66e24cf25e0f8eed3d (diff) |
[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.
Make the in-kernel AFS filesystem use AF_RXRPC instead of the old RxRPC code.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/afs/server.h')
-rw-r--r-- | fs/afs/server.h | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/fs/afs/server.h b/fs/afs/server.h deleted file mode 100644 index e1a006829b5d..000000000000 --- a/fs/afs/server.h +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | /* AFS server record | ||
2 | * | ||
3 | * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef AFS_SERVER_H | ||
13 | #define AFS_SERVER_H | ||
14 | |||
15 | #include "types.h" | ||
16 | #include "kafstimod.h" | ||
17 | #include <rxrpc/peer.h> | ||
18 | #include <linux/rwsem.h> | ||
19 | |||
20 | extern spinlock_t afs_server_peer_lock; | ||
21 | |||
22 | /* | ||
23 | * AFS server record | ||
24 | */ | ||
25 | struct afs_server { | ||
26 | atomic_t usage; | ||
27 | struct afs_cell *cell; /* cell in which server resides */ | ||
28 | struct list_head link; /* link in cell's server list */ | ||
29 | struct rw_semaphore sem; /* access lock */ | ||
30 | struct afs_timer timeout; /* graveyard timeout */ | ||
31 | struct in_addr addr; /* server address */ | ||
32 | struct rxrpc_peer *peer; /* peer record for this server */ | ||
33 | struct rxrpc_connection *vlserver; /* connection to the volume location service */ | ||
34 | |||
35 | /* file service access */ | ||
36 | #define AFS_SERVER_CONN_LIST_SIZE 2 | ||
37 | struct rxrpc_connection *fs_conn[AFS_SERVER_CONN_LIST_SIZE]; /* FS connections */ | ||
38 | unsigned fs_conn_cnt[AFS_SERVER_CONN_LIST_SIZE]; /* per conn call count */ | ||
39 | struct list_head fs_callq; /* queue of processes waiting to make a call */ | ||
40 | spinlock_t fs_lock; /* access lock */ | ||
41 | int fs_state; /* 0 or reason FS currently marked dead (-errno) */ | ||
42 | unsigned fs_rtt; /* FS round trip time */ | ||
43 | unsigned long fs_act_jif; /* time at which last activity occurred */ | ||
44 | unsigned long fs_dead_jif; /* time at which no longer to be considered dead */ | ||
45 | |||
46 | /* callback promise management */ | ||
47 | struct list_head cb_promises; /* as yet unbroken promises from this server */ | ||
48 | spinlock_t cb_lock; /* access lock */ | ||
49 | }; | ||
50 | |||
51 | extern int afs_server_lookup(struct afs_cell *, const struct in_addr *, | ||
52 | struct afs_server **); | ||
53 | |||
54 | #define afs_get_server(S) do { atomic_inc(&(S)->usage); } while(0) | ||
55 | |||
56 | extern void afs_put_server(struct afs_server *); | ||
57 | extern void afs_server_do_timeout(struct afs_server *); | ||
58 | |||
59 | extern int afs_server_find_by_peer(const struct rxrpc_peer *, | ||
60 | struct afs_server **); | ||
61 | |||
62 | extern int afs_server_get_vlconn(struct afs_server *, | ||
63 | struct rxrpc_connection **); | ||
64 | |||
65 | static inline | ||
66 | struct afs_server *afs_server_get_from_peer(struct rxrpc_peer *peer) | ||
67 | { | ||
68 | struct afs_server *server; | ||
69 | |||
70 | spin_lock(&afs_server_peer_lock); | ||
71 | server = peer->user; | ||
72 | if (server) | ||
73 | afs_get_server(server); | ||
74 | spin_unlock(&afs_server_peer_lock); | ||
75 | |||
76 | return server; | ||
77 | } | ||
78 | |||
79 | /* | ||
80 | * AFS server callslot grant record | ||
81 | */ | ||
82 | struct afs_server_callslot { | ||
83 | struct list_head link; /* link in server's list */ | ||
84 | struct task_struct *task; /* process waiting to make call */ | ||
85 | struct rxrpc_connection *conn; /* connection to use (or NULL on error) */ | ||
86 | short nconn; /* connection slot number (-1 on error) */ | ||
87 | char ready; /* T when ready */ | ||
88 | int errno; /* error number if nconn==-1 */ | ||
89 | }; | ||
90 | |||
91 | extern int afs_server_request_callslot(struct afs_server *, | ||
92 | struct afs_server_callslot *); | ||
93 | |||
94 | extern void afs_server_release_callslot(struct afs_server *, | ||
95 | struct afs_server_callslot *); | ||
96 | |||
97 | #endif /* AFS_SERVER_H */ | ||