forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up the AFS sources. Also remove references to AFS keys. RxRPC keys are used instead. Signed-off-by: David Howells <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
36 changed files
with
506 additions
and
906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* cache.h: AFS local cache management interface | ||
/* AFS local cache management interface | ||
* | ||
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. | ||
* Written by David Howells ([email protected]) | ||
|
@@ -9,8 +9,8 @@ | |
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
|
||
#ifndef _LINUX_AFS_CACHE_H | ||
#define _LINUX_AFS_CACHE_H | ||
#ifndef AFS_CACHE_H | ||
#define AFS_CACHE_H | ||
|
||
#undef AFS_CACHING_SUPPORT | ||
|
||
|
@@ -20,8 +20,4 @@ | |
#endif | ||
#include "types.h" | ||
|
||
#ifdef __KERNEL__ | ||
|
||
#endif /* __KERNEL__ */ | ||
|
||
#endif /* _LINUX_AFS_CACHE_H */ | ||
#endif /* AFS_CACHE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* cell.c: AFS cell and server record management | ||
/* AFS cell and server record management | ||
* | ||
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. | ||
* Written by David Howells ([email protected]) | ||
|
@@ -44,7 +44,6 @@ struct cachefs_index_def afs_cache_cell_index_def = { | |
}; | ||
#endif | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* create a cell record | ||
* - "name" is the name of the cell | ||
|
@@ -137,16 +136,15 @@ int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell) | |
_leave(" = 0 (%p)", cell); | ||
return 0; | ||
|
||
badaddr: | ||
badaddr: | ||
printk(KERN_ERR "kAFS: bad VL server IP address: '%s'\n", vllist); | ||
error: | ||
error: | ||
up_write(&afs_cells_sem); | ||
kfree(cell); | ||
_leave(" = %d", ret); | ||
return ret; | ||
} /* end afs_cell_create() */ | ||
} | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* initialise the cell database from module parameters | ||
*/ | ||
|
@@ -199,10 +197,8 @@ int afs_cell_init(char *rootcell) | |
|
||
_leave(" = %d", ret); | ||
return ret; | ||
} | ||
|
||
} /* end afs_cell_init() */ | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* lookup a cell record | ||
*/ | ||
|
@@ -234,8 +230,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell) | |
|
||
if (cell) | ||
ret = 0; | ||
} | ||
else { | ||
} else { | ||
read_lock(&afs_cells_lock); | ||
|
||
cell = afs_cell_root; | ||
|
@@ -247,8 +242,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell) | |
* for other reasons. | ||
*/ | ||
ret = -EDESTADDRREQ; | ||
} | ||
else { | ||
} else { | ||
afs_get_cell(cell); | ||
ret = 0; | ||
} | ||
|
@@ -259,10 +253,8 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell) | |
*_cell = cell; | ||
_leave(" = %d (%p)", ret, cell); | ||
return ret; | ||
} | ||
|
||
} /* end afs_cell_lookup() */ | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* try and get a cell record | ||
*/ | ||
|
@@ -281,9 +273,8 @@ struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell) | |
write_unlock(&afs_cells_lock); | ||
|
||
return cell; | ||
} /* end afs_get_cell_maybe() */ | ||
} | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* destroy a cell record | ||
*/ | ||
|
@@ -315,9 +306,8 @@ void afs_put_cell(struct afs_cell *cell) | |
BUG_ON(!list_empty(&cell->vl_graveyard)); | ||
|
||
_leave(" [unused]"); | ||
} /* end afs_put_cell() */ | ||
} | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* destroy a cell record | ||
*/ | ||
|
@@ -359,9 +349,8 @@ static void afs_cell_destroy(struct afs_cell *cell) | |
kfree(cell); | ||
|
||
_leave(" [destroyed]"); | ||
} /* end afs_cell_destroy() */ | ||
} | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* lookup the server record corresponding to an Rx RPC peer | ||
*/ | ||
|
@@ -411,28 +400,26 @@ int afs_server_find_by_peer(const struct rxrpc_peer *peer, | |
return -ENOENT; | ||
|
||
/* we found it in the graveyard - resurrect it */ | ||
found_dead_server: | ||
found_dead_server: | ||
list_move_tail(&server->link, &cell->sv_list); | ||
afs_get_server(server); | ||
afs_kafstimod_del_timer(&server->timeout); | ||
spin_unlock(&cell->sv_gylock); | ||
goto success; | ||
|
||
/* we found it - increment its ref count and return it */ | ||
found_server: | ||
found_server: | ||
afs_get_server(server); | ||
|
||
success: | ||
success: | ||
write_unlock(&cell->sv_lock); | ||
read_unlock(&afs_cells_lock); | ||
|
||
*_server = server; | ||
_leave(" = 0 (s=%p c=%p)", server, cell); | ||
return 0; | ||
} | ||
|
||
} /* end afs_server_find_by_peer() */ | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* purge in-memory cell database on module unload or afs_init() failure | ||
* - the timeout daemon is stopped before calling this | ||
|
@@ -520,9 +507,8 @@ void afs_cell_purge(void) | |
} | ||
|
||
_leave(""); | ||
} /* end afs_cell_purge() */ | ||
} | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* match a cell record obtained from the cache | ||
*/ | ||
|
@@ -542,10 +528,9 @@ static cachefs_match_val_t afs_cell_cache_match(void *target, | |
|
||
_leave(" = FAILED"); | ||
return CACHEFS_MATCH_FAILED; | ||
} /* end afs_cell_cache_match() */ | ||
} | ||
#endif | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* update a cell record in the cache | ||
*/ | ||
|
@@ -563,5 +548,5 @@ static void afs_cell_cache_update(void *source, void *entry) | |
cell->vl_addrs, | ||
min(sizeof(ccell->vl_servers), sizeof(cell->vl_addrs))); | ||
|
||
} /* end afs_cell_cache_update() */ | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* cell.h: AFS cell record | ||
/* AFS cell record | ||
* | ||
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. | ||
* Written by David Howells ([email protected]) | ||
|
@@ -9,8 +9,8 @@ | |
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
|
||
#ifndef _LINUX_AFS_CELL_H | ||
#define _LINUX_AFS_CELL_H | ||
#ifndef AFS_CELL_H | ||
#define AFS_CELL_H | ||
|
||
#include "types.h" | ||
#include "cache.h" | ||
|
@@ -19,22 +19,18 @@ | |
|
||
extern volatile int afs_cells_being_purged; /* T when cells are being purged by rmmod */ | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* entry in the cached cell catalogue | ||
*/ | ||
struct afs_cache_cell | ||
{ | ||
struct afs_cache_cell { | ||
char name[64]; /* cell name (padded with NULs) */ | ||
struct in_addr vl_servers[15]; /* cached cell VL servers */ | ||
}; | ||
|
||
/*****************************************************************************/ | ||
/* | ||
* AFS cell record | ||
*/ | ||
struct afs_cell | ||
{ | ||
struct afs_cell { | ||
atomic_t usage; | ||
struct list_head link; /* main cell list link */ | ||
struct list_head proc_link; /* /proc cell list link */ | ||
|
@@ -61,18 +57,14 @@ struct afs_cell | |
char name[0]; /* cell name - must go last */ | ||
}; | ||
|
||
extern int afs_cell_init(char *rootcell); | ||
|
||
extern int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell); | ||
|
||
extern int afs_cell_lookup(const char *name, unsigned nmsize, struct afs_cell **_cell); | ||
extern int afs_cell_init(char *); | ||
extern int afs_cell_create(const char *, char *, struct afs_cell **); | ||
extern int afs_cell_lookup(const char *, unsigned, struct afs_cell **); | ||
|
||
#define afs_get_cell(C) do { atomic_inc(&(C)->usage); } while(0) | ||
|
||
extern struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell); | ||
|
||
extern void afs_put_cell(struct afs_cell *cell); | ||
|
||
extern struct afs_cell *afs_get_cell_maybe(struct afs_cell **); | ||
extern void afs_put_cell(struct afs_cell *); | ||
extern void afs_cell_purge(void); | ||
|
||
#endif /* _LINUX_AFS_CELL_H */ | ||
#endif /* AFS_CELL_H */ |
Oops, something went wrong.