Skip to content

Commit 08e0e7c

Browse files
dhowellsdavem330
authored andcommitted
[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.
Make the in-kernel AFS filesystem use AF_RXRPC instead of the old RxRPC code. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 651350d commit 08e0e7c

39 files changed

+4011
-5240
lines changed

fs/Kconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,7 @@ config CODA_FS_OLD_API
20192019
config AFS_FS
20202020
tristate "Andrew File System support (AFS) (EXPERIMENTAL)"
20212021
depends on INET && EXPERIMENTAL
2022-
select RXRPC
2022+
select AF_RXRPC
20232023
help
20242024
If you say Y here, you will get an experimental Andrew File System
20252025
driver. It currently only supports unsecured read-only AFS access.
@@ -2028,6 +2028,17 @@ config AFS_FS
20282028

20292029
If unsure, say N.
20302030

2031+
config AFS_DEBUG
2032+
bool "AFS dynamic debugging"
2033+
depends on AFS_FS
2034+
help
2035+
Say Y here to make runtime controllable debugging messages appear.
2036+
2037+
See <file:Documentation/filesystems/afs.txt> for more information.
2038+
2039+
If unsure, say N.
2040+
2041+
20312042
config RXRPC
20322043
tristate
20332044

fs/afs/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ kafs-objs := \
1010
file.o \
1111
fsclient.o \
1212
inode.o \
13-
kafsasyncd.o \
14-
kafstimod.o \
1513
main.o \
1614
misc.o \
1715
mntpt.o \
1816
proc.o \
17+
rxrpc.o \
1918
server.o \
2019
super.o \
2120
vlclient.o \

fs/afs/types.h renamed to fs/afs/afs.h

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/* AFS types
1+
/* AFS common types
22
*
3-
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
3+
* Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
55
*
66
* This program is free software; you can redistribute it and/or
@@ -9,10 +9,10 @@
99
* 2 of the License, or (at your option) any later version.
1010
*/
1111

12-
#ifndef AFS_TYPES_H
13-
#define AFS_TYPES_H
12+
#ifndef AFS_H
13+
#define AFS_H
1414

15-
#include <rxrpc/types.h>
15+
#include <linux/in.h>
1616

1717
typedef unsigned afs_volid_t;
1818
typedef unsigned afs_vnodeid_t;
@@ -31,9 +31,6 @@ typedef enum {
3131
AFS_FTYPE_SYMLINK = 3,
3232
} afs_file_type_t;
3333

34-
struct afs_cell;
35-
struct afs_vnode;
36-
3734
/*
3835
* AFS file identifier
3936
*/
@@ -54,14 +51,13 @@ typedef enum {
5451
} afs_callback_type_t;
5552

5653
struct afs_callback {
57-
struct afs_server *server; /* server that made the promise */
5854
struct afs_fid fid; /* file identifier */
5955
unsigned version; /* callback version */
6056
unsigned expiry; /* time at which expires */
6157
afs_callback_type_t type; /* type of callback */
6258
};
6359

64-
#define AFSCBMAX 50
60+
#define AFSCBMAX 50 /* maximum callbacks transferred per bulk op */
6561

6662
/*
6763
* AFS volume information
@@ -70,7 +66,7 @@ struct afs_volume_info {
7066
afs_volid_t vid; /* volume ID */
7167
afs_voltype_t type; /* type of this volume */
7268
afs_volid_t type_vids[5]; /* volume ID's for possible types for this vol */
73-
69+
7470
/* list of fileservers serving this volume */
7571
size_t nservers; /* number of entries used in servers[] */
7672
struct {
@@ -88,7 +84,7 @@ struct afs_file_status {
8884
afs_file_type_t type; /* file type */
8985
unsigned nlink; /* link count */
9086
size_t size; /* file size */
91-
afs_dataversion_t version; /* current data version */
87+
afs_dataversion_t data_version; /* current data version */
9288
unsigned author; /* author ID */
9389
unsigned owner; /* owner ID */
9490
unsigned caller_access; /* access rights for authenticated caller */
@@ -106,4 +102,4 @@ struct afs_volsync {
106102
time_t creation; /* volume creation time */
107103
};
108104

109-
#endif /* AFS_TYPES_H */
105+
#endif /* AFS_H */

fs/afs/afs_cm.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* AFS Cache Manager definitions
2+
*
3+
* Copyright (C) 2007 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+
*/
11+
12+
#ifndef AFS_CM_H
13+
#define AFS_CM_H
14+
15+
#define AFS_CM_PORT 7001 /* AFS file server port */
16+
#define CM_SERVICE 1 /* AFS File Service ID */
17+
18+
enum AFS_CM_Operations {
19+
CBCallBack = 204, /* break callback promises */
20+
CBInitCallBackState = 205, /* initialise callback state */
21+
CBProbe = 206, /* probe client */
22+
CBGetLock = 207, /* get contents of CM lock table */
23+
CBGetCE = 208, /* get cache file description */
24+
CBGetXStatsVersion = 209, /* get version of extended statistics */
25+
CBGetXStats = 210, /* get contents of extended statistics data */
26+
};
27+
28+
#endif /* AFS_FS_H */
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/* AFS abort/error codes
1+
/* AFS File Service definitions
22
*
3-
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
3+
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
55
*
66
* This program is free software; you can redistribute it and/or
@@ -9,15 +9,22 @@
99
* 2 of the License, or (at your option) any later version.
1010
*/
1111

12-
#ifndef AFS_ERRORS_H
13-
#define AFS_ERRORS_H
12+
#ifndef AFS_FS_H
13+
#define AFS_FS_H
1414

15-
#include "types.h"
15+
#define AFS_FS_PORT 7000 /* AFS file server port */
16+
#define FS_SERVICE 1 /* AFS File Service ID */
1617

17-
/*
18-
* file server abort codes
19-
*/
20-
typedef enum {
18+
enum AFS_FS_Operations {
19+
FSFETCHSTATUS = 132, /* AFS Fetch file status */
20+
FSFETCHDATA = 130, /* AFS Fetch file data */
21+
FSGIVEUPCALLBACKS = 147, /* AFS Discard callback promises */
22+
FSGETVOLUMEINFO = 148, /* AFS Get root volume information */
23+
FSGETROOTVOLUME = 151, /* AFS Get root volume name */
24+
FSLOOKUP = 161 /* AFS lookup file in directory */
25+
};
26+
27+
enum AFS_FS_Errors {
2128
VSALVAGE = 101, /* volume needs salvaging */
2229
VNOVNODE = 102, /* no such file/dir (vnode) */
2330
VNOVOL = 103, /* no such volume or volume unavailable */
@@ -29,8 +36,6 @@ typedef enum {
2936
VOVERQUOTA = 109, /* volume's maximum quota exceeded */
3037
VBUSY = 110, /* volume is temporarily unavailable */
3138
VMOVED = 111, /* volume moved to new server - ask this FS where */
32-
} afs_rxfs_abort_t;
33-
34-
extern int afs_abort_to_error(int);
39+
};
3540

36-
#endif /* AFS_ERRORS_H */
41+
#endif /* AFS_FS_H */

fs/afs/vlclient.h renamed to fs/afs/afs_vl.h

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/* Volume Location Service client interface
1+
/* AFS Volume Location Service client interface
22
*
3-
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
3+
* Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
44
* Written by David Howells (dhowells@redhat.com)
55
*
66
* This program is free software; you can redistribute it and/or
@@ -9,10 +9,19 @@
99
* 2 of the License, or (at your option) any later version.
1010
*/
1111

12-
#ifndef AFS_VLCLIENT_H
13-
#define AFS_VLCLIENT_H
12+
#ifndef AFS_VL_H
13+
#define AFS_VL_H
1414

15-
#include "types.h"
15+
#include "afs.h"
16+
17+
#define AFS_VL_PORT 7003 /* volume location service port */
18+
#define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */
19+
20+
enum AFSVL_Operations {
21+
VLGETENTRYBYID = 503, /* AFS Get Cache Entry By ID operation ID */
22+
VLGETENTRYBYNAME = 504, /* AFS Get Cache Entry By Name operation ID */
23+
VLPROBE = 514, /* AFS Probe Volume Location Service operation ID */
24+
};
1625

1726
enum AFSVL_Errors {
1827
AFSVL_IDEXIST = 363520, /* Volume Id entry exists in vl database */
@@ -40,14 +49,16 @@ enum AFSVL_Errors {
4049
AFSVL_BADVOLOPER = 363542, /* Bad volume operation code */
4150
AFSVL_BADRELLOCKTYPE = 363543, /* Bad release lock type */
4251
AFSVL_RERELEASE = 363544, /* Status report: last release was aborted */
43-
AFSVL_BADSERVERFLAG = 363545, /* Invalid replication site server °ag */
52+
AFSVL_BADSERVERFLAG = 363545, /* Invalid replication site server °ag */
4453
AFSVL_PERM = 363546, /* No permission access */
4554
AFSVL_NOMEM = 363547, /* malloc/realloc failed to alloc enough memory */
4655
};
4756

48-
/* maps to "struct vldbentry" in vvl-spec.pdf */
57+
/*
58+
* maps to "struct vldbentry" in vvl-spec.pdf
59+
*/
4960
struct afs_vldbentry {
50-
char name[65]; /* name of volume (including NUL char) */
61+
char name[65]; /* name of volume (with NUL char) */
5162
afs_voltype_t type; /* volume type */
5263
unsigned num_servers; /* num servers that hold instances of this vol */
5364
unsigned clone_id; /* cloning ID */
@@ -70,16 +81,4 @@ struct afs_vldbentry {
7081
} servers[8];
7182
};
7283

73-
extern int afs_rxvl_get_entry_by_name(struct afs_server *, const char *,
74-
unsigned, struct afs_cache_vlocation *);
75-
extern int afs_rxvl_get_entry_by_id(struct afs_server *, afs_volid_t,
76-
afs_voltype_t,
77-
struct afs_cache_vlocation *);
78-
79-
extern int afs_rxvl_get_entry_by_id_async(struct afs_async_op *,
80-
afs_volid_t, afs_voltype_t);
81-
82-
extern int afs_rxvl_get_entry_by_id_async2(struct afs_async_op *,
83-
struct afs_cache_vlocation *);
84-
85-
#endif /* AFS_VLCLIENT_H */
84+
#endif /* AFS_VL_H */

0 commit comments

Comments
 (0)