From: Marko O. <d0...@us...> - 2011-01-22 11:15:02
|
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 ee53e55f04811a4a1260f3428a0d45b219877866 (commit) from a8c00b954c25b722d4c7ce9863500720c89f3d68 (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 ee53e55f04811a4a1260f3428a0d45b219877866 Author: Marko Obrovac <mar...@in...> Date: Sat Jan 22 13:05:23 2011 +0100 [MINOR] Reorganise the physical path structure of kDFS inodes. As discussed on the kDFS Mailing List, a new path structure has been adopted for storing inodes. The path to a 32-bit inode is now: node_id/high/low where: node_id = inode_linked_node(ino); high = KDFS_EXTRACT_HIGH(ino); low = KDFS_EXTRACT_LOW(ino); diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 002c520..b0e5d8c 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -391,8 +391,7 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino, boo void kdfs_getphysicalpath(struct kdfs_super_block *k_sb, unsigned long ino, char *phys_filename) { - unsigned long tmp_ino; - short tmp_nodeid; + short tmp_nodeid, tmp_ino_high, tmp_ino_low; PRINT_FUNCTION_NAME; ASSERT(k_sb != NULL); @@ -413,10 +412,11 @@ void kdfs_getphysicalpath(struct kdfs_super_block *k_sb, unsigned long ino, ASSERT(strlen(k_sb->k_opt->part_name) <= PATH_MAX - 20); /* Find the physical path corresponding to the KDFS inode */ - tmp_ino = KDFS_EXTRACT_INO(ino); + tmp_ino_high = KDFS_EXTRACT_HIGH(ino); + tmp_ino_low = KDFS_EXTRACT_LOW(ino); tmp_nodeid = inode_linked_node(ino); - sprintf(phys_filename, "%s%d/%lu-%lu/%lu", k_sb->k_opt->part_name, tmp_nodeid, - (unsigned long)(tmp_ino / 100) * 100, (unsigned long)(tmp_ino / 100) * 100 + 99, tmp_ino); + sprintf(phys_filename, "%s%d/%d/%d", k_sb->k_opt->part_name, tmp_nodeid, + tmp_ino_high, tmp_ino_low); DEBUG(DBG_INFO, "function EXIT: Physical file for inode %lu: %s\n", ino, phys_filename); } diff --git a/fs/kdfs/super.h b/fs/kdfs/super.h index 58d2166..f33d266 100644 --- a/fs/kdfs/super.h +++ b/fs/kdfs/super.h @@ -44,7 +44,11 @@ #define KDFS_CWSB_ID ((KDFS_MAX_NODEID) + 1) #define KDFS_LOCALINODE_MASK 0x00FFFFFF /* the first 8 bits are reserved for the nodeid */ #define KDFS_NODEID_MASK 0xFF000000 /* the nodeid in the ino */ +#define KDFS_INO_HIGH_MASK 0x00FFF000 /* the high part of the ino */ +#define KDFS_INO_LOW_MASK 0x00000FFF /* the low part of the ino */ #define KDFS_EXTRACT_INO(x) ((x) & KDFS_LOCALINODE_MASK) +#define KDFS_EXTRACT_HIGH(x) (((x) & KDFS_INO_HIGH_MASK) >> 12) +#define KDFS_EXTRACT_LOW(x) ((x) & KDFS_INO_LOW_MASK) #define KDFS_BM_BLOCK_SIZE (PAGE_SIZE) #define KDFS_BM_BLOCK_MAXINO (KDFS_BM_BLOCK_SIZE * 8) ----------------------------------------------------------------------- Summary of changes: fs/kdfs/super.c | 10 +++++----- fs/kdfs/super.h | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) hooks/post-receive -- kdfs |