|
From: Marko O. <d0...@us...> - 2009-10-18 20:38:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "kdfs".
The branch, make_kdfs_compile has been updated
via 8f6cb18b661235e591b33504349f031d2021e59a (commit)
from 5bd840461f5e33cf9ee0a83751daae473b1407c6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8f6cb18b661235e591b33504349f031d2021e59a
Author: Marko Obrovac <mar...@in...>
Date: Sun Oct 18 22:23:21 2009 +0200
[FIX] ProcFS:
the proc_root_fs variable is not available any more (and
non-existent, for that matter). Instead, file systems should
register themselves with the "fs/FS_NAME" name syntax, leaving
the parent proc_dir as NULL.
Also, the write_proc function should return an int, not a ssize_t.
The "owner" field is no longer available as part of the proc_dir_entry
structure. Following other file systems' example, it was simple
removed from the code (apparently, there's another way of keeping
track of processes using a proc entry)
[FIX] Fixed a printk - when printing long ints, %ld should be used
[FIX] super_operations
the signature of umount changed - now there's only one argument - the
super_block which should be unmounted.
There are still other issues concerning the super_operations structure
that need to be solved - see ticket #7
[FIX] simple_set_mnt does not return an error code any more. However,
looking at other file systems, they seem just to use it "as-is", so
probably we should remove the code below it (which used to handle
error cases)
diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c
index 8711213..2de6c0d 100644
--- a/fs/kdfs/super.c
+++ b/fs/kdfs/super.c
@@ -17,7 +17,7 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
-#include <ctnr/kddm.h>
+#include <kddm/kddm.h>
#include "physical_fs.h"
#include "super.h"
@@ -80,7 +80,7 @@ kdfs_node_t k_rootsb_nodeid = KERRIGHED_NODE_ID_NONE;
struct proc_dir_entry *proc_fs_kdfs = NULL;
/* Increase the kdfs_gen counter. Used by checkpoint code */
-ssize_t kdfs_proc_inc_gen(struct file *filp, const char __user *buf,
+int kdfs_proc_inc_gen(struct file *filp, const char __user *buf,
unsigned long len, void *data)
{
extern unsigned int kdfs_gen;
@@ -89,7 +89,7 @@ ssize_t kdfs_proc_inc_gen(struct file *filp, const char __user *buf,
}
/* Lists the inodes of the local kDFS superblock */
-ssize_t kdfs_proc_inodes_write(struct file *filp, const char __user *buf,
+int kdfs_proc_inodes_write(struct file *filp, const char __user *buf,
unsigned long len, void *data)
{
struct inode *inode;
@@ -112,7 +112,7 @@ ssize_t kdfs_proc_inodes_write(struct file *filp, const char __user *buf,
printk(" Inode %ld, count %d, mode %u, size %lld\n", inode->i_ino, atomic_read(&inode->i_count), inode->i_mode, inode->i_size);
printk("Dumping s_files list\n");
list_for_each_entry(file, &k_sb->sb->s_files, f_u.fu_list)
- printk(" File with count %d", atomic_read(&file->f_count));
+ printk(" File with count %ld", atomic_read(&file->f_count));
}
else
printk("There is no kDFS superblock file on the current node\n");
@@ -1165,7 +1165,7 @@ void kdfs_delete_inode(struct inode *inode)
PRINT_FUNCTION_EXIT;
}
-void kdfs_umount(struct vfsmount *vfsmnt, int flags)
+void kdfs_umount(/*struct vfsmount *vfsmnt, int flags*/struct super_block *sb)
{
struct kdfs_super_block *k_sb = NULL;
struct kdfs_cw_sb *k_cwsb = NULL;
@@ -1175,6 +1175,12 @@ void kdfs_umount(struct vfsmount *vfsmnt, int flags)
k_sb = kdfs_grabsb(kerrighed_node_id);
BUG_ON(k_sb == NULL);
+
+ if (k_sb->sb != sb) {
+ DEBUG(DBG_INFO, "The super block to umount is not a kdfs one!\n");
+ return;
+ }
+
BUG_ON(k_sb->inode_bitmap == NULL);
sb_bitmap_save(k_sb);
@@ -1387,8 +1393,14 @@ int kdfs_get_sb(struct file_system_type *fs_type, int flags,
}
//TODO PRIORITY 3: Check where this come from (ext2fs super block?) and see why we would (not?) need it
//kdfs_sb->sb->s_flags |= MS_ACTIVE;
- error = simple_set_mnt(mnt, k_sb->sb);
+ simple_set_mnt(mnt, k_sb->sb);
+ /*
+ * TODO: simple_set_mnt returns void now! Thus, this code
+ * will never be executed so it becomes useless!!!
+ * Check whether there are other places where this
+ * should be checked, i.e. become usefull
+ */
if (error < 0) {
DEBUG(DBG_ALERT, "Can't retrieve KDFS super bloc\n");
// TODO PRIORITY 1: Put some goto to manage all errors
@@ -1549,22 +1561,18 @@ int init_kdfs()
*/
/* Create /proc/fs/kdfs directory */
- proc_fs_kdfs = proc_mkdir("kdfs", proc_root_fs);
+ proc_fs_kdfs = proc_mkdir("fs/kdfs", NULL);
if (proc_fs_kdfs == NULL)
return -ENOMEM;
- /* owner is used to avoid unloading the module while the entry is in use */
- proc_fs_kdfs->owner = THIS_MODULE;
p = create_proc_entry("inodes", S_IFREG|S_IRUGO, proc_fs_kdfs);
if (p == NULL)
return -ENOMEM;
- p->owner = THIS_MODULE;
p->write_proc = kdfs_proc_inodes_write;
p = create_proc_entry("gen", S_IFREG|S_IRUGO, proc_fs_kdfs);
if (p == NULL)
return -ENOMEM;
- p->owner = THIS_MODULE;
p->write_proc = kdfs_proc_inc_gen;
#endif
@@ -1596,7 +1604,7 @@ void cleanup_kdfs(void)
#ifdef __KDFS_PROCDIR_
remove_proc_entry("gen", proc_fs_kdfs);
remove_proc_entry("inodes", proc_fs_kdfs);
- remove_proc_entry("kdfs", proc_root_fs);
+ remove_proc_entry("fs/kdfs", NULL);
#endif
unregister_filesystem(&kdfs_fs_type);
-----------------------------------------------------------------------
Summary of changes:
fs/kdfs/super.c | 32 ++++++++++++++++++++------------
1 files changed, 20 insertions(+), 12 deletions(-)
hooks/post-receive
--
kdfs
|