diff options
Diffstat (limited to 'fs/afs/volume.h')
-rw-r--r-- | fs/afs/volume.h | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/fs/afs/volume.h b/fs/afs/volume.h index bfdcf19ba3f3..a605bea2e3a0 100644 --- a/fs/afs/volume.h +++ b/fs/afs/volume.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* volume.h: AFS volume management | 1 | /* AFS volume management |
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_VOLUME_H | 12 | #ifndef AFS_VOLUME_H |
13 | #define _LINUX_AFS_VOLUME_H | 13 | #define AFS_VOLUME_H |
14 | 14 | ||
15 | #include "types.h" | 15 | #include "types.h" |
16 | #include "fsclient.h" | 16 | #include "fsclient.h" |
@@ -23,15 +23,12 @@ typedef enum { | |||
23 | AFS_VLUPD_PENDING, /* on pending queue */ | 23 | AFS_VLUPD_PENDING, /* on pending queue */ |
24 | AFS_VLUPD_INPROGRESS, /* op in progress */ | 24 | AFS_VLUPD_INPROGRESS, /* op in progress */ |
25 | AFS_VLUPD_BUSYSLEEP, /* sleeping because server returned EBUSY */ | 25 | AFS_VLUPD_BUSYSLEEP, /* sleeping because server returned EBUSY */ |
26 | |||
27 | } __attribute__((packed)) afs_vlocation_upd_t; | 26 | } __attribute__((packed)) afs_vlocation_upd_t; |
28 | 27 | ||
29 | /*****************************************************************************/ | ||
30 | /* | 28 | /* |
31 | * entry in the cached volume location catalogue | 29 | * entry in the cached volume location catalogue |
32 | */ | 30 | */ |
33 | struct afs_cache_vlocation | 31 | struct afs_cache_vlocation { |
34 | { | ||
35 | uint8_t name[64]; /* volume name (lowercase, padded with NULs) */ | 32 | uint8_t name[64]; /* volume name (lowercase, padded with NULs) */ |
36 | uint8_t nservers; /* number of entries used in servers[] */ | 33 | uint8_t nservers; /* number of entries used in servers[] */ |
37 | uint8_t vidmask; /* voltype mask for vid[] */ | 34 | uint8_t vidmask; /* voltype mask for vid[] */ |
@@ -49,12 +46,10 @@ struct afs_cache_vlocation | |||
49 | extern struct cachefs_index_def afs_vlocation_cache_index_def; | 46 | extern struct cachefs_index_def afs_vlocation_cache_index_def; |
50 | #endif | 47 | #endif |
51 | 48 | ||
52 | /*****************************************************************************/ | ||
53 | /* | 49 | /* |
54 | * volume -> vnode hash table entry | 50 | * volume -> vnode hash table entry |
55 | */ | 51 | */ |
56 | struct afs_cache_vhash | 52 | struct afs_cache_vhash { |
57 | { | ||
58 | afs_voltype_t vtype; /* which volume variation */ | 53 | afs_voltype_t vtype; /* which volume variation */ |
59 | uint8_t hash_bucket; /* which hash bucket this represents */ | 54 | uint8_t hash_bucket; /* which hash bucket this represents */ |
60 | } __attribute__((packed)); | 55 | } __attribute__((packed)); |
@@ -63,12 +58,10 @@ struct afs_cache_vhash | |||
63 | extern struct cachefs_index_def afs_volume_cache_index_def; | 58 | extern struct cachefs_index_def afs_volume_cache_index_def; |
64 | #endif | 59 | #endif |
65 | 60 | ||
66 | /*****************************************************************************/ | ||
67 | /* | 61 | /* |
68 | * AFS volume location record | 62 | * AFS volume location record |
69 | */ | 63 | */ |
70 | struct afs_vlocation | 64 | struct afs_vlocation { |
71 | { | ||
72 | atomic_t usage; | 65 | atomic_t usage; |
73 | struct list_head link; /* link in cell volume location list */ | 66 | struct list_head link; /* link in cell volume location list */ |
74 | struct afs_timer timeout; /* decaching timer */ | 67 | struct afs_timer timeout; /* decaching timer */ |
@@ -90,22 +83,18 @@ struct afs_vlocation | |||
90 | unsigned short valid; /* T if valid */ | 83 | unsigned short valid; /* T if valid */ |
91 | }; | 84 | }; |
92 | 85 | ||
93 | extern int afs_vlocation_lookup(struct afs_cell *cell, | 86 | extern int afs_vlocation_lookup(struct afs_cell *, const char *, unsigned, |
94 | const char *name, | 87 | struct afs_vlocation **); |
95 | unsigned namesz, | ||
96 | struct afs_vlocation **_vlocation); | ||
97 | 88 | ||
98 | #define afs_get_vlocation(V) do { atomic_inc(&(V)->usage); } while(0) | 89 | #define afs_get_vlocation(V) do { atomic_inc(&(V)->usage); } while(0) |
99 | 90 | ||
100 | extern void afs_put_vlocation(struct afs_vlocation *vlocation); | 91 | extern void afs_put_vlocation(struct afs_vlocation *); |
101 | extern void afs_vlocation_do_timeout(struct afs_vlocation *vlocation); | 92 | extern void afs_vlocation_do_timeout(struct afs_vlocation *); |
102 | 93 | ||
103 | /*****************************************************************************/ | ||
104 | /* | 94 | /* |
105 | * AFS volume access record | 95 | * AFS volume access record |
106 | */ | 96 | */ |
107 | struct afs_volume | 97 | struct afs_volume { |
108 | { | ||
109 | atomic_t usage; | 98 | atomic_t usage; |
110 | struct afs_cell *cell; /* cell to which belongs (unrefd ptr) */ | 99 | struct afs_cell *cell; /* cell to which belongs (unrefd ptr) */ |
111 | struct afs_vlocation *vlocation; /* volume location */ | 100 | struct afs_vlocation *vlocation; /* volume location */ |
@@ -121,20 +110,17 @@ struct afs_volume | |||
121 | struct rw_semaphore server_sem; /* lock for accessing current server */ | 110 | struct rw_semaphore server_sem; /* lock for accessing current server */ |
122 | }; | 111 | }; |
123 | 112 | ||
124 | extern int afs_volume_lookup(const char *name, | 113 | extern int afs_volume_lookup(const char *, struct afs_cell *, int, |
125 | struct afs_cell *cell, | 114 | struct afs_volume **); |
126 | int rwpath, | ||
127 | struct afs_volume **_volume); | ||
128 | 115 | ||
129 | #define afs_get_volume(V) do { atomic_inc(&(V)->usage); } while(0) | 116 | #define afs_get_volume(V) do { atomic_inc(&(V)->usage); } while(0) |
130 | 117 | ||
131 | extern void afs_put_volume(struct afs_volume *volume); | 118 | extern void afs_put_volume(struct afs_volume *); |
132 | 119 | ||
133 | extern int afs_volume_pick_fileserver(struct afs_volume *volume, | 120 | extern int afs_volume_pick_fileserver(struct afs_volume *, |
134 | struct afs_server **_server); | 121 | struct afs_server **); |
135 | 122 | ||
136 | extern int afs_volume_release_fileserver(struct afs_volume *volume, | 123 | extern int afs_volume_release_fileserver(struct afs_volume *, |
137 | struct afs_server *server, | 124 | struct afs_server *, int); |
138 | int result); | ||
139 | 125 | ||
140 | #endif /* _LINUX_AFS_VOLUME_H */ | 126 | #endif /* AFS_VOLUME_H */ |