Skip to contentSkip to conversation

Update AFS client to reflect CacheFS split

PATCH New David Howells 1 participant 1 message Oct 6, 2004

Subsystems (2)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 4/4 Update AFS client to reflect CacheFS split

The attached patch updates the in-kernel AFS client to rename all the references from the old CacheFS ones to the new FS-Cache ones.

---

warthog>diffstat fscache-afs-269rc3mm2.diff

 Kconfig         |   10 +++++-----
 afs/cell.c      |   26 +++++++++++++-------------
 afs/cell.h      |    6 +++---
 afs/file.c      |   54 +++++++++++++++++++++++++++---------------------------
 afs/inode.c     |    8 ++++----
 afs/internal.h  |   14 +++++++-------
 afs/main.c      |   22 +++++++++++-----------
 afs/vlocation.c |   42 +++++++++++++++++++++---------------------
 afs/vnode.c     |   20 ++++++++++----------
 afs/vnode.h     |   10 +++++-----
 afs/volume.c    |   30 +++++++++++++++---------------
 afs/volume.h    |   18 +++++++++---------
 12 files changed, 130 insertions(+), 130 deletions(-)
fs/Kconfig +5 -5
diff -uNrp linux-2.6.9-rc3-mm2/fs/Kconfig linux-2.6.9-rc3-mm2-fscache/fs/Kconfig
@@ -1822,12 +1822,12 @@ config AFS_FS
 
 	  If unsure, say N.
 
-config AFS_CACHEFS
-	bool "Provide AFS client caching support through CacheFS"
-	depends on AFS_FS && CACHEFS && EXPERIMENTAL
+config AFS_FSCACHE
+	bool "Provide AFS client caching support"
+	depends on AFS_FS && FSCACHE && EXPERIMENTAL
 	help
-	  Say Y here if you want AFS data to be cached locally on disc through
-	  the CacheFS filesystem.
+	  Say Y here if you want AFS data to be cached locally on through the
+	  generic filesystem cache manager
 
 config RXRPC
 	tristate
fs/afs/cell.c +13 -13
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/cell.c linux-2.6.9-rc3-mm2-fscache/fs/afs/cell.c
@@ -31,16 +31,16 @@ static rwlock_t afs_cells_lock = RW_LOCK
 static DECLARE_RWSEM(afs_cells_sem); /* add/remove serialisation */
 static struct afs_cell *afs_cell_root;
 
-#ifdef CONFIG_AFS_CACHEFS
-static cachefs_match_val_t afs_cell_cache_match(void *target,
+#ifdef CONFIG_AFS_FSCACHE
+static fscache_match_val_t afs_cell_cache_match(void *target,
 						const void *entry);
 static void afs_cell_cache_update(void *source, void *entry);
 
-struct cachefs_index_def afs_cache_cell_index_def = {
+struct fscache_index_def afs_cache_cell_index_def = {
 	.name			= "cell_ix",
 	.data_size		= sizeof(struct afs_cache_cell),
 	.keys			= {
-		{ .type = CACHEFS_INDEX_KEYS_ASCIIZ, .len = 64 },
+		{ .type = FSCACHE_INDEX_KEYS_ASCIIZ, .len = 64 },
 	},
 	.match			= afs_cell_cache_match,
 	.update			= afs_cell_cache_update,
@@ -117,9 +117,9 @@ int afs_cell_create(const char *name, ch
 	if (ret < 0)
 		goto error;
 
-#ifdef CONFIG_AFS_CACHEFS
+#ifdef CONFIG_AFS_FSCACHE
 	/* put it up for caching (this never returns an error) */
-	cell->cache = cachefs_acquire_cookie(afs_cache_netfs.primary_index,
+	cell->cache = fscache_acquire_cookie(afs_cache_netfs.primary_index,
 					     &afs_vlocation_cache_index_def,
 					     cell);
 #endif
@@ -346,8 +346,8 @@ static void afs_cell_destroy(struct afs_
 	list_del_init(&cell->proc_link);
 	up_write(&afs_proc_cells_sem);
 
-#ifdef CONFIG_AFS_CACHEFS
-	cachefs_relinquish_cookie(cell->cache, 0);
+#ifdef CONFIG_AFS_FSCACHE
+	fscache_relinquish_cookie(cell->cache, 0);
 #endif
 
 	up_write(&afs_cells_sem);
@@ -529,8 +529,8 @@ void afs_cell_purge(void)
 /*
  * match a cell record obtained from the cache
  */
-#ifdef CONFIG_AFS_CACHEFS
-static cachefs_match_val_t afs_cell_cache_match(void *target,
+#ifdef CONFIG_AFS_FSCACHE
+static fscache_match_val_t afs_cell_cache_match(void *target,
 						const void *entry)
 {
 	const struct afs_cache_cell *ccell = entry;
@@ -540,11 +540,11 @@ static cachefs_match_val_t afs_cell_cach
 
 	if (strncmp(ccell->name, cell->name, sizeof(ccell->name)) == 0) {
 		_leave(" = SUCCESS");
-		return CACHEFS_MATCH_SUCCESS;
+		return FSCACHE_MATCH_SUCCESS;
 	}
 
 	_leave(" = FAILED");
-	return CACHEFS_MATCH_FAILED;
+	return FSCACHE_MATCH_FAILED;
 } /* end afs_cell_cache_match() */
 #endif
 
@@ -552,7 +552,7 @@ static cachefs_match_val_t afs_cell_cach
 /*
  * update a cell record in the cache
  */
-#ifdef CONFIG_AFS_CACHEFS
+#ifdef CONFIG_AFS_FSCACHE
 static void afs_cell_cache_update(void *source, void *entry)
 {
 	struct afs_cache_cell *ccell = entry;
fs/afs/cell.h +3 -3
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/cell.h linux-2.6.9-rc3-mm2-fscache/fs/afs/cell.h
@@ -13,7 +13,7 @@
 #define _LINUX_AFS_CELL_H
 
 #include "types.h"
-#include <linux/cachefs.h>
+#include <linux/fscache.h>
 
 #define AFS_CELL_MAX_ADDRS 15
 
@@ -39,8 +39,8 @@ struct afs_cell
 	struct list_head	link;		/* main cell list link */
 	struct list_head	proc_link;	/* /proc cell list link */
 	struct proc_dir_entry	*proc_dir;	/* /proc dir for this cell */
-#ifdef CONFIG_AFS_CACHEFS
-	struct cachefs_cookie	*cache;		/* caching cookie */
+#ifdef CONFIG_AFS_FSCACHE
+	struct fscache_cookie	*cache;		/* caching cookie */
 #endif
 
 	/* server record management */
fs/afs/file.c +27 -27

156 lines not on this page · raw message

fs/afs/inode.c +4 -4
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/inode.c linux-2.6.9-rc3-mm2-fscache/fs/afs/inode.c
@@ -179,10 +179,10 @@ inline int afs_iget(struct super_block *
 		return ret;
 	}
 
-#ifdef CONFIG_AFS_CACHEFS
+#ifdef CONFIG_AFS_FSCACHE
 	/* set up caching before reading the status, as fetch-status reads the
 	 * first page of symlinks to see if they're really mntpts */
-	vnode->cache = cachefs_acquire_cookie(vnode->volume->cache,
+	vnode->cache = fscache_acquire_cookie(vnode->volume->cache,
 					      NULL,
 					      vnode);
 #endif
@@ -277,8 +277,8 @@ void afs_clear_inode(struct inode *inode
 
 	afs_vnode_give_up_callback(vnode);
 
-#ifdef CONFIG_AFS_CACHEFS
-	cachefs_relinquish_cookie(vnode->cache, 0);
+#ifdef CONFIG_AFS_FSCACHE
+	fscache_relinquish_cookie(vnode->cache, 0);
 	vnode->cache = NULL;
 #endif
 
fs/afs/internal.h +7 -7
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/internal.h linux-2.6.9-rc3-mm2-fscache/fs/afs/internal.h
@@ -16,7 +16,7 @@
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/pagemap.h>
-#include <linux/cachefs.h>
+#include <linux/fscache.h>
 
 /*
  * debug tracing
@@ -57,8 +57,8 @@ static inline void afs_discard_my_signal
  */
 extern struct rw_semaphore afs_proc_cells_sem;
 extern struct list_head afs_proc_cells;
-#ifdef CONFIG_AFS_CACHEFS
-extern struct cachefs_index_def afs_cache_cell_index_def;
+#ifdef CONFIG_AFS_FSCACHE
+extern struct fscache_index_def afs_cache_cell_index_def;
 #endif
 
 /*
@@ -74,8 +74,8 @@ extern struct address_space_operations a
 extern struct inode_operations afs_file_inode_operations;
 extern struct file_operations afs_file_file_operations;
 
-#ifdef CONFIG_AFS_CACHEFS
-extern struct cachefs_page *afs_cache_get_page_cookie(struct page *page);
+#ifdef CONFIG_AFS_FSCACHE
+extern struct fscache_page *afs_cache_get_page_token(struct page *page);
 #endif
 
 /*
@@ -98,8 +98,8 @@ extern void afs_key_unregister(void);
 /*
  * main.c
  */
-#ifdef CONFIG_AFS_CACHEFS
-extern struct cachefs_netfs afs_cache_netfs;
+#ifdef CONFIG_AFS_FSCACHE
+extern struct fscache_netfs afs_cache_netfs;
 #endif
 
 /*
fs/afs/main.c +11 -11
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/main.c linux-2.6.9-rc3-mm2-fscache/fs/afs/main.c
@@ -14,7 +14,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/completion.h>
-#include <linux/cachefs.h>
+#include <linux/fscache.h>
 #include <rxrpc/rxrpc.h>
 #include <rxrpc/transport.h>
 #include <rxrpc/call.h>
@@ -60,12 +60,12 @@ static struct rxrpc_peer_ops afs_peer_op
 struct list_head afs_cb_hash_tbl[AFS_CB_HASH_COUNT];
 spinlock_t afs_cb_hash_lock = SPIN_LOCK_UNLOCKED;
 
-#ifdef CONFIG_AFS_CACHEFS
-static struct cachefs_netfs_operations afs_cache_ops = {
-	.get_page_cookie	= afs_cache_get_page_cookie,
+#ifdef CONFIG_AFS_FSCACHE
+static struct fscache_netfs_operations afs_cache_ops = {
+	.get_page_token		= afs_cache_get_page_token,
 };
 
-struct cachefs_netfs afs_cache_netfs = {
+struct fscache_netfs afs_cache_netfs = {
 	.name			= "afs",
 	.version		= 0,
 	.ops			= &afs_cache_ops,
@@ -92,9 +92,9 @@ static int afs_init(void)
 	if (ret < 0)
 		return ret;
 
-#ifdef CONFIG_AFS_CACHEFS
+#ifdef CONFIG_AFS_FSCACHE
 	/* we want to be able to cache */
-	ret = cachefs_register_netfs(&afs_cache_netfs,
+	ret = fscache_register_netfs(&afs_cache_netfs,
 				     &afs_cache_cell_index_def);
 	if (ret < 0)
 		goto error;
@@ -146,8 +146,8 @@ static int afs_init(void)
 	afs_key_unregister();
  error_cache:
 #endif
-#ifdef CONFIG_AFS_CACHEFS
-	cachefs_unregister_netfs(&afs_cache_netfs);
+#ifdef CONFIG_AFS_FSCACHE
+	fscache_unregister_netfs(&afs_cache_netfs);
  error:
 #endif
 	afs_cell_purge();
@@ -172,8 +172,8 @@ static void __exit afs_exit(void)
 #ifdef CONFIG_KEYS_TURNED_OFF
 	afs_key_unregister();
 #endif
-#ifdef CONFIG_AFS_CACHEFS
-	cachefs_unregister_netfs(&afs_cache_netfs);
+#ifdef CONFIG_AFS_FSCACHE
+	fscache_unregister_netfs(&afs_cache_netfs);
 #endif
 	afs_proc_cleanup();
 
fs/afs/vlocation.c +21 -21

121 lines not on this page · raw message

fs/afs/vnode.c +10 -10
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/vnode.c linux-2.6.9-rc3-mm2-fscache/fs/afs/vnode.c
@@ -29,16 +29,16 @@ struct afs_timer_ops afs_vnode_cb_timed_
 	.timed_out	= afs_vnode_cb_timed_out,
 };
 
-#ifdef CONFIG_AFS_CACHEFS
-static cachefs_match_val_t afs_vnode_cache_match(void *target,
+#ifdef CONFIG_AFS_FSCACHE
+static fscache_match_val_t afs_vnode_cache_match(void *target,
 						 const void *entry);
 static void afs_vnode_cache_update(void *source, void *entry);
 
-struct cachefs_index_def afs_vnode_cache_index_def = {
+struct fscache_index_def afs_vnode_cache_index_def = {
 	.name		= "vnode",
 	.data_size	= sizeof(struct afs_cache_vnode),
 	.keys		= {
-		{ .type = CACHEFS_INDEX_KEYS_BIN, .len = 4 },
+		{ .type = FSCACHE_INDEX_KEYS_BIN, .len = 4 },
 	},
 	.match		= afs_vnode_cache_match,
 	.update		= afs_vnode_cache_update,
@@ -346,8 +346,8 @@ int afs_vnode_give_up_callback(struct af
 /*
  * match a vnode record stored in the cache
  */
-#ifdef CONFIG_AFS_CACHEFS
-static cachefs_match_val_t afs_vnode_cache_match(void *target,
+#ifdef CONFIG_AFS_FSCACHE
+static fscache_match_val_t afs_vnode_cache_match(void *target,
 						 const void *entry)
 {
 	const struct afs_cache_vnode *cvnode = entry;
@@ -363,17 +363,17 @@ static cachefs_match_val_t afs_vnode_cac
 
 	if (vnode->fid.vnode != cvnode->vnode_id) {
 		_leave(" = FAILED");
-		return CACHEFS_MATCH_FAILED;
+		return FSCACHE_MATCH_FAILED;
 	}
 
 	if (vnode->fid.unique != cvnode->vnode_unique ||
 	    vnode->status.version != cvnode->data_version) {
 		_leave(" = DELETE");
-		return CACHEFS_MATCH_SUCCESS_DELETE;
+		return FSCACHE_MATCH_SUCCESS_DELETE;
 	}
 
 	_leave(" = SUCCESS");
-	return CACHEFS_MATCH_SUCCESS;
+	return FSCACHE_MATCH_SUCCESS;
 } /* end afs_vnode_cache_match() */
 #endif
 
@@ -381,7 +381,7 @@ static cachefs_match_val_t afs_vnode_cac
 /*
  * update a vnode record stored in the cache
  */
-#ifdef CONFIG_AFS_CACHEFS
+#ifdef CONFIG_AFS_FSCACHE
 static void afs_vnode_cache_update(void *source, void *entry)
 {
 	struct afs_cache_vnode *cvnode = entry;
fs/afs/vnode.h +5 -5
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/vnode.h linux-2.6.9-rc3-mm2-fscache/fs/afs/vnode.h
@@ -13,7 +13,7 @@
 #define _LINUX_AFS_VNODE_H
 
 #include <linux/fs.h>
-#include <linux/cachefs.h>
+#include <linux/fscache.h>
 #include "server.h"
 #include "kafstimod.h"
 
@@ -32,8 +32,8 @@ struct afs_cache_vnode
 	afs_dataversion_t	data_version;	/* data version */
 };
 
-#ifdef CONFIG_AFS_CACHEFS
-extern struct cachefs_index_def afs_vnode_cache_index_def;
+#ifdef CONFIG_AFS_FSCACHE
+extern struct fscache_index_def afs_vnode_cache_index_def;
 #endif
 
 /*****************************************************************************/
@@ -47,8 +47,8 @@ struct afs_vnode
 	struct afs_volume	*volume;	/* volume on which vnode resides */
 	struct afs_fid		fid;		/* the file identifier for this inode */
 	struct afs_file_status	status;		/* AFS status info for this file */
-#ifdef CONFIG_AFS_CACHEFS
-	struct cachefs_cookie	*cache;		/* caching cookie */
+#ifdef CONFIG_AFS_FSCACHE
+	struct fscache_cookie	*cache;		/* caching cookie */
 #endif
 
 	wait_queue_head_t	update_waitq;	/* status fetch waitqueue */
fs/afs/volume.c +15 -15
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/volume.c linux-2.6.9-rc3-mm2-fscache/fs/afs/volume.c
@@ -15,7 +15,7 @@
 #include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/pagemap.h>
-#include <linux/cachefs.h>
+#include <linux/fscache.h>
 #include "volume.h"
 #include "vnode.h"
 #include "cell.h"
@@ -26,17 +26,17 @@
 
 const char *afs_voltypes[] = { "R/W", "R/O", "BAK" };
 
-#ifdef CONFIG_AFS_CACHEFS
-static cachefs_match_val_t afs_volume_cache_match(void *target,
+#ifdef CONFIG_AFS_FSCACHE
+static fscache_match_val_t afs_volume_cache_match(void *target,
 						  const void *entry);
 static void afs_volume_cache_update(void *source, void *entry);
 
-struct cachefs_index_def afs_volume_cache_index_def = {
+struct fscache_index_def afs_volume_cache_index_def = {
 	.name		= "volume",
 	.data_size	= sizeof(struct afs_cache_vhash),
 	.keys	= {
-		{ .type = CACHEFS_INDEX_KEYS_BIN, .len = 1, },
-		{ .type = CACHEFS_INDEX_KEYS_BIN, .len = 1, },
+		{ .type = FSCACHE_INDEX_KEYS_BIN, .len = 1, },
+		{ .type = FSCACHE_INDEX_KEYS_BIN, .len = 1, },
 	},
 	.match		= afs_volume_cache_match,
 	.update		= afs_volume_cache_update,
@@ -214,8 +214,8 @@ int afs_volume_lookup(const char *name, 
 	}
 
 	/* attach the cache and volume location */
-#ifdef CONFIG_AFS_CACHEFS
-	volume->cache = cachefs_acquire_cookie(vlocation->cache,
+#ifdef CONFIG_AFS_FSCACHE
+	volume->cache = fscache_acquire_cookie(vlocation->cache,
 					       &afs_vnode_cache_index_def,
 					       volume);
 #endif
@@ -285,8 +285,8 @@ void afs_put_volume(struct afs_volume *v
 	up_write(&vlocation->cell->vl_sem);
 
 	/* finish cleaning up the volume */
-#ifdef CONFIG_AFS_CACHEFS
-	cachefs_relinquish_cookie(volume->cache, 0);
+#ifdef CONFIG_AFS_FSCACHE
+	fscache_relinquish_cookie(volume->cache, 0);
 #endif
 	afs_put_vlocation(vlocation);
 
@@ -482,8 +482,8 @@ int afs_volume_release_fileserver(struct
 /*
  * match a volume hash record stored in the cache
  */
-#ifdef CONFIG_AFS_CACHEFS
-static cachefs_match_val_t afs_volume_cache_match(void *target,
+#ifdef CONFIG_AFS_FSCACHE
+static fscache_match_val_t afs_volume_cache_match(void *target,
 						  const void *entry)
 {
 	const struct afs_cache_vhash *vhash = entry;
@@ -493,11 +493,11 @@ static cachefs_match_val_t afs_volume_ca
 
 	if (volume->type == vhash->vtype) {
 		_leave(" = SUCCESS");
-		return CACHEFS_MATCH_SUCCESS;
+		return FSCACHE_MATCH_SUCCESS;
 	}
 
 	_leave(" = FAILED");
-	return CACHEFS_MATCH_FAILED;
+	return FSCACHE_MATCH_FAILED;
 } /* end afs_volume_cache_match() */
 #endif
 
@@ -505,7 +505,7 @@ static cachefs_match_val_t afs_volume_ca
 /*
  * update a volume hash record stored in the cache
  */
-#ifdef CONFIG_AFS_CACHEFS
+#ifdef CONFIG_AFS_FSCACHE
 static void afs_volume_cache_update(void *source, void *entry)
 {
 	struct afs_cache_vhash *vhash = entry;
fs/afs/volume.h +9 -9
diff -uNrp linux-2.6.9-rc3-mm2/fs/afs/volume.h linux-2.6.9-rc3-mm2-fscache/fs/afs/volume.h
@@ -12,7 +12,7 @@
 #ifndef _LINUX_AFS_VOLUME_H
 #define _LINUX_AFS_VOLUME_H
 
-#include <linux/cachefs.h>
+#include <linux/fscache.h>
 #include "types.h"
 #include "fsclient.h"
 #include "kafstimod.h"
@@ -47,8 +47,8 @@ struct afs_cache_vlocation
 	time_t			rtime;		/* last retrieval time */
 };
 
-#ifdef CONFIG_AFS_CACHEFS
-extern struct cachefs_index_def afs_vlocation_cache_index_def;
+#ifdef CONFIG_AFS_FSCACHE
+extern struct fscache_index_def afs_vlocation_cache_index_def;
 #endif
 
 /*****************************************************************************/
@@ -61,8 +61,8 @@ struct afs_cache_vhash
 	uint8_t			hash_bucket;	/* which hash bucket this represents */
 } __attribute__((packed));
 
-#ifdef CONFIG_AFS_CACHEFS
-extern struct cachefs_index_def afs_volume_cache_index_def;
+#ifdef CONFIG_AFS_FSCACHE
+extern struct fscache_index_def afs_volume_cache_index_def;
 #endif
 
 /*****************************************************************************/
@@ -75,8 +75,8 @@ struct afs_vlocation
 	struct list_head	link;		/* link in cell volume location list */
 	struct afs_timer	timeout;	/* decaching timer */
 	struct afs_cell		*cell;		/* cell to which volume belongs */
-#ifdef CONFIG_AFS_CACHEFS
-	struct cachefs_cookie	*cache;		/* caching cookie */
+#ifdef CONFIG_AFS_FSCACHE
+	struct fscache_cookie	*cache;		/* caching cookie */
 #endif
 	struct afs_cache_vlocation vldb;	/* volume information DB record */
 	struct afs_volume	*vols[3];	/* volume access record pointer (index by type) */
@@ -111,8 +111,8 @@ struct afs_volume
 	atomic_t		usage;
 	struct afs_cell		*cell;		/* cell to which belongs (unrefd ptr) */
 	struct afs_vlocation	*vlocation;	/* volume location */
-#ifdef CONFIG_AFS_CACHEFS
-	struct cachefs_cookie	*cache;		/* caching cookie */
+#ifdef CONFIG_AFS_FSCACHE
+	struct fscache_cookie	*cache;		/* caching cookie */
 #endif
 	afs_volid_t		vid;		/* volume ID */
 	afs_voltype_t __packed	type;		/* type of volume */