Skip to content

Commit

Permalink
[AFS]: Clean up the AFS sources
Browse files Browse the repository at this point in the history
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
dhowells authored and davem330 committed Apr 26, 2007
1 parent 17926a7 commit ec26815
Show file tree
Hide file tree
Showing 36 changed files with 506 additions and 906 deletions.
2 changes: 0 additions & 2 deletions fs/afs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Makefile for Red Hat Linux AFS client.
#

#CFLAGS += -finstrument-functions

kafs-objs := \
callback.o \
cell.o \
Expand Down
12 changes: 4 additions & 8 deletions fs/afs/cache.h
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])
Expand All @@ -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

Expand All @@ -20,8 +20,4 @@
#endif
#include "types.h"

#ifdef __KERNEL__

#endif /* __KERNEL__ */

#endif /* _LINUX_AFS_CACHE_H */
#endif /* AFS_CACHE_H */
9 changes: 3 additions & 6 deletions fs/afs/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "internal.h"
#include "cmservice.h"

/*****************************************************************************/
/*
* allow the fileserver to request callback state (re-)initialisation
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -156,14 +154,13 @@ 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
*/
int SRXAFSCM_Probe(struct afs_server *server)
{
_debug("SRXAFSCM_Probe(%p)\n", server);
return 0;
} /* end SRXAFSCM_Probe() */
}
51 changes: 18 additions & 33 deletions fs/afs/cell.c
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])
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -199,10 +197,8 @@ int afs_cell_init(char *rootcell)

_leave(" = %d", ret);
return ret;
}

} /* end afs_cell_init() */

/*****************************************************************************/
/*
* lookup a cell record
*/
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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
*/
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -520,9 +507,8 @@ void afs_cell_purge(void)
}

_leave("");
} /* end afs_cell_purge() */
}

/*****************************************************************************/
/*
* match a cell record obtained from the cache
*/
Expand All @@ -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
*/
Expand All @@ -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
30 changes: 11 additions & 19 deletions fs/afs/cell.h
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])
Expand All @@ -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"
Expand All @@ -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 */
Expand All @@ -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

0 comments on commit ec26815

Please sign in to comment.