From: alebre <al...@us...> - 2010-07-19 14:46:06
|
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 c97311254a567ed0ead630ce8f2e681c81c70478 (commit) from 0a5fafb4d704c3289c4098cd1f0630a73ad763bf (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 c97311254a567ed0ead630ce8f2e681c81c70478 Author: ad <leb...@fr...> Date: Mon Jul 19 15:35:19 2010 +0000 Fix dir entry management issue and minor bugs on inode management diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 99331b6..a8997fa 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -629,8 +629,8 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, page_addr = (char *) kmap(k_page->page); pos = (loff_t)pageid * PAGE_SIZE; - DEBUG(DBG_TRACE, "Can't find page for file/directory = %ld and " \ - "page id = %ld, So created and locked (kmap page address %p, page address %p)\n", iolinker_data->ino, + DEBUG(DBG_TRACE, "The page for file/directory = %ld and " \ + "page id = %ld is not in the cache. So created/locked and read from HDD (kmap page address %p, page address %p)\n", iolinker_data->ino, pageid,page_addr, k_page->page); /* The page should be filled only if it was not handled diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index 5a0f3b4..31a9497 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -444,7 +444,7 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, kdfs_mark_inode_dirty(kdfs_pdir); /* Propagate change to the device on the right node */ - kdfs_mark_page_dirty(kdfs_pdir->content_setid, pageid); + kdfs_mark_page_dirty(kdfs_pdir->content_setid, kdfs_page->obj_id); _kdfs_put_page(kdfs_page); diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index d6536d5..5a06f64 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1128,9 +1128,9 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, struct kdfs_super_block *k_sb = kdfs_twice_grabsb(kerrighed_node_id); ASSERT(k_sb != NULL); - DEBUG(DBG_INFO, - "First touch inode (%ld;%ld)\n", - kddm_set->id, objid); + DEBUG(DBG_TRACE, + "function ENTER: First touch inode (%ld;%ld) (creation = %d)\n", + kddm_set->id, objid, (flags & KDDM_CREATE_ON_FT)); k_inode = kmalloc(sizeof(struct kdfs_inode), GFP_KERNEL); ASSERT(k_inode != NULL); @@ -1151,11 +1151,12 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, insert_inode_hash(k_inode->inode); } // 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"); + 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; objEntry->object = (void *) k_inode; DEBUG(DBG_INFO, "inode count %d\n", atomic_read(&k_inode->inode->i_count)); diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index d91e522..6fa8b65 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -932,7 +932,6 @@ int kdfs_statfs(struct dentry *dfs, struct kstatfs *buf) */ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inode *k_inode) { - struct inode *inode = NULL; struct file *file = NULL; char *phys_filename = NULL; struct kdfs_physical_inode phys_inode; @@ -948,8 +947,8 @@ 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. */ - inode = iget_locked(sb, ino); - if (!inode){ + k_inode->inode = iget_locked(sb, ino); + if (!k_inode->inode){ DEBUG(DBG_ALERT, "End of Memory, cannot allocate a new inode"); return -ENOMEM; } @@ -957,15 +956,14 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod * Check if the inode is locally in the cache * Should not occur (theoretically :/) */ - if (!(inode->i_state & I_NEW)){ + if (!(k_inode->inode->i_state & I_NEW)){ DEBUG(DBG_ALERT, "Inode already in the cache, strange...."); - k_inode->inode=inode; } /* Retrieve the inode meta file */ phys_filename = kmalloc(PATH_MAX, GFP_KERNEL); ASSERT(phys_filename != NULL); - kdfs_getphysicalpath(inode->i_sb->s_fs_info, inode->i_ino, + kdfs_getphysicalpath(k_inode->inode->i_sb->s_fs_info, k_inode->inode->i_ino, phys_filename); strcat(phys_filename, "/" KDFS_INODE_FILENAME); @@ -974,15 +972,15 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod kdfs_phys_read(file, (char *)&(phys_inode), sizeof(struct kdfs_physical_inode), &file->f_pos); - inode->i_size = phys_inode.size; - inode->i_mode = phys_inode.mode; - inode->i_nlink = phys_inode.nlink; - inode->i_version = phys_inode.version; - inode->i_uid = phys_inode.uid; - inode->i_gid = phys_inode.gid; - timespec_cpy(&inode->i_atime, &phys_inode.atime); - timespec_cpy(&inode->i_mtime, &phys_inode.mtime); - timespec_cpy(&inode->i_ctime, &phys_inode.ctime); + k_inode->inode->i_size = phys_inode.size; + k_inode->inode->i_mode = phys_inode.mode; + k_inode->inode->i_nlink = phys_inode.nlink; + k_inode->inode->i_version = phys_inode.version; + k_inode->inode->i_uid = phys_inode.uid; + k_inode->inode->i_gid = phys_inode.gid; + timespec_cpy(&k_inode->inode->i_atime, &phys_inode.atime); + timespec_cpy(&k_inode->inode->i_mtime, &phys_inode.mtime); + timespec_cpy(&k_inode->inode->i_ctime, &phys_inode.ctime); /* * Note: from VFS documentation, read_inode is in charge of @@ -991,9 +989,7 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod * kdfs_iol_inode_insert() due to the clusterwide constraints * (cf. inode.c) */ - - k_inode-> inode = inode ; - + /* * Read the extent part * copy/paste from kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) @@ -1023,10 +1019,10 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod DEBUG(DBG_ALERT, "Can't access to the KDFS inode %ld\n" "Please verify type of the partition %s, it should be a KDFS one", - inode->i_ino, ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name); + 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(inode); + unlock_new_inode(k_inode->inode); PRINT_FUNCTION_EXIT; return 0; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 4 ++-- fs/kdfs/dir.c | 2 +- fs/kdfs/inode.c | 13 +++++++------ fs/kdfs/super.c | 36 ++++++++++++++++-------------------- 4 files changed, 26 insertions(+), 29 deletions(-) hooks/post-receive -- kdfs |