[AF_RXRPC]: Add an interface to the AF_RXRPC module for the AFS filesystem to use
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / fs / afs / cell.h
blobc135b00c6c75a263c24c2a158d745096de44d52d
1 /* AFS cell record
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
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.
12 #ifndef AFS_CELL_H
13 #define AFS_CELL_H
15 #include "types.h"
16 #include "cache.h"
18 #define AFS_CELL_MAX_ADDRS 15
20 extern volatile int afs_cells_being_purged; /* T when cells are being purged by rmmod */
23 * entry in the cached cell catalogue
25 struct afs_cache_cell {
26 char name[64]; /* cell name (padded with NULs) */
27 struct in_addr vl_servers[15]; /* cached cell VL servers */
31 * AFS cell record
33 struct afs_cell {
34 atomic_t usage;
35 struct list_head link; /* main cell list link */
36 struct list_head proc_link; /* /proc cell list link */
37 struct proc_dir_entry *proc_dir; /* /proc dir for this cell */
38 #ifdef AFS_CACHING_SUPPORT
39 struct cachefs_cookie *cache; /* caching cookie */
40 #endif
42 /* server record management */
43 rwlock_t sv_lock; /* active server list lock */
44 struct list_head sv_list; /* active server list */
45 struct list_head sv_graveyard; /* inactive server list */
46 spinlock_t sv_gylock; /* inactive server list lock */
48 /* volume location record management */
49 struct rw_semaphore vl_sem; /* volume management serialisation semaphore */
50 struct list_head vl_list; /* cell's active VL record list */
51 struct list_head vl_graveyard; /* cell's inactive VL record list */
52 spinlock_t vl_gylock; /* graveyard lock */
53 unsigned short vl_naddrs; /* number of VL servers in addr list */
54 unsigned short vl_curr_svix; /* current server index */
55 struct in_addr vl_addrs[AFS_CELL_MAX_ADDRS]; /* cell VL server addresses */
57 char name[0]; /* cell name - must go last */
60 extern int afs_cell_init(char *);
61 extern int afs_cell_create(const char *, char *, struct afs_cell **);
62 extern int afs_cell_lookup(const char *, unsigned, struct afs_cell **);
64 #define afs_get_cell(C) do { atomic_inc(&(C)->usage); } while(0)
66 extern struct afs_cell *afs_get_cell_maybe(struct afs_cell **);
67 extern void afs_put_cell(struct afs_cell *);
68 extern void afs_cell_purge(void);
70 #endif /* AFS_CELL_H */