ia64/linux-2.6.18-xen.hg

view fs/afs/cell.h @ 524:7f8b544237bf

netfront: Allow netfront in domain 0.

This is useful if your physical network device is in a utility domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 15 15:18:58 2008 +0100 (2008-04-15)
parents 831230e53067
children
line source
1 /* cell.h: AFS cell 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 */
12 #ifndef _LINUX_AFS_CELL_H
13 #define _LINUX_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 */
22 /*****************************************************************************/
23 /*
24 * entry in the cached cell catalogue
25 */
26 struct afs_cache_cell
27 {
28 char name[64]; /* cell name (padded with NULs) */
29 struct in_addr vl_servers[15]; /* cached cell VL servers */
30 };
32 /*****************************************************************************/
33 /*
34 * AFS cell record
35 */
36 struct afs_cell
37 {
38 atomic_t usage;
39 struct list_head link; /* main cell list link */
40 struct list_head proc_link; /* /proc cell list link */
41 struct proc_dir_entry *proc_dir; /* /proc dir for this cell */
42 #ifdef AFS_CACHING_SUPPORT
43 struct cachefs_cookie *cache; /* caching cookie */
44 #endif
46 /* server record management */
47 rwlock_t sv_lock; /* active server list lock */
48 struct list_head sv_list; /* active server list */
49 struct list_head sv_graveyard; /* inactive server list */
50 spinlock_t sv_gylock; /* inactive server list lock */
52 /* volume location record management */
53 struct rw_semaphore vl_sem; /* volume management serialisation semaphore */
54 struct list_head vl_list; /* cell's active VL record list */
55 struct list_head vl_graveyard; /* cell's inactive VL record list */
56 spinlock_t vl_gylock; /* graveyard lock */
57 unsigned short vl_naddrs; /* number of VL servers in addr list */
58 unsigned short vl_curr_svix; /* current server index */
59 struct in_addr vl_addrs[AFS_CELL_MAX_ADDRS]; /* cell VL server addresses */
61 char name[0]; /* cell name - must go last */
62 };
64 extern int afs_cell_init(char *rootcell);
66 extern int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell);
68 extern int afs_cell_lookup(const char *name, unsigned nmsize, struct afs_cell **_cell);
70 #define afs_get_cell(C) do { atomic_inc(&(C)->usage); } while(0)
72 extern struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell);
74 extern void afs_put_cell(struct afs_cell *cell);
76 extern void afs_cell_purge(void);
78 #endif /* _LINUX_AFS_CELL_H */