|
From: alebre <al...@us...> - 2011-01-03 16:28:47
|
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 a9396af95b248bccbcdc80c9ddb15de60478432d (commit)
from 98833b0b5cbed6daebe10dc95fec43b7e02216e1 (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 a9396af95b248bccbcdc80c9ddb15de60478432d
Author: ad <leb...@fr...>
Date: Mon Jan 3 17:28:01 2011 +0000
Fix kdfs_fill_inode - NTFS 3G Posix test suite succeeds now - Adrien
diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h
index 35c92e4..7e23001 100644
--- a/fs/kdfs/debug_kdfs.h
+++ b/fs/kdfs/debug_kdfs.h
@@ -46,7 +46,7 @@
# define DEBUG(level, format, ...) \
do { \
if (KDFS_DEBUG_LEVEL >= level) { \
- pr_debug("%s @ %d | " format " | pid: %d, %s, %d", __func__, __LINE__, ##__VA_ARGS__, current->pid, current->comm, task_pid_knr(current)) ; \
+ pr_debug("pid %d, %s, %d | %s @ %d | " format "", current->pid, current->comm, task_pid_knr(current), __func__, __LINE__, ##__VA_ARGS__); \
} \
if(level == DBG_PANIC)\
BUG();\
diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c
index c89111e..1848729 100644
--- a/fs/kdfs/inode.c
+++ b/fs/kdfs/inode.c
@@ -1103,20 +1103,23 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry,
*/
// Case 1: it's a new file, so a new inode
if (flags & KDDM_CREATE_ON_FT) {
+ k_inode->inode = new_inode(k_sb->sb);
// new_inode allocates a new inode and adds it into the list of
// used inodes for the related superblock
// Adding the inode into the local inode cache is done later into the kddm_iol_insert function
- k_inode->inode = new_inode (k_sb->sb);
- k_inode->flags = K_INODE_CREATING|K_INODE_INITIALIZING;
+
if (k_inode->inode == NULL)
- DEBUG(DBG_PANIC, "Cannot find inode %lu\n", objid);
- k_inode->inode->i_ino = objid;
+ DEBUG(DBG_PANIC, "Cannot allocate a new inode %lu\n", objid);
+ else{
+ k_inode->inode->i_ino = objid;
+ k_inode->flags = K_INODE_NEW;
+ }
}
// Case 2: the inode already exists, so fill it from the HDD
else {
if (kdfs_fill_kinode(k_sb->sb, objid, k_inode) < 0)
DEBUG(DBG_PANIC, "Cannot retrieve the physical informations to fill the k_inode");
- k_inode->flags = K_INODE_OK;
+ k_inode->flags = K_INODE_OK;
}
k_inode->content_setid = KDDM_SET_UNUSED;
@@ -1149,7 +1152,7 @@ int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry,
* k_inode->inode->i_mode has not been yet assigned. So we cannot assign the
* right references for the operations
*/
- if (!(k_inode->flags & K_INODE_CREATING)) {
+ if (!(k_inode->flags & K_INODE_NEW)) {
/* According to the mode, set the right operations */
switch (k_inode->inode->i_mode & S_IFMT) {
case S_IFREG:
diff --git a/fs/kdfs/inode.h b/fs/kdfs/inode.h
index e5d6371..8fc4fdc 100644
--- a/fs/kdfs/inode.h
+++ b/fs/kdfs/inode.h
@@ -30,8 +30,8 @@
/* k_inode flags */
#define K_INODE_OK 0
#define K_INODE_NOTUSABLE 1
-#define K_INODE_INITIALIZING 2
-#define K_INODE_CREATING 4
+#define K_INODE_INITIALIZING 2 /* Inode has been allocated by kdfs_iol_inode_alloc */
+#define K_INODE_NEW 4 /* Inode has been allocated by kdfs_iol_first_touch and i_mode is still not filled */
#define K_INODE_DIRTY 8
#define K_INODE_TODELETE 16
diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c
index c3e877f..028be2d 100644
--- a/fs/kdfs/super.c
+++ b/fs/kdfs/super.c
@@ -978,18 +978,13 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod
* For the moment, the workaround consists in using sb->s_fs_info to
* reach it. It is probably not the best and cleanest solution.
*/
- k_inode->inode = iget_locked(sb, ino);
+
+ k_inode->inode = new_inode(sb);
if (!k_inode->inode){
DEBUG(DBG_ALERT, "End of Memory, cannot allocate a new inode");
return -ENOMEM;
}
- /*
- * Check if the inode is locally in the cache
- * Should not occur (theoretically :/)
- */
- if (!(k_inode->inode->i_state & I_NEW)){
- DEBUG(DBG_ALERT, "Inode already in the cache, strange....");
- }
+ k_inode->inode->i_ino = ino;
/* Retrieve the inode meta file */
phys_filename = kmalloc(PATH_MAX, GFP_KERNEL);
@@ -1053,7 +1048,6 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod
k_inode->inode->i_ino, ((struct kdfs_super_block*)k_inode->inode->i_sb->s_fs_info)->k_opt->part_name);
kfree(phys_filename);
- unlock_new_inode(k_inode->inode);
PRINT_FUNCTION_EXIT;
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
fs/kdfs/debug_kdfs.h | 2 +-
fs/kdfs/inode.c | 15 +++++++++------
fs/kdfs/inode.h | 4 ++--
fs/kdfs/super.c | 12 +++---------
4 files changed, 15 insertions(+), 18 deletions(-)
hooks/post-receive
--
kdfs
|