afs/fs/cachefs status.c,1.5,1.6
dwh at infradead.org
dwh at infradead.org
Mon Jun 9 15:38:24 BST 2003
- Previous message: afs/fs/afs volume.h,1.3,1.4 volume.c,1.5,1.6 vnode.h,1.3,1.4
vnode.c,1.3,1.4 vlocation.c,1.6,1.7 vlclient.h,1.3,1.4
vlclient.c,1.5,1.6 types.h,1.4,1.5 main.c,1.10,1.11
internal.h,1.13,1.14 inode.c,1.8,1.9 file.c,1.4,1.5 cell.h,1.3,1.4
cell.c,1.6,1.7 cache.h,1.12,1.13
- Next message: afs/include/linux cachefs.h,1.12,1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/afs/fs/cachefs
In directory phoenix.infradead.org:/tmp/cvs-serv8649/fs/cachefs
Modified Files:
status.c
Log Message:
make write to /cachefs/status cause a dump of extant cache_block structs
Index: status.c
===================================================================
RCS file: /home/cvs/afs/fs/cachefs/status.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- status.c 2 Apr 2003 09:12:31 -0000 1.5
+++ status.c 9 Jun 2003 13:38:21 -0000 1.6
@@ -21,6 +21,7 @@
#include "cachefs-int.h"
static int cachefs_status_open(struct inode *inode, struct file *file);
+static ssize_t cachefs_status_write(struct file *, const char __user *, size_t, loff_t *);
static void *cachefs_status_start(struct seq_file *p, loff_t *pos);
static void *cachefs_status_next(struct seq_file *p, void *v, loff_t *pos);
static void cachefs_status_stop(struct seq_file *p, void *v);
@@ -39,6 +40,7 @@
struct file_operations cachefs_status_file_operations = {
.open = cachefs_status_open,
.read = seq_read,
+ .write = cachefs_status_write,
.llseek = seq_lseek,
.release = seq_release,
};
@@ -156,3 +158,52 @@
return 0;
} /* end cachefs_status_show() */
+
+/*****************************************************************************/
+/*
+ *
+ */
+static ssize_t cachefs_status_write(struct file *file, const char __user *data, size_t size,
+ loff_t *pos)
+{
+ struct cachefs_super *super;
+ struct cachefs_block *block, *xblock;
+ struct rb_node *_rb;
+ unsigned long flags;
+ struct inode *inode;
+
+ inode = file->f_dentry->d_inode;
+ super = inode->i_sb->s_fs_info;
+
+ xblock = NULL;
+ read_lock_irqsave(&super->blk_tree_lock,flags);
+
+ _rb = rb_first(&super->blk_tree);
+ while (_rb) {
+ block = rb_entry(_rb,struct cachefs_block,lookup_node);
+
+ if (block->page) {
+ cachefs_block_get(block);
+
+ read_unlock_irqrestore(&super->blk_tree_lock,flags);
+ cachefs_block_put(xblock);
+
+ printk("- block %05d u=%d fl=%08lx pg=%p wb=%p r=%p\n",
+ block->bix,
+ atomic_read(&block->usage) - 1,
+ block->flags,
+ block->page,
+ block->writeback,
+ block->ref);
+
+ read_lock_irqsave(&super->blk_tree_lock,flags);
+ xblock = block;
+ }
+ _rb = rb_next(_rb);
+ }
+
+ read_unlock_irqrestore(&super->blk_tree_lock,flags);
+ cachefs_block_put(xblock);
+
+ return size;
+} /* end cachefs_status_write() */
- Previous message: afs/fs/afs volume.h,1.3,1.4 volume.c,1.5,1.6 vnode.h,1.3,1.4
vnode.c,1.3,1.4 vlocation.c,1.6,1.7 vlclient.h,1.3,1.4
vlclient.c,1.5,1.6 types.h,1.4,1.5 main.c,1.10,1.11
internal.h,1.13,1.14 inode.c,1.8,1.9 file.c,1.4,1.5 cell.h,1.3,1.4
cell.c,1.6,1.7 cache.h,1.12,1.13
- Next message: afs/include/linux cachefs.h,1.12,1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-afs-cvs
mailing list