1 /* cell.h: 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 _LINUX_AFS_CELL_H
13 #define _LINUX_AFS_CELL_H
17 extern volatile int afs_cells_being_purged
; /* T when cells are being purged by rmmod */
19 /*****************************************************************************/
26 struct list_head link
; /* main cell list link */
27 struct list_head proc_link
; /* /proc cell list link */
28 struct proc_dir_entry
*proc_dir
; /* /proc dir for this cell */
29 struct list_head caches
; /* list of caches currently backing this cell */
31 /* server record management */
32 rwlock_t sv_lock
; /* active server list lock */
33 struct list_head sv_list
; /* active server list */
34 struct list_head sv_graveyard
; /* inactive server list */
35 spinlock_t sv_gylock
; /* inactive server list lock */
37 /* volume location record management */
38 struct rw_semaphore vl_sem
; /* volume management serialisation semaphore */
39 struct list_head vl_list
; /* cell's active VL record list */
40 struct list_head vl_graveyard
; /* cell's inactive VL record list */
41 spinlock_t vl_gylock
; /* graveyard lock */
42 unsigned short vl_naddrs
; /* number of VL servers in addr list */
43 unsigned short vl_curr_svix
; /* current server index */
44 struct in_addr vl_addrs
[16]; /* cell VL server addresses */
46 char name
[0]; /* cell name - must go last */
49 extern int afs_cell_init(void);
51 extern int afs_cell_create(const char *name
, char *vllist
, afs_cell_t
**_cell
);
53 extern int afs_cell_lookup(const char *name
, afs_cell_t
**_cell
);
55 #define afs_get_cell(C) do { atomic_inc(&(C)->usage); } while(0)
57 extern afs_cell_t
*afs_get_cell_maybe(afs_cell_t
**_cell
);
59 extern void afs_put_cell(afs_cell_t
*cell
);
61 extern void afs_cell_purge(void);
63 #endif /* _LINUX_AFS_CELL_H */