Skip to content

Commit ec26815

Browse files
dhowellsdavem330
authored andcommitted
[AFS]: Clean up the AFS sources
Clean up the AFS sources. Also remove references to AFS keys. RxRPC keys are used instead. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 17926a7 commit ec26815

36 files changed

+506
-906
lines changed

fs/afs/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Makefile for Red Hat Linux AFS client.
33
#
44

5-
#CFLAGS += -finstrument-functions
6-
75
kafs-objs := \
86
callback.o \
97
cell.o \

fs/afs/cache.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* cache.h: AFS local cache management interface
1+
/* AFS local cache management interface
22
*
33
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
@@ -9,8 +9,8 @@
99
* 2 of the License, or (at your option) any later version.
1010
*/
1111

12-
#ifndef _LINUX_AFS_CACHE_H
13-
#define _LINUX_AFS_CACHE_H
12+
#ifndef AFS_CACHE_H
13+
#define AFS_CACHE_H
1414

1515
#undef AFS_CACHING_SUPPORT
1616

@@ -20,8 +20,4 @@
2020
#endif
2121
#include "types.h"
2222

23-
#ifdef __KERNEL__
24-
25-
#endif /* __KERNEL__ */
26-
27-
#endif /* _LINUX_AFS_CACHE_H */
23+
#endif /* AFS_CACHE_H */

fs/afs/callback.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "internal.h"
2222
#include "cmservice.h"
2323

24-
/*****************************************************************************/
2524
/*
2625
* allow the fileserver to request callback state (re-)initialisation
2726
*/
@@ -79,9 +78,8 @@ int SRXAFSCM_InitCallBackState(struct afs_server *server)
7978

8079
_leave(" = 0");
8180
return 0;
82-
} /* end SRXAFSCM_InitCallBackState() */
81+
}
8382

84-
/*****************************************************************************/
8583
/*
8684
* allow the fileserver to break callback promises
8785
*/
@@ -156,14 +154,13 @@ int SRXAFSCM_CallBack(struct afs_server *server, size_t count,
156154

157155
_leave(" = 0");
158156
return 0;
159-
} /* end SRXAFSCM_CallBack() */
157+
}
160158

161-
/*****************************************************************************/
162159
/*
163160
* allow the fileserver to see if the cache manager is still alive
164161
*/
165162
int SRXAFSCM_Probe(struct afs_server *server)
166163
{
167164
_debug("SRXAFSCM_Probe(%p)\n", server);
168165
return 0;
169-
} /* end SRXAFSCM_Probe() */
166+
}

fs/afs/cell.c

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* cell.c: AFS cell and server record management
1+
/* AFS cell and server record management
22
*
33
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
@@ -44,7 +44,6 @@ struct cachefs_index_def afs_cache_cell_index_def = {
4444
};
4545
#endif
4646

47-
/*****************************************************************************/
4847
/*
4948
* create a cell record
5049
* - "name" is the name of the cell
@@ -137,16 +136,15 @@ int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell)
137136
_leave(" = 0 (%p)", cell);
138137
return 0;
139138

140-
badaddr:
139+
badaddr:
141140
printk(KERN_ERR "kAFS: bad VL server IP address: '%s'\n", vllist);
142-
error:
141+
error:
143142
up_write(&afs_cells_sem);
144143
kfree(cell);
145144
_leave(" = %d", ret);
146145
return ret;
147-
} /* end afs_cell_create() */
146+
}
148147

149-
/*****************************************************************************/
150148
/*
151149
* initialise the cell database from module parameters
152150
*/
@@ -199,10 +197,8 @@ int afs_cell_init(char *rootcell)
199197

200198
_leave(" = %d", ret);
201199
return ret;
200+
}
202201

203-
} /* end afs_cell_init() */
204-
205-
/*****************************************************************************/
206202
/*
207203
* lookup a cell record
208204
*/
@@ -234,8 +230,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
234230

235231
if (cell)
236232
ret = 0;
237-
}
238-
else {
233+
} else {
239234
read_lock(&afs_cells_lock);
240235

241236
cell = afs_cell_root;
@@ -247,8 +242,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
247242
* for other reasons.
248243
*/
249244
ret = -EDESTADDRREQ;
250-
}
251-
else {
245+
} else {
252246
afs_get_cell(cell);
253247
ret = 0;
254248
}
@@ -259,10 +253,8 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
259253
*_cell = cell;
260254
_leave(" = %d (%p)", ret, cell);
261255
return ret;
256+
}
262257

263-
} /* end afs_cell_lookup() */
264-
265-
/*****************************************************************************/
266258
/*
267259
* try and get a cell record
268260
*/
@@ -281,9 +273,8 @@ struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell)
281273
write_unlock(&afs_cells_lock);
282274

283275
return cell;
284-
} /* end afs_get_cell_maybe() */
276+
}
285277

286-
/*****************************************************************************/
287278
/*
288279
* destroy a cell record
289280
*/
@@ -315,9 +306,8 @@ void afs_put_cell(struct afs_cell *cell)
315306
BUG_ON(!list_empty(&cell->vl_graveyard));
316307

317308
_leave(" [unused]");
318-
} /* end afs_put_cell() */
309+
}
319310

320-
/*****************************************************************************/
321311
/*
322312
* destroy a cell record
323313
*/
@@ -359,9 +349,8 @@ static void afs_cell_destroy(struct afs_cell *cell)
359349
kfree(cell);
360350

361351
_leave(" [destroyed]");
362-
} /* end afs_cell_destroy() */
352+
}
363353

364-
/*****************************************************************************/
365354
/*
366355
* lookup the server record corresponding to an Rx RPC peer
367356
*/
@@ -411,28 +400,26 @@ int afs_server_find_by_peer(const struct rxrpc_peer *peer,
411400
return -ENOENT;
412401

413402
/* we found it in the graveyard - resurrect it */
414-
found_dead_server:
403+
found_dead_server:
415404
list_move_tail(&server->link, &cell->sv_list);
416405
afs_get_server(server);
417406
afs_kafstimod_del_timer(&server->timeout);
418407
spin_unlock(&cell->sv_gylock);
419408
goto success;
420409

421410
/* we found it - increment its ref count and return it */
422-
found_server:
411+
found_server:
423412
afs_get_server(server);
424413

425-
success:
414+
success:
426415
write_unlock(&cell->sv_lock);
427416
read_unlock(&afs_cells_lock);
428417

429418
*_server = server;
430419
_leave(" = 0 (s=%p c=%p)", server, cell);
431420
return 0;
421+
}
432422

433-
} /* end afs_server_find_by_peer() */
434-
435-
/*****************************************************************************/
436423
/*
437424
* purge in-memory cell database on module unload or afs_init() failure
438425
* - the timeout daemon is stopped before calling this
@@ -520,9 +507,8 @@ void afs_cell_purge(void)
520507
}
521508

522509
_leave("");
523-
} /* end afs_cell_purge() */
510+
}
524511

525-
/*****************************************************************************/
526512
/*
527513
* match a cell record obtained from the cache
528514
*/
@@ -542,10 +528,9 @@ static cachefs_match_val_t afs_cell_cache_match(void *target,
542528

543529
_leave(" = FAILED");
544530
return CACHEFS_MATCH_FAILED;
545-
} /* end afs_cell_cache_match() */
531+
}
546532
#endif
547533

548-
/*****************************************************************************/
549534
/*
550535
* update a cell record in the cache
551536
*/
@@ -563,5 +548,5 @@ static void afs_cell_cache_update(void *source, void *entry)
563548
cell->vl_addrs,
564549
min(sizeof(ccell->vl_servers), sizeof(cell->vl_addrs)));
565550

566-
} /* end afs_cell_cache_update() */
551+
}
567552
#endif

fs/afs/cell.h

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* cell.h: AFS cell record
1+
/* AFS cell record
22
*
33
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
@@ -9,8 +9,8 @@
99
* 2 of the License, or (at your option) any later version.
1010
*/
1111

12-
#ifndef _LINUX_AFS_CELL_H
13-
#define _LINUX_AFS_CELL_H
12+
#ifndef AFS_CELL_H
13+
#define AFS_CELL_H
1414

1515
#include "types.h"
1616
#include "cache.h"
@@ -19,22 +19,18 @@
1919

2020
extern volatile int afs_cells_being_purged; /* T when cells are being purged by rmmod */
2121

22-
/*****************************************************************************/
2322
/*
2423
* entry in the cached cell catalogue
2524
*/
26-
struct afs_cache_cell
27-
{
25+
struct afs_cache_cell {
2826
char name[64]; /* cell name (padded with NULs) */
2927
struct in_addr vl_servers[15]; /* cached cell VL servers */
3028
};
3129

32-
/*****************************************************************************/
3330
/*
3431
* AFS cell record
3532
*/
36-
struct afs_cell
37-
{
33+
struct afs_cell {
3834
atomic_t usage;
3935
struct list_head link; /* main cell list link */
4036
struct list_head proc_link; /* /proc cell list link */
@@ -61,18 +57,14 @@ struct afs_cell
6157
char name[0]; /* cell name - must go last */
6258
};
6359

64-
extern int afs_cell_init(char *rootcell);
65-
66-
extern int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell);
67-
68-
extern int afs_cell_lookup(const char *name, unsigned nmsize, struct afs_cell **_cell);
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 **);
6963

7064
#define afs_get_cell(C) do { atomic_inc(&(C)->usage); } while(0)
7165

72-
extern struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell);
73-
74-
extern void afs_put_cell(struct afs_cell *cell);
75-
66+
extern struct afs_cell *afs_get_cell_maybe(struct afs_cell **);
67+
extern void afs_put_cell(struct afs_cell *);
7668
extern void afs_cell_purge(void);
7769

78-
#endif /* _LINUX_AFS_CELL_H */
70+
#endif /* AFS_CELL_H */

0 commit comments

Comments
 (0)