Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec26815a authored by David Howells's avatar David Howells Committed by David S. Miller
Browse files

[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: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 17926a79
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2,8 +2,6 @@
# Makefile for Red Hat Linux AFS client.
#

#CFLAGS += -finstrument-functions

kafs-objs := \
	callback.o \
	cell.o \
+4 −8
Original line number Diff line number Diff line
/* 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 (dhowells@redhat.com)
@@ -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 */
+3 −6
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
#include "internal.h"
#include "cmservice.h"

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

	_leave(" = 0");
	return 0;
} /* end SRXAFSCM_InitCallBackState() */
}

/*****************************************************************************/
/*
 * allow the fileserver to break callback promises
 */
@@ -156,9 +154,8 @@ int SRXAFSCM_CallBack(struct afs_server *server, size_t count,

	_leave(" = 0");
	return 0;
} /* end SRXAFSCM_CallBack() */
}

/*****************************************************************************/
/*
 * allow the fileserver to see if the cache manager is still alive
 */
@@ -166,4 +163,4 @@ int SRXAFSCM_Probe(struct afs_server *server)
{
	_debug("SRXAFSCM_Probe(%p)\n", server);
	return 0;
} /* end SRXAFSCM_Probe() */
}
+18 −33
Original line number Diff line number Diff line
/* 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 (dhowells@redhat.com)
@@ -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
@@ -144,9 +143,8 @@ int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell)
	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
 */
@@ -429,10 +418,8 @@ int afs_server_find_by_peer(const struct rxrpc_peer *peer,
	*_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
+11 −19
Original line number Diff line number Diff line
/* cell.h: AFS cell record
/* AFS cell record
 *
 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
@@ -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 */
Loading