Skip to content

Commit

Permalink
[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dhowells authored and davem330 committed Apr 26, 2007
1 parent 651350d commit 08e0e7c
Show file tree
Hide file tree
Showing 39 changed files with 4,011 additions and 5,240 deletions.
13 changes: 12 additions & 1 deletion fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ config CODA_FS_OLD_API
config AFS_FS
tristate "Andrew File System support (AFS) (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL
select RXRPC
select AF_RXRPC
help
If you say Y here, you will get an experimental Andrew File System
driver. It currently only supports unsecured read-only AFS access.
Expand All @@ -2028,6 +2028,17 @@ config AFS_FS

If unsure, say N.

config AFS_DEBUG
bool "AFS dynamic debugging"
depends on AFS_FS
help
Say Y here to make runtime controllable debugging messages appear.

See <file:Documentation/filesystems/afs.txt> for more information.

If unsure, say N.


config RXRPC
tristate

Expand Down
3 changes: 1 addition & 2 deletions fs/afs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ kafs-objs := \
file.o \
fsclient.o \
inode.o \
kafsasyncd.o \
kafstimod.o \
main.o \
misc.o \
mntpt.o \
proc.o \
rxrpc.o \
server.o \
super.o \
vlclient.o \
Expand Down
22 changes: 9 additions & 13 deletions fs/afs/types.h → fs/afs/afs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* AFS types
/* AFS common types
*
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
* Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
Expand All @@ -9,10 +9,10 @@
* 2 of the License, or (at your option) any later version.
*/

#ifndef AFS_TYPES_H
#define AFS_TYPES_H
#ifndef AFS_H
#define AFS_H

#include <rxrpc/types.h>
#include <linux/in.h>

typedef unsigned afs_volid_t;
typedef unsigned afs_vnodeid_t;
Expand All @@ -31,9 +31,6 @@ typedef enum {
AFS_FTYPE_SYMLINK = 3,
} afs_file_type_t;

struct afs_cell;
struct afs_vnode;

/*
* AFS file identifier
*/
Expand All @@ -54,14 +51,13 @@ typedef enum {
} afs_callback_type_t;

struct afs_callback {
struct afs_server *server; /* server that made the promise */
struct afs_fid fid; /* file identifier */
unsigned version; /* callback version */
unsigned expiry; /* time at which expires */
afs_callback_type_t type; /* type of callback */
};

#define AFSCBMAX 50
#define AFSCBMAX 50 /* maximum callbacks transferred per bulk op */

/*
* AFS volume information
Expand All @@ -70,7 +66,7 @@ struct afs_volume_info {
afs_volid_t vid; /* volume ID */
afs_voltype_t type; /* type of this volume */
afs_volid_t type_vids[5]; /* volume ID's for possible types for this vol */

/* list of fileservers serving this volume */
size_t nservers; /* number of entries used in servers[] */
struct {
Expand All @@ -88,7 +84,7 @@ struct afs_file_status {
afs_file_type_t type; /* file type */
unsigned nlink; /* link count */
size_t size; /* file size */
afs_dataversion_t version; /* current data version */
afs_dataversion_t data_version; /* current data version */
unsigned author; /* author ID */
unsigned owner; /* owner ID */
unsigned caller_access; /* access rights for authenticated caller */
Expand All @@ -106,4 +102,4 @@ struct afs_volsync {
time_t creation; /* volume creation time */
};

#endif /* AFS_TYPES_H */
#endif /* AFS_H */
28 changes: 28 additions & 0 deletions fs/afs/afs_cm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* AFS Cache Manager definitions
*
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/

#ifndef AFS_CM_H
#define AFS_CM_H

#define AFS_CM_PORT 7001 /* AFS file server port */
#define CM_SERVICE 1 /* AFS File Service ID */

enum AFS_CM_Operations {
CBCallBack = 204, /* break callback promises */
CBInitCallBackState = 205, /* initialise callback state */
CBProbe = 206, /* probe client */
CBGetLock = 207, /* get contents of CM lock table */
CBGetCE = 208, /* get cache file description */
CBGetXStatsVersion = 209, /* get version of extended statistics */
CBGetXStats = 210, /* get contents of extended statistics data */
};

#endif /* AFS_FS_H */
31 changes: 18 additions & 13 deletions fs/afs/errors.h → fs/afs/afs_fs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* AFS abort/error codes
/* AFS File Service definitions
*
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
Expand All @@ -9,15 +9,22 @@
* 2 of the License, or (at your option) any later version.
*/

#ifndef AFS_ERRORS_H
#define AFS_ERRORS_H
#ifndef AFS_FS_H
#define AFS_FS_H

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

/*
* file server abort codes
*/
typedef enum {
enum AFS_FS_Operations {
FSFETCHSTATUS = 132, /* AFS Fetch file status */
FSFETCHDATA = 130, /* AFS Fetch file data */
FSGIVEUPCALLBACKS = 147, /* AFS Discard callback promises */
FSGETVOLUMEINFO = 148, /* AFS Get root volume information */
FSGETROOTVOLUME = 151, /* AFS Get root volume name */
FSLOOKUP = 161 /* AFS lookup file in directory */
};

enum AFS_FS_Errors {
VSALVAGE = 101, /* volume needs salvaging */
VNOVNODE = 102, /* no such file/dir (vnode) */
VNOVOL = 103, /* no such volume or volume unavailable */
Expand All @@ -29,8 +36,6 @@ typedef enum {
VOVERQUOTA = 109, /* volume's maximum quota exceeded */
VBUSY = 110, /* volume is temporarily unavailable */
VMOVED = 111, /* volume moved to new server - ask this FS where */
} afs_rxfs_abort_t;

extern int afs_abort_to_error(int);
};

#endif /* AFS_ERRORS_H */
#endif /* AFS_FS_H */
41 changes: 20 additions & 21 deletions fs/afs/vlclient.h → fs/afs/afs_vl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Volume Location Service client interface
/* AFS Volume Location Service client interface
*
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
* Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
Expand All @@ -9,10 +9,19 @@
* 2 of the License, or (at your option) any later version.
*/

#ifndef AFS_VLCLIENT_H
#define AFS_VLCLIENT_H
#ifndef AFS_VL_H
#define AFS_VL_H

#include "types.h"
#include "afs.h"

#define AFS_VL_PORT 7003 /* volume location service port */
#define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */

enum AFSVL_Operations {
VLGETENTRYBYID = 503, /* AFS Get Cache Entry By ID operation ID */
VLGETENTRYBYNAME = 504, /* AFS Get Cache Entry By Name operation ID */
VLPROBE = 514, /* AFS Probe Volume Location Service operation ID */
};

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

/* maps to "struct vldbentry" in vvl-spec.pdf */
/*
* maps to "struct vldbentry" in vvl-spec.pdf
*/
struct afs_vldbentry {
char name[65]; /* name of volume (including NUL char) */
char name[65]; /* name of volume (with NUL char) */
afs_voltype_t type; /* volume type */
unsigned num_servers; /* num servers that hold instances of this vol */
unsigned clone_id; /* cloning ID */
Expand All @@ -70,16 +81,4 @@ struct afs_vldbentry {
} servers[8];
};

extern int afs_rxvl_get_entry_by_name(struct afs_server *, const char *,
unsigned, struct afs_cache_vlocation *);
extern int afs_rxvl_get_entry_by_id(struct afs_server *, afs_volid_t,
afs_voltype_t,
struct afs_cache_vlocation *);

extern int afs_rxvl_get_entry_by_id_async(struct afs_async_op *,
afs_volid_t, afs_voltype_t);

extern int afs_rxvl_get_entry_by_id_async2(struct afs_async_op *,
struct afs_cache_vlocation *);

#endif /* AFS_VLCLIENT_H */
#endif /* AFS_VL_H */
Loading

0 comments on commit 08e0e7c

Please sign in to comment.