From: Marko O. <d0...@us...> - 2010-03-22 13:08:22
|
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 bd020c813b463aeb6c30eb078ab75bed96007ac7 (commit) from c1d32fe132c4e3398b8dc11cbaa88e9ed63ae824 (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 bd020c813b463aeb6c30eb078ab75bed96007ac7 Author: Marko Obrovac <mar...@in...> Date: Mon Mar 22 15:02:32 2010 +0100 Work on striping extents management continued ... [MINOR] The system is now able to store the extents list in the .meta file of the appropriate inode. Read support comming soon. [MINOR] Consolidate some commonly used defines and types into a new header file (common.h). This file is included in all other header files to facilitate the manipulation of types and objects. diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index 46f6679..aab2433 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -15,6 +15,9 @@ #ifndef __KDFS_ADDR_SPACE__ #define __KDFS_ADDR_SPACE__ + +#include "common.h" + /*--------------------------------------------------------------------------* * * * MACROS * diff --git a/fs/kdfs/common.h b/fs/kdfs/common.h new file mode 100644 index 0000000..cba32d0 --- /dev/null +++ b/fs/kdfs/common.h @@ -0,0 +1,116 @@ +/* + * KDDM File System - common types and includes + * + * @file file_extent.h + * + * @author Marko Obrovac (2010-xxxx) + * + * Copyright (C) 2006-2007, XtreemOS Consortium. + * Copyright (C) 2008-20xx, XtreemOS Consortium, Ascola Research Group. + */ + +#ifndef __KDFS_COMMON__ +#define __KDFS_COMMON__ + + +#include <linux/list.h> +#include <linux/pagemap.h> + +#include <kddm/kddm.h> + + +/* Max number of extent records that fit in a kddm object */ +/* if you change the kdfs_netinode or kdfs_file_extent_info + structures, please update this constant! + 124 = size of kdfs_netinode (without the extents array) + 24 = size of kdfs_file_extent_info */ +#define FILE_EXT_MAX_MEMBERS ((PAGE_SIZE - 124)/24) + + +typedef short kdfs_node_t; /* kerrighed_node_t*/ + +/* FILE STRIPING TYPES */ +/* the actual strip extent info */ +struct kdfs_file_extent_info { + pgoff_t page_first; /* the first page no owned by a node */ + pgoff_t page_last; /* the last page no owned by a node */ + kdfs_node_t extent_owner; /* the node holding the pages contents */ +}; + +/* the extent list item */ +struct kdfs_file_extent { + struct kdfs_file_extent_info data; /* the extent data */ + struct list_head list_item; /* the list member linking it to the list */ +}; + +struct kdfs_inode { + struct inode* inode; /* Local copy of the inode */ + + kddm_set_id_t content_setid; /* Clusterwide Reference to the File or Dir container associated */ + + /* k_inode flags*/ + char flags; + + /* Cluster-wide count */ + atomic_t cw_count; + + /* Striping extents list */ + /* TODO take care of netinode too!!! */ + struct list_head extents_list; +}; + +/* + * Network representation of kdfs_inode + * exploited during import and export functions + */ +struct kdfs_netinode { + /* inode informations */ + unsigned long i_ino; + loff_t i_size; + umode_t i_mode; + unsigned int i_nlink; + uid_t i_uid; + gid_t i_gid; + struct timespec i_atime; + struct timespec i_mtime; + struct timespec i_ctime; + unsigned long i_version; + unsigned long i_state; + + /* Cluster-wide count */ + atomic_t cw_count; + + /* miscellaneous informations*/ + kddm_set_id_t content_setid; + + /* k_inode flags*/ + char flags; + + /* File extents portion */ + size_t no_extents; + struct kdfs_file_extent_info extents[FILE_EXT_MAX_MEMBERS]; +}; + +/* + * A physical representation of kDFS inode is required. + * This representation is stored on the .meta file. + * First, to protect kDFS consistency (direct manipulations on the native FS + * inodes will not impact on the kDFS structure). + * Second, since we exploit a '...' file for storing meta-informations + * (directory entries, object localisation, ...). We simply cannont exploit nlink native value. + * Directly using native inodes make inode management harder and uglier :p + */ +struct kdfs_physical_inode { + loff_t size; + umode_t mode; + unsigned int nlink; + unsigned long version; + uid_t uid; + gid_t gid; + struct timespec atime; + struct timespec mtime; + struct timespec ctime; +}; + + +#endif diff --git a/fs/kdfs/dir.h b/fs/kdfs/dir.h index 7c0eae5..49493ee 100644 --- a/fs/kdfs/dir.h +++ b/fs/kdfs/dir.h @@ -14,6 +14,10 @@ #ifndef __KDFS_DIRECTORY__ #define __KDFS_DIRECTORY__ + +#include "common.h" + + /*--------------------------------------------------------------------------* * * * MACROS * diff --git a/fs/kdfs/extent.h b/fs/kdfs/extent.h index 8c4aea7..bd51150 100644 --- a/fs/kdfs/extent.h +++ b/fs/kdfs/extent.h @@ -11,6 +11,10 @@ #ifndef __KDFS_EXTENT__ #define __KDFS_EXTENT__ + +#include "common.h" + + struct kdfs_zone { /* Where is this zone in the logical file */ loff_t l_start; diff --git a/fs/kdfs/file.h b/fs/kdfs/file.h index 9826fa6..c64222b 100644 --- a/fs/kdfs/file.h +++ b/fs/kdfs/file.h @@ -14,6 +14,11 @@ #ifndef __KDFS_FILE__ #define __KDFS_FILE__ + + +#include "common.h" + + /*--------------------------------------------------------------------------* * * * EXTERN VARIABLES * diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index 13360c5..e786cb4 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -227,7 +227,6 @@ size_t kdfs_file_extent_dump_to_file(struct kdfs_inode *k_inode, struct file *fi size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode, struct file *file) { - /* TODO Implement*/ return 0; } diff --git a/fs/kdfs/file_extent.h b/fs/kdfs/file_extent.h index 1b3a7bd..1832994 100644 --- a/fs/kdfs/file_extent.h +++ b/fs/kdfs/file_extent.h @@ -13,12 +13,7 @@ #define __KDFS_FILE_EXTENT__ -#include <linux/list.h> -#include <linux/pagemap.h> - -#include <kddm/kddm.h> - -#include "inode.h" +#include "common.h" void kdfs_file_extent_init(struct kdfs_inode *k_inode); diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 8113b82..f263215 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -15,8 +15,8 @@ #include <net/krgrpc/rpcid.h> #include <kddm/kddm.h> -#include "super.h" #include "inode.h" +#include "super.h" #include "file_extent.h" #include "dir.h" #include "file.h" @@ -1369,7 +1369,7 @@ int kdfs_iol_inode_sync_object(kddm_obj_t *objEntry, return -1; } - kdfs_write_inode(kdfs_inode->inode); + __kdfs_write_inode(kdfs_inode); PRINT_FUNCTION_EXIT; return 0; } diff --git a/fs/kdfs/inode.h b/fs/kdfs/inode.h index f508d46..1581ef5 100644 --- a/fs/kdfs/inode.h +++ b/fs/kdfs/inode.h @@ -15,6 +15,11 @@ #define __KDFS_INODE__ + +#include "common.h" + + + /*--------------------------------------------------------------------------* * * * MACROS * @@ -29,13 +34,6 @@ #define K_INODE_DIRTY 8 #define K_INODE_TODELETE 16 -/* Max number of extent records that fit in a kddm object */ -/* if you change the kdfs_netinode or kdfs_file_extent_info - structures, please update this constant! - 124 = size of kdfs_netinode (without the extents array) - 24 = size of kdfs_file_extent_info */ -#define FILE_EXT_MAX_MEMBERS ((PAGE_SIZE - 124)/24) - /* cf <ctnr/object-server.h> */ #ifndef KDDM_CREATE_ON_FT #define KDDM_CREATE_ON_FT 0x00000100 @@ -47,74 +45,6 @@ * * *--------------------------------------------------------------------------*/ -/* COPIED FROM super.h */ -#ifndef __KDFS_SUPER__ -typedef short kdfs_node_t; /* kerrighed_node_t*/ -#endif -/* END COPY */ - -/* FILE STRIPING TYPES */ -/* the actual strip extent info */ -struct kdfs_file_extent_info { - pgoff_t page_first; /* the first page no owned by a node */ - pgoff_t page_last; /* the last page no owned by a node */ - kdfs_node_t extent_owner; /* the node holding the pages contents */ -}; -/* the extent list item */ -struct kdfs_file_extent { - struct kdfs_file_extent_info data; /* the extent data */ - struct list_head list_item; /* the list member linking it to the list */ -}; - - -struct kdfs_inode { - struct inode* inode; /* Local copy of the inode */ - - kddm_set_id_t content_setid; /* Clusterwide Reference to the File or Dir container associated */ - - /* k_inode flags*/ - char flags; - - /* Cluster-wide count */ - atomic_t cw_count; - - /* Striping extents list */ - /* TODO take care of netinode too!!! */ - struct list_head extents_list; -}; - -/* - * Network representation of kdfs_inode - * exploited during import and export functions - */ -struct kdfs_netinode { - /* inode informations */ - unsigned long i_ino; - loff_t i_size; - umode_t i_mode; - unsigned int i_nlink; - uid_t i_uid; - gid_t i_gid; - struct timespec i_atime; - struct timespec i_mtime; - struct timespec i_ctime; - unsigned long i_version; - unsigned long i_state; - - /* Cluster-wide count */ - atomic_t cw_count; - - /* miscellaneous informations*/ - kddm_set_id_t content_setid; - - /* k_inode flags*/ - char flags; - - /* File extents portion */ - size_t no_extents; - struct kdfs_file_extent_info extents[FILE_EXT_MAX_MEMBERS]; -}; - /*--------------------------------------------------------------------------* * * * PROTOTYPES * diff --git a/fs/kdfs/physical_fs.h b/fs/kdfs/physical_fs.h index da833c6..590f9fd 100644 --- a/fs/kdfs/physical_fs.h +++ b/fs/kdfs/physical_fs.h @@ -13,6 +13,11 @@ #ifndef __KDFS_PHYSICAL_FS__ #define __KDFS_PHYSICAL_FS__ + + +#include "common.h" + + /*--------------------------------------------------------------------------* * * * MACROS * diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index db1ebdf..b2fc70e 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -22,8 +22,8 @@ #include <kddm/kddm.h> #include "physical_fs.h" -#include "super.h" #include "inode.h" +#include "super.h" #include "file_extent.h" #include "dir.h" #include "address_space.h" @@ -990,8 +990,6 @@ struct inode *kdfs_getinode(struct super_block *sb, unsigned long ino) /* * Write a physical inode of kDFS - * This function is called by the VFS when a kDFS inode is marked dirty and one - * sync operation is generated by the VFS (sync, pdfflush, ...) * * @author Adrien Lebre * @@ -999,8 +997,9 @@ struct inode *kdfs_getinode(struct super_block *sb, unsigned long ino) * @param sync ?? - but currently not used * */ -int kdfs_write_inode(struct inode *inode) +int __kdfs_write_inode(struct kdfs_inode *k_inode) { + struct inode *inode = k_inode->inode; struct file *file = NULL; char *phys_filename = NULL; struct kdfs_physical_inode phys_inode; @@ -1042,7 +1041,7 @@ int kdfs_write_inode(struct inode *inode) * it seams the kdfs_inode is locked, but we need it * to dump the extent's info in the meta file ... **********************/ - //kdfs_file_extent_dump_to_file(kdfs_iget(inode->i_ino), file); + kdfs_file_extent_dump_to_file(k_inode, file); close_phys_file(file); } else { DEBUG (DBG_ALERT, diff --git a/fs/kdfs/super.h b/fs/kdfs/super.h index 4b615e7..38c9efc 100644 --- a/fs/kdfs/super.h +++ b/fs/kdfs/super.h @@ -18,6 +18,11 @@ #include <asm/page.h> #include <linux/statfs.h> + + +#include "common.h" + + /*--------------------------------------------------------------------------* * * * MACROS * @@ -38,7 +43,6 @@ #define KDFS_COMPUTE_ROOT_INODEID(kdfs_sb)\ ((kdfs_sb->root_nodeid << 24) + KDFS_ROOT_INODEID) -typedef short kdfs_node_t; /* kerrighed_node_t*/ #define KDFS_MIN_NODEID 0 #define KDFS_MAX_NODEID 255 #define KDFS_MAX_NO_NODES ((KDFS_MAX_NODEID) - (KDFS_MIN_NODEID) + 1) @@ -171,27 +175,6 @@ struct kdfs_netcwsb { char bmp[KDFS_CW_SB_BYTES]; // The bitmap to transfer }; -/* - * A physical representation of kDFS inode is required. - * This representation is stored on the .meta file. - * First, to protect kDFS consistency (direct manipulations on the native FS - * inodes will not impact on the kDFS structure). - * Second, since we exploit a '...' file for storing meta-informations - * (directory entries, object localisation, ...). We simply cannont exploit nlink native value. - * Directly using native inodes make inode management harder and uglier :p - */ -struct kdfs_physical_inode { - loff_t size; - umode_t mode; - unsigned int nlink; - unsigned long version; - uid_t uid; - gid_t gid; - struct timespec atime; - struct timespec mtime; - struct timespec ctime; -}; - /*--------------------------------------------------------------------------* * * * EXTERN VARIABLES * @@ -215,7 +198,7 @@ int finalize_kdfs(void); void cleanup_kdfs(void); void kdfs_getphysicalpath(struct kdfs_super_block *k_sb, unsigned long ino, char *physical_filename); -int kdfs_write_inode(struct inode *inode); +int __kdfs_write_inode(struct kdfs_inode *k_inode); struct inode *kdfs_getinode(struct super_block *sb, unsigned long ino); /* Get a free inode id from kdfs_sb partition */ ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.h | 3 + fs/kdfs/common.h | 116 +++++++++++++++++++++++++++++++++++++++++++++++ fs/kdfs/dir.h | 4 ++ fs/kdfs/extent.h | 4 ++ fs/kdfs/file.h | 5 ++ fs/kdfs/file_extent.c | 1 - fs/kdfs/file_extent.h | 7 +--- fs/kdfs/inode.c | 4 +- fs/kdfs/inode.h | 80 ++------------------------------ fs/kdfs/physical_fs.h | 5 ++ fs/kdfs/super.c | 9 ++-- fs/kdfs/super.h | 29 +++--------- 12 files changed, 155 insertions(+), 112 deletions(-) create mode 100644 fs/kdfs/common.h hooks/post-receive -- kdfs |