You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(37) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(6) |
Feb
|
Mar
(13) |
Apr
(3) |
May
(6) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(3) |
Nov
(6) |
Dec
(8) |
2011 |
Jan
(11) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: alebre <al...@us...> - 2011-04-14 09:41:42
|
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 9cbe48172fa3966d40a9596dfd4669b421d0adf9 (commit) from 927e053074f10d3d9d154f417fb78dde4fdcad94 (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 9cbe48172fa3966d40a9596dfd4669b421d0adf9 Author: ad <leb...@fr...> Date: Thu Mar 24 20:52:46 2011 +0000 [MINOR] - Bypass the FAF service for kDFS files diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 1885d53..39ce20d 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1361,7 +1361,6 @@ int kdfs_iol_inode_remove_object(void *object, kddm_set_t *set, objid_t objid) if (!dchild->d_inode) d_drop(dchild); /* Should we revalidate instead? */ } - DEBUG(DBG_INFO, "drop dentry\n"); d_drop(dentry); } diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 8446503..963b924 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1191,7 +1191,7 @@ void kdfs_drop_inode(struct inode *inode) // Warning the k_inode should be locked (get/grab) void destroy_content_kddmset(struct kdfs_inode *k_inode) { - DEBUG(DBG_INFO, "Destroy the contentset associated to inode %ld\n", k_inode->inode->i_ino); + DEBUG(DBG_INFO, "Destroy the contentset %ld associated to inode %ld\n", k_inode->content_setid, k_inode->inode->i_ino); /* Get the inode and delete its associated content set and its entry in INODE KDDM Set */ if (k_inode->content_setid != KDDM_SET_UNUSED) { // WARNING, the set should exist somewhere in the cluster diff --git a/fs/kdfs/super.h b/fs/kdfs/super.h index f33d266..510e093 100644 --- a/fs/kdfs/super.h +++ b/fs/kdfs/super.h @@ -28,7 +28,8 @@ *--------------------------------------------------------------------------*/ /* file system regiteration information */ -#define KDFS_SUPER_MAGIC 0x3542 +// Added in include/linux/magic.h (Please note that I don't know/remember how this number has been computed - Adrien April 11th, 2011) +//#define KDFS_SUPER_MAGIC 0x3542 #define KDFS_SB_FILENAME ".sb" #define KDFS_INODE_FILENAME ".meta" diff --git a/include/linux/magic.h b/include/linux/magic.h index eb9010c..c9f3ed1 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h @@ -52,5 +52,6 @@ #define STACK_END_MAGIC 0x57AC6E9D #ifdef CONFIG_KRG_DVFS #define OCFS2_SUPER_MAGIC 0x7461636f +#define KDFS_SUPER_MAGIC 0x3542 #endif #endif /* __LINUX_MAGIC_H__ */ diff --git a/kerrighed/fs/faf/faf.c b/kerrighed/fs/faf/faf.c index 7a9768a..ec77b35 100644 --- a/kerrighed/fs/faf/faf.c +++ b/kerrighed/fs/faf/faf.c @@ -291,6 +291,7 @@ int setup_faf_file_if_needed(struct file *file) if (((s_magic == PROC_SUPER_MAGIC) || (s_magic == NFS_SUPER_MAGIC) || + (s_magic == KDFS_SUPER_MAGIC) || (s_magic == OCFS2_SUPER_MAGIC)) && (S_ISREG(i_mode) || S_ISDIR(i_mode) || S_ISLNK(i_mode))) goto exit; ----------------------------------------------------------------------- Summary of changes: fs/kdfs/inode.c | 1 - fs/kdfs/super.c | 2 +- fs/kdfs/super.h | 3 ++- include/linux/magic.h | 1 + kerrighed/fs/faf/faf.c | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2011-01-23 13:19:15
|
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 "UNNAMED PROJECT". The branch, master has been updated via 5f6f7bea9fe13feb17d8b82e774b0128ba1a433c (commit) from 00dc235ac628ff542a43a25d667a44dcf1cc91f9 (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 5f6f7bea9fe13feb17d8b82e774b0128ba1a433c Author: Marko Obrovac <mar...@in...> Date: Sun Jan 23 15:14:51 2011 +0100 [ADD] The kdfs_convert utility Given a file on the kDFS file system, this utility prints out the physical path of the kDFS inode. Usage: kdfs_convert filename ... (a variable number of file names can be supplied) diff --git a/tools/Makefile.am b/tools/Makefile.am index b933e82..539886e 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -11,7 +11,7 @@ dist_sbin_SCRIPTS = krginit_helper krg_legacy_scheduler bin_PROGRAMS = migrate checkpoint restart krgcapset krgcr-run ipccheckpoint ipcrestart -sbin_PROGRAMS = krgadm krginit mkfs.kdfs kdfs_stat netclient +sbin_PROGRAMS = krgadm krginit mkfs.kdfs kdfs_stat netclient kdfs_convert INCLUDES = -I@top_srcdir@/libs/include LDADD = @top_builddir@/libs/libkerrighed/libkerrighed.la @top_builddir@/libs/libkrgcb/libkrgcb.la @@ -29,6 +29,7 @@ ipcrestart_SOURCES = ipcrestart.c mkfs_kdfs_SOURCES = mkfs_kdfs.c netclient_SOURCES = netclient.c kdfs_stat_SOURCES = kdfs_stat.c +kdfs_convert_SOURCES = kdfs_convert.c EXTRA_DIST = \ krginit_helper.conf \ diff --git a/tools/kdfs_convert.c b/tools/kdfs_convert.c new file mode 100644 index 0000000..56c42d7 --- /dev/null +++ b/tools/kdfs_convert.c @@ -0,0 +1,91 @@ +#include <unistd.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <stdio.h> +#include <stdlib.h> + +/** from super.h **/ +#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_HIGH(x) (((x) & KDFS_INO_HIGH_MASK) >> 12) +#define KDFS_EXTRACT_LOW(x) ((x) & KDFS_INO_LOW_MASK) +/** for extracting the node id **/ +#define KDFS_EXTRACT_NODEID(x) (((x) & KDFS_NODEID_MASK) >> 24) + + +/** + * Prints the util's usage on the specified stream + * + * @prog the nme of the utility + * @fp the stream to output to + */ +void usage(char *prog, FILE *fp) { + + fprintf(fp, "Usage: %s filename ...", prog); + +} + + +/** + * Stats the file, etracts the ino and prints the result on the given stream + * + * @fname the file name in the kDFS system to stat + * @output the output stream on which to print the result + * + * @returns EXIT_SUCCESS on success, + * EXIT_FAILURE otherwise + */ +int print_kdfs_path(char *fname, FILE *output) { + + struct stat buf; + short nodeid, high, low; + + if (stat(fname, &buf) != 0) { + fprintf(output, "%s\n", fname); + return EXIT_FAILURE; + } + + nodeid = KDFS_EXTRACT_NODEID(buf.st_ino); + high = KDFS_EXTRACT_HIGH(buf.st_ino); + low = KDFS_EXTRACT_LOW(buf.st_ino); + + fprintf(output, "%s\t%u/%u/%u\n", fname, nodeid, high, low); + + return EXIT_SUCCESS; + +} + + +/** + * The entry point function + * + * @argc the number of arguments supplied on the command line + * @argv the arguments themselves + * + * @returns EXIT_SUCCESS on success, + * EXIT_FAILURE otherwise + */ +int main(int argc, char **argv) { + + int index, no_ok = 0; + + /* check that the user supplied at least one argument */ + if (argc == 1) { + usage(argv[0], stderr); + return EXIT_FAILURE; + } + + /* process all the filenames given on the command line */ + for(index = 1; index < argc; index++) { + if (print_kdfs_path(argv[index], stdout) == EXIT_SUCCESS) + no_ok++; + } + + if (no_ok > 0) + return EXIT_SUCCESS; + + return EXIT_FAILURE; + +} + ----------------------------------------------------------------------- Summary of changes: tools/Makefile.am | 3 +- tools/kdfs_convert.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletions(-) create mode 100644 tools/kdfs_convert.c hooks/post-receive -- UNNAMED PROJECT |
From: Marko O. <d0...@us...> - 2011-01-22 11:15:30
|
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 "UNNAMED PROJECT". The branch, master has been updated via 00dc235ac628ff542a43a25d667a44dcf1cc91f9 (commit) from e18d0c55ce0f094075668124463c4a6a262288b8 (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 00dc235ac628ff542a43a25d667a44dcf1cc91f9 Author: Marko Obrovac <mar...@in...> Date: Sat Jan 22 13:13:28 2011 +0100 [MINOR] Conform to the structure reorganisation from the kernel diff --git a/tools/mkfs_kdfs.c b/tools/mkfs_kdfs.c index 9a4bf32..43dee34 100644 --- a/tools/mkfs_kdfs.c +++ b/tools/mkfs_kdfs.c @@ -201,7 +201,7 @@ int main(int argc, char* argv[]) sprintf(root_file, "%s/%d", argv[1], nodeid); mkdir(root_file, 0777); - strcat(root_file,"/0-99"); + strcat(root_file,"/0"); mkdir(root_file, 0777); if (nodeid == root_nodeid) { ----------------------------------------------------------------------- Summary of changes: tools/mkfs_kdfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- UNNAMED PROJECT |
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 |
From: alebre <al...@us...> - 2011-01-21 16:23:51
|
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 a8c00b954c25b722d4c7ce9863500720c89f3d68 (commit) from d3073641f89532f79fe44fcb6748637ca0c490ec (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 a8c00b954c25b722d4c7ce9863500720c89f3d68 Author: ad <leb...@fr...> Date: Fri Jan 21 06:21:55 2011 +0000 When the owner of a page changes, we should not read the data from the HDD once again - Adrien diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 8166d37..3ca856b 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -17,6 +17,7 @@ #include <net/krgrpc/rpc.h> #include <net/krgrpc/rpcid.h> #include <kddm/kddm.h> +#include <kddm/object_server.h> #include "super.h" #include "inode.h" @@ -354,7 +355,8 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id struct kdfs_page *k_newpage ; kdfs_node_t masternode ; objid_t objid ; - + int kddm_flag=0; + k_prevpage = k_newpage = NULL ; masternode = kdfs_file_extent_get_page_owner(k_inode, page_id) ; @@ -364,20 +366,20 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id masternode = kerrighed_node_id ; kdfs_file_extent_set_page_owner(k_inode, page_id, masternode); } else if (masternode != kerrighed_node_id) { - // the page already exists but teh grab is done remotely to the masternode, so : grab the previous object and reassign this page to the current node + // the page already exists but the grab is done remotely to the masternode, so : grab the previous object and reassign this page to the current node objid = pageindex_to_contentobjid(masternode, page_id); DEBUG(DBG_INFO, "Gonna grab prevpage %lu from set %lu (objid = %lu)\n", page_id, k_inode->content_setid, objid); - k_prevpage=kdfs_grab_page(k_inode->content_setid, objid); + k_prevpage=kdfs_grab_page(k_inode->content_setid, objid,0); /* set the page's owner to this node */ masternode = kerrighed_node_id ; kdfs_file_extent_set_page_owner(k_inode, page_id, masternode); - + kddm_flag=KDDMKDFS_FT_NO_IO; //cf ../../include/kddm/object_server.h } objid = pageindex_to_contentobjid(masternode, page_id); DEBUG(DBG_INFO, "Gonna grab page %lu from set %lu (objid = %lu)\n", page_id, k_inode->content_setid, objid); - k_newpage=kdfs_grab_page(k_inode->content_setid, objid); + k_newpage=kdfs_grab_page(k_inode->content_setid, objid,kddm_flag); if(k_prevpage){ // Set the reference to the local page to NULL to avoid wrong manipulations @@ -390,12 +392,12 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id return k_newpage; } -struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id) +struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id, int flags) { DEBUG(DBG_INFO, "Grab object %lu from set %lu\n", obj_id, set_id); - return kddm_grab_object(kddm_def_ns, set_id, obj_id); + return fkddm_grab_object(kddm_def_ns, set_id, obj_id, flags); } struct kdfs_page *kdfs_findlocal_page(kddm_set_id_t set_id, objid_t obj_id) @@ -610,6 +612,7 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, /* The page should be already in the cache if the get/grab has has been invoked by the VFS on the node (i.e kdfs_readpage) */ k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { + DEBUG(DBG_TRACE, "The page is not in the cache, so created and locked\n"); k_page->page = find_or_create_page(k_mapping, pageid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); k_page->flags = K_PG_locked; } else @@ -618,7 +621,8 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, page_addr = (char *) kmap(k_page->page); pos = (loff_t)pageid * PAGE_SIZE; - iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); + if(flags != KDDMKDFS_FT_NO_IO) + iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); kunmap(k_page->page); objEntry->object = (void *) k_page; diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index ab11551..1850505 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -125,7 +125,7 @@ static inline pgoff_t contentobjid_to_pageindex(objid_t objid) struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, objid_t obj_id); struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id); struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, objid_t obj_id); -struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id); +struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id, int flags); struct kdfs_page *kdfs_findlocal_page(kddm_set_id_t set_id, objid_t obj_id); void _kdfs_put_page(struct kdfs_page *k_page); diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 892d3a2..002c520 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -32,7 +32,7 @@ #include "debug_kdfs.h" #define KDFS_PART "KDFS - SB Mgmnt" -void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino); +void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino, bool removeContent); int kdfs_show_options(struct seq_file *seq, struct vfsmount *vfs); static int parse_options(char *options, struct kdfs_super_block *k_sb); @@ -286,7 +286,7 @@ out: * * @warning k_sb has to be grabbed before */ -void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) +void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino, bool removeContent) { char *phys_dirname = NULL; #if 0 @@ -335,14 +335,18 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) kdfs_phys_read(filp, (char *) &id_meta, sizeof(id_meta), &filp->f_pos); #endif + /* Remove CONTENT File */ + DEBUG(DBG_INFO, "removeContent :%d\n",removeContent); + if(removeContent){ kdfs_getphysicalpath(k_sb, ino, phys_dirname); sprintf(phys_dirname, "%s/" KDFS_CONTENT_FILENAME, phys_dirname); DEBUG(DBG_INFO, "Try to remove phys_file %s\n", phys_dirname); - remove_phys_file(phys_dirname, 0, 0); + res=remove_phys_file(phys_dirname, 0, 0); if (res){ DEBUG(DBG_ALERT, "Cannot remove phys file %s (res=%d)\n", phys_dirname, res); goto exit; } + } #if 0 kdfs_getphysicalpath(k_sb, ino, phys_dirname); sprintf(phys_dirname, "%s/.extents%d", phys_dirname, id_meta); @@ -355,6 +359,8 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) DEBUG(DBG_INFO, "Try to remove phys_file %s\n", phys_dirname); remove_phys_file(phys_dirname, 0, 0); #endif + + /* Remove DIR */ kdfs_getphysicalpath(k_sb, ino, phys_dirname); DEBUG(DBG_INFO, "Try to remove phys_dir %s\n", phys_dirname); res = remove_phys_dir(phys_dirname, 0, 0); @@ -1137,7 +1143,7 @@ void kdfs_drop_inode(struct inode *inode) long ino = inode->i_ino; struct kdfs_inode *k_inode; struct kdfs_super_block *k_sb; - + bool removeContent = 0 ; DEBUG(DBG_INFO, "Drop inode id %ld\n", ino); k_inode = kdfs_iget(ino); @@ -1159,7 +1165,9 @@ void kdfs_drop_inode(struct inode *inode) * The basic idea consists in adding some check in order to know if we are the last node * handling the object or not. */ - + // Ugly but ;) + removeContent=inode->i_size; + generic_delete_inode(inode); /* Cleanly remove inode from kddm inode set */ destroy_content_kddmset(k_inode); @@ -1171,7 +1179,7 @@ void kdfs_drop_inode(struct inode *inode) k_sb = kdfs_getsb(kerrighed_node_id); /* Close the physical file before it is removed in kdfs_remove_local_ino */ /* TODO PRIORITY 1: if the file is deleted on another node that the one where it has been created, we do not remove the local_ino from the bitmap */ - kdfs_remove_local_ino(k_sb, ino); + kdfs_remove_local_ino(k_sb, ino, removeContent); __kdfs_putsb(k_sb); } } diff --git a/include/kddm/object_server.h b/include/kddm/object_server.h index 622a007..ca401ea 100644 --- a/include/kddm/object_server.h +++ b/include/kddm/object_server.h @@ -38,6 +38,8 @@ #define KDDM_TRY_GRAB 0x00000800 #define KDDM_REMOVE_ON_ACK 0x00001000 #define KDDM_COW_OBJECT 0x00002000 +//kDFS MACROS +#define KDDMKDFS_FT_NO_IO 0x00003000 //Don't access to the harddrive during a first_touch operation #define KDDM_SET_REQ_TYPE (KDDM_OBJ_COPY_ON_READ | KDDM_OBJ_COPY_ON_WRITE) ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 20 ++++++++++++-------- fs/kdfs/address_space.h | 2 +- fs/kdfs/super.c | 20 ++++++++++++++------ include/kddm/object_server.h | 2 ++ 4 files changed, 29 insertions(+), 15 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2011-01-16 21:03:27
|
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 d3073641f89532f79fe44fcb6748637ca0c490ec (commit) from cc6fabae0376d5eeec74875ff1ea180a76b77433 (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 d3073641f89532f79fe44fcb6748637ca0c490ec Author: ad <leb...@fr...> Date: Sun Jan 16 22:02:43 2011 +0000 Temporary fix for k_inode and extent issue concerns with regard to memory allocation - Adrien diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 95e05ce..1885d53 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1300,8 +1300,16 @@ int kdfs_iol_inode_invalidate_object(kddm_obj_t *objEntry, } d_drop(dentry); } + + // Free memory previously allocated since we do not keep the object + // Due to current file extent import and export issues (during an import, we do + // not check the content of the extent list. Instead, we simple init the list and add the received ones) + kdfs_file_extent_free(k_inode); + kfree(k_inode); + PRINT_FUNCTION_EXIT; - return KDDM_IO_KEEP_OBJECT; // in order to keep the object +// return KDDM_IO_KEEP_OBJECT; // in order to keep the object + return 0; } /* * Sync an inode struct (mark at dirty on the right node). ----------------------------------------------------------------------- Summary of changes: fs/kdfs/inode.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2011-01-16 16:53:20
|
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 cc6fabae0376d5eeec74875ff1ea180a76b77433 (commit) from beed749ef6eadf71f1f48a7aa9f48f42fcc5d333 (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 cc6fabae0376d5eeec74875ff1ea180a76b77433 Author: ad <leb...@fr...> Date: Sun Jan 16 17:52:33 2011 +0000 kmalloc/kfree check - Adrien diff --git a/fs/kdfs/TODO b/fs/kdfs/TODO index 579c18f..9a19788 100644 --- a/fs/kdfs/TODO +++ b/fs/kdfs/TODO @@ -40,6 +40,10 @@ Prio. added added Type What 2 adrien 100819 ls -al upon a directory returns a wrong size (should be 4096, however the realsize of the directory is returned) 2 adrien 100819 ls -al upon a directory returns a wrong size (should be 4096, however the realsize of the directory is returned) 2 adrien 110106 Study directories/files deletions (why it is so long, some sets seem to be created why ? At the first sight, it should be avoided) +3 adrien 11014 Why rmdir generates a drop of all files that belong to the directories (drop of the cache and directory not empty, so rmdir failed but cache is flushed) +3 adrien 11014 Improve the management of directory entries (currently .content of a directory is not packed. It means that if you create thousand of files in one directory + and then delete them, the size of .content is not shrink). This is due to the readdir issue (fp-> pos can refer a wrong entry if some files have been deleted between two calls). + As a consequence, the management of directory entries in kDFS follows the ext2/ext3 approach (which is really non efficient in terms of both performance and space). DONE ~~~~ diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 4a90d2d..8166d37 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -909,6 +909,7 @@ int kdfs_iol_page_remove(void *object, struct kddm_set *set, objid_t objid) DEBUG(DBG_ALERT, "Page after count=%d\n", page_count(k_page->page)); } + kfree(k_page); PRINT_FUNCTION_EXIT; return 0; } diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h index 7e23001..5b23c39 100644 --- a/fs/kdfs/debug_kdfs.h +++ b/fs/kdfs/debug_kdfs.h @@ -45,8 +45,11 @@ #else # define DEBUG(level, format, ...) \ do { \ - if (KDFS_DEBUG_LEVEL >= level) { \ - pr_debug("pid %d, %s, %d | %s @ %d | " format "", current->pid, current->comm, task_pid_knr(current), __func__, __LINE__, ##__VA_ARGS__); \ + if (KDFS_DEBUG_LEVEL >= level) { \ + if (level != DBG_PANIC && level != DBG_ALERT) \ + pr_debug("pid %d, %s, %d | %s @ %d | " format "", current->pid, current->comm, task_pid_knr(current), __func__, __LINE__, ##__VA_ARGS__); \ + else \ + printk("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/dir.c b/fs/kdfs/dir.c index 7468d21..a34d56f 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -854,7 +854,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) filp->f_pos, dir_entry->ino, kdfs_dt_type(dir_entry->mode)); if (res < 0) { /* filldir is over (cf. ext2_readdir), so a new dirent should be allocated by the kernel */ - DEBUG(DBG_ALERT, "Can't fill dirent or dirent is full (res=%d)\n",res); + DEBUG(DBG_TRACE, "Can't fill dirent or dirent is full (res=%d)\n",res); /* Get the directory entry */ kunmap(tmp_page); _kdfs_put_page(k_page); diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index 6440c2f..f277e51 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -283,6 +283,14 @@ size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) list_add_tail(&new_extent->list_item, &k_inode->extents_list); } close_phys_file(file); + + DEBUG(DBG_INFO, "\n\n\nLIST CONTENTS AFTER READ\n"); + if (!list_empty(&k_inode->extents_list)) { + list_for_each_entry(curr, &k_inode->extents_list, list_item) { + DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); + } + } + } else { DEBUG(DBG_ALERT, "Can't access to the KDFS inode %lu\n" @@ -291,16 +299,7 @@ size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) } kfree(phys_filename); - - DEBUG(DBG_INFO, "\n\n\nLIST CONTENTS AFTER READ\n"); - if (!list_empty(&k_inode->extents_list)) { - list_for_each_entry(curr, &k_inode->extents_list, list_item) { - DEBUG(DBG_INFO, "#################### f=%lu, l=%lu, o=%d\n", curr->data.page_first, curr->data.page_last, curr->data.extent_owner); - } - } - return 0; - } void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_fullnetinode *net_inode) diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index aa90b7d..95e05ce 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1191,12 +1191,6 @@ int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry, insert_inode_hash(k_inode->inode); PRINT_FUNCTION_EXIT; return 0; - - /* TODO PRIORITY 1, Adrien: - * A bug can occur for the case where a remote node access to one object for the first time (get) - * This object is then inserted in the local set without setting its right reference according to its mode.... - * Is it possible ? - */ } diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index bcafba6..892d3a2 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1058,7 +1058,6 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod * @author Adrien Lebre * * @param inode The VFS inode - * @param sync ?? - but currently not used * */ int __kdfs_write_inode(struct kdfs_inode *k_inode) @@ -1108,13 +1107,15 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) kdfs_file_extent_dump_to_file(k_inode, file); close_phys_file(file); } else { - DEBUG (DBG_PANIC, - "Can't access/create the KDFS inode %lu metafile \nPlease "\ - "verify type of the partition %s, it should be a KDFS one "\ - " (error %ld)\n", inode->i_ino, - ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name, - PTR_ERR(file)); + DEBUG (DBG_ALERT, "Can't access/create the KDFS inode %lu metafile \n", inode->i_ino); res = PTR_ERR(file); + if(res == - ENOSPC) + DEBUG (DBG_ALERT, "No space left on device %s (please check inode and block free: df -i and df -k)\n",\ + ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name); + else + DEBUG (DBG_ALERT, "Please verify the error according to the kdfs partition %s "\ + " (error %ld)\n", ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name, + PTR_ERR(file)); } kfree(phys_filename); @@ -2001,21 +2002,14 @@ int kdfs_iol_sb_import (struct rpc_desc *desc, k_sb = kgsb->real_sb; __kdfs_import_kdfs_sb(k_sb, net_src); - /* Set to NULL all irrelevant pointer references */ - /* - * TODO PRIORITY 1, Adrien: - * One way to avoid non clusterwide field allocation - * consists in providing two different code for first_touch and - * alloc I/O linker function */ + /* Free and set to NULL all irrelevant pointer references + * (the ones that have not been imported cf. __kdfs_import_kdfs_sb) + */ if (kerrighed_node_id != k_sb->sb_nodeid) { k_sb->sb = NULL; -#if 0 - if(k_sb->inode_bitmap){ - kfree(k_sb->inode_bitmap); - k_sb->inode_bitmap=NULL; - } -#endif - if (k_sb->k_opt) { + + if (k_sb->k_opt) { + /* K_opt has been allocated during kdfs_iol_sb_alloc, so free it */ kfree(k_sb->k_opt); k_sb->k_opt = NULL; } @@ -2057,12 +2051,8 @@ int kdfs_iol_sb_remove(void *object, struct kddm_set *set, objid_t objid) } else { k_cw_sb = (struct kdfs_cw_sb *) object; if (k_cw_sb->cw_bitmap) { - if (k_cw_sb->cw_bitmap == NULL) - return 0; - - if (k_cw_sb->cw_bitmap->map != NULL) + if (k_cw_sb->cw_bitmap->map != NULL) kfree(k_cw_sb->cw_bitmap->map); - kfree(k_cw_sb->cw_bitmap); } kfree(k_cw_sb); ----------------------------------------------------------------------- Summary of changes: fs/kdfs/TODO | 4 ++++ fs/kdfs/address_space.c | 1 + fs/kdfs/debug_kdfs.h | 7 +++++-- fs/kdfs/dir.c | 2 +- fs/kdfs/file_extent.c | 17 ++++++++--------- fs/kdfs/inode.c | 6 ------ fs/kdfs/super.c | 40 +++++++++++++++------------------------- 7 files changed, 34 insertions(+), 43 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2011-01-12 11:57:27
|
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 beed749ef6eadf71f1f48a7aa9f48f42fcc5d333 (commit) from 0791354f11b2d8bb6090c786e3aca225cd795f22 (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 beed749ef6eadf71f1f48a7aa9f48f42fcc5d333 Author: ad <leb...@fr...> Date: Wed Jan 12 11:43:09 2011 +0000 Fix lookup of directory entries (since the last change, we should check the value of ino and not only compare filenames) - Adrien diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index eb82fa8..7468d21 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -102,8 +102,9 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file /* Did we find the right entry */ DEBUG (DBG_INFO, "filelen %d dirfilelen %d, filename %s dirname %s, dirlen %d (dirino %lu)\n", filename_len, dir_entry->name_len, filename, dir_entry->name,dir_entry->rec_len, dir_entry->ino); - if (dir_entry->name_len == filename_len && - strncmp (dir_entry->name, filename, filename_len) == 0) + if (dir_entry->ino != KDFS_BAD_INODEID && + dir_entry->name_len == filename_len && + strncmp (dir_entry->name, filename, filename_len) == 0) goto found; /* Check if another dentry could be contained in the current page */ @@ -206,8 +207,9 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, DEBUG(DBG_INFO, "file:%s (filename_len %d), dir:%s (dirfilename_len %d), dirlen %d (dirino %lu)\n", filename, filename_len, dir_entry->name, dir_entry->name_len, dir_entry->rec_len, dir_entry->ino); - if (dir_entry->name_len == filename_len && - strncmp (dir_entry->name, filename, filename_len) == 0) + if (dir_entry->ino != KDFS_BAD_INODEID && + dir_entry->name_len == filename_len && + strncmp (dir_entry->name, filename, filename_len) == 0) goto found; /* Check if another dentry could be contained in the current page */ @@ -724,7 +726,7 @@ int kdfs_dir_empty(struct kdfs_inode *k_dir) dir_entry = (struct kdfs_dir_entry *) direntry_addr; /* Did we find the right entry */ - if (dir_entry->ino != 0 ){ + if (dir_entry->ino != KDFS_BAD_INODEID ){ res = 0; break; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/dir.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2011-01-11 18:18:05
|
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 0791354f11b2d8bb6090c786e3aca225cd795f22 (commit) from b181310573abd91710fc46f94c350ebb83d46cdb (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 0791354f11b2d8bb6090c786e3aca225cd795f22 Author: ad <leb...@fr...> Date: Tue Jan 11 19:16:31 2011 +0000 Preliminary commit to test kernel compilations (Fix the management of directory entries in order to run Bonnie++) - Adrien diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index 022d60d..eb82fa8 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -469,7 +469,7 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, * * @return 0 If everything ok. Negative value otherwise. */ -int kdfs_del_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino) +int kdfs_del_and_pack_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino) { ino_t res = KDFS_BAD_INODEID; int err = -ENOENT; @@ -569,6 +569,61 @@ out: return err; } + + + +/* + * Delete an entry in a given directory + * and decrement i_nlink counter if the entry is found + * + * @author Adrien Lebre + * + * @param kdfs_pdir Parent directory to add the file in. + * @param filename Name of the file to add. + * @param ino Associated file's inode id. + * + * @return 0 If everything ok. Negative value otherwise. + */ +int kdfs_del_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino) +{ + ino_t res = KDFS_BAD_INODEID; + int err = -ENOENT; + struct kdfs_dir_entry *dir_entry = NULL; + struct kdfs_page *k_page = NULL; + void *page_addr; + + PRINT_FUNCTION_NAME; + + /* Look for direntry */ + dir_entry = kdfs_grab_entry(kdfs_pdir, filename, &k_page); + if (dir_entry == NULL) + goto out; + + /* We found the direntry, let's remove it! */ + res = le32_to_cpu(dir_entry->ino); + DEBUG(DBG_INFO, "found direntry : ino = %lu \n", res); + page_addr = page_address(k_page->page); + + // Delete the entry by setting a wrong inodeid + dir_entry->ino=KDFS_BAD_INODEID; + + /* Update timestamps */ + kdfs_pdir->inode->i_mtime = kdfs_pdir->inode->i_ctime = CURRENT_TIME_SEC; + + /* Sync kddm object to propagate change to the right partitions (clusterwide) */ + kdfs_mark_inode_dirty(kdfs_pdir); + + /* Propagate changes to the device on the righ node*/ + kdfs_mark_page_dirty(kdfs_pdir->content_setid, k_page->obj_id); + + _kdfs_put_page(k_page); + err = 0; + +out: + PRINT_FUNCTION_EXIT; + return err; +} + /* * Create the '.' and '..' directory entries * @@ -598,7 +653,7 @@ int kdfs_make_empty(struct kdfs_inode *k_pdir, struct kdfs_inode *k_dir) * * @comments k_dir has to be locked */ -int kdfs_dir_empty(struct kdfs_inode *k_dir) +int kdfs_pack_dir_empty(struct kdfs_inode *k_dir) { DEBUG(DBG_INFO, "Directory size: %llu empty if: %lu\n", k_dir->inode->i_size, KDFS_DIRENT_SIZE * 2); if (k_dir->inode->i_size > KDFS_DIRENT_SIZE * 2) @@ -606,6 +661,94 @@ int kdfs_dir_empty(struct kdfs_inode *k_dir) return 1; } +/* + * Check if a directory is empty or not + * + * @author Adrien Lebre + * @param k_dir k_inode directory to check. + * + * @return 1 If k_dir is empty. 0 otherwise. + * + * @comments k_dir has to be locked + */ +int kdfs_dir_empty(struct kdfs_inode *k_dir) +{ + struct kdfs_page *k_page = NULL; + struct kdfs_dir_entry *dir_entry = NULL; + void *direntry_addr; + unsigned long npages ; + unsigned long pageid = 0; + struct page *tmp_page = NULL; + void *page_addr = NULL ; + int res = 1 ; + + PRINT_FUNCTION_NAME; + + if (k_dir->inode->i_size > KDFS_DIRENT_SIZE * 2) { + npages = (k_dir->inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; + if (k_dir->content_setid == KDDM_SET_UNUSED) { + /* + * First access to the directory content: + * create the associated kddm_set + */ + create_dir_kddm_set(k_dir); + } + + /* Parse directory dentries */ + do { + // *k_page = kdfs_get_page(dir->content_setid, pageid); + k_page = kdfs_get_distpage(k_dir, pageid); + if (IS_ERR(k_page)) + DEBUG (DBG_PANIC, + "Can't get page %lu for the directory %lu", + pageid, k_dir->content_setid); + + tmp_page = (k_page)->page; + page_addr = kmap (tmp_page); + direntry_addr = page_addr; + /* Get the directory entry */ + dir_entry = (struct kdfs_dir_entry *) direntry_addr; + direntry_addr += dir_entry->rec_len; // '.' + dir_entry = (struct kdfs_dir_entry *) direntry_addr; + direntry_addr += dir_entry->rec_len; // '..' + // Now dir_entry points on the first real entry + + /* For each entry contained in the page */ + do { + DEBUG (DBG_INFO, + "Get page %lu:" + "page addr (mapped %p, unmapped %p), dentry_addr %p (file size %llu)\n", + pageid, page_addr, tmp_page, direntry_addr, + k_dir->inode->i_size); + /* Get the directory entry */ + dir_entry = (struct kdfs_dir_entry *) direntry_addr; + + /* Did we find the right entry */ + if (dir_entry->ino != 0 ){ + res = 0; + break; + } + /* Check if another dentry could be contained in the current page */ + if ((direntry_addr-page_addr+dir_entry->rec_len) <= (PAGE_CACHE_SIZE - KDFS_DIRENT_SIZE)) + direntry_addr += dir_entry->rec_len; + else + direntry_addr = 0; + } + while ((direntry_addr != 0) && ((pageid * PAGE_CACHE_SIZE) + (direntry_addr-page_addr) < k_dir->inode->i_size)); + + kunmap (tmp_page); + _kdfs_put_page (k_page); + pageid++; + } + while (res && (pageid < npages)); + + dir_entry = NULL; + + } // end if there are some entries + return res; +} + + /*****************************************************************************/ /* */ /* DIRECTORY OPERATIONS */ @@ -644,7 +787,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) unsigned long npages = 0; unsigned long pageid = 0; void *page_addr = NULL; - void *dentry_addr = NULL; + void *direntry_addr = NULL; int res = 0; DEBUG(DBG_INFO, @@ -658,20 +801,16 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) k_inode = kdfs_igrab(filp->f_dentry->d_inode->i_ino); if (k_inode->inode->i_size != 0) { - if (filp->f_pos >= k_inode->inode->i_size) { + if (filp->f_pos > k_inode->inode->i_size - KDFS_DIRENT_SIZE) { DEBUG(DBG_INFO, "readdir file offset is greather than file size. Nothing TODO return\n"); goto out; } if (k_inode->content_setid == KDDM_SET_UNUSED) { /* first access to the directory content: create the associated kddm_set */ - create_dir_kddm_set(k_inode); - //dir_set=create_dir_kddm_set(k_inode); // TODO: PRIORITY 1: test kddm creation + create_dir_kddm_set(k_inode); } - // else - // nsid=0=SYS_KDDM__NS_ID cf. ./ctnr/name_space.h - // dir_set = find_get_kddm_set(KDDM_DEF_NS_ID, k_inode->content_setid); DEBUG (DBG_INFO, "kDFS: readdir %s: offset = %d - dir size %d\n", @@ -679,6 +818,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) /* Parse directory dentries */ DEBUG(DBG_INFO, "Start to look inside directory\n"); + pageid = filp->f_pos / PAGE_SIZE; pageoffset = filp->f_pos - (pageid * PAGE_SIZE); npages = (k_inode->inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; @@ -693,47 +833,54 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) tmp_page = k_page->page; page_addr = kmap(tmp_page); - dentry_addr = page_addr + pageoffset; + direntry_addr = page_addr + pageoffset; /* For each entry contained in the page */ do { /* Get the directory entry */ - dir_entry = (struct kdfs_dir_entry *) dentry_addr; - DEBUG(DBG_INFO, - "dentry_addr %p (dir_len %d, dirname %s, namelen %d, file size %llu, file pos %llu PAGESIZE=%lu pageoffset=%u)\n", - dentry_addr,dir_entry->rec_len, dir_entry->name, dir_entry->name_len, k_inode->inode->i_size, filp->f_pos, PAGE_SIZE, pageoffset); - - /* Fill the buffer with the current directory entry */ - res = filldir(dirent, dir_entry->name, dir_entry->name_len, + dir_entry = (struct kdfs_dir_entry *) direntry_addr; + + if(dir_entry->ino != KDFS_BAD_INODEID){ + + DEBUG(DBG_INFO, + "direntry_addr %p (dir_len %d, dirname %s, namelen %d, file size %llu, file pos %llu PAGESIZE=%lu pageoffset=%u)\n", + direntry_addr,dir_entry->rec_len, dir_entry->name, dir_entry->name_len, k_inode->inode->i_size, filp->f_pos, PAGE_SIZE, pageoffset); + + + /* Fill the buffer with the current directory entry */ + res = filldir(dirent, dir_entry->name, dir_entry->name_len, filp->f_pos, dir_entry->ino, kdfs_dt_type(dir_entry->mode)); - if (res < 0) { - /* filldir is over (cf. ext2_readdir), so a new dirent should be allocated by the kernel */ - DEBUG(DBG_ALERT, "Can't fill dirent or dirent is full (res=%d)\n",res); - /* Get the directory entry */ - kunmap(tmp_page); - _kdfs_put_page(k_page); - goto out; - } + if (res < 0) { + /* filldir is over (cf. ext2_readdir), so a new dirent should be allocated by the kernel */ + DEBUG(DBG_ALERT, "Can't fill dirent or dirent is full (res=%d)\n",res); + /* Get the directory entry */ + kunmap(tmp_page); + _kdfs_put_page(k_page); + goto out; + } + + } else + DEBUG(DBG_INFO,"direntry_addr %p has been deleted, TODO IMPLEMENT THE GC IN ORDER TO REMOVE USELESS DIR ENTRIES\n",direntry_addr); /* Check if another dentry could be contained in the current page */ - if ((dentry_addr-page_addr+dir_entry->rec_len) <= (PAGE_CACHE_SIZE - KDFS_DIRENT_SIZE)) { - dentry_addr += dir_entry->rec_len; + if ((direntry_addr-page_addr+dir_entry->rec_len) <= (PAGE_CACHE_SIZE - KDFS_DIRENT_SIZE)) { + direntry_addr += dir_entry->rec_len; filp->f_pos += dir_entry->rec_len; } else { - filp->f_pos += (page_addr + PAGE_CACHE_SIZE - dentry_addr); - dentry_addr = 0; + filp->f_pos += (page_addr + PAGE_CACHE_SIZE - direntry_addr); + direntry_addr = 0; pageoffset = 0; - } - + } } - while ((dentry_addr != 0) && ((pageid * PAGE_CACHE_SIZE) + (dentry_addr-page_addr) < k_inode->inode->i_size)); + while ((direntry_addr != 0) && ((pageid * PAGE_CACHE_SIZE) + (direntry_addr-page_addr) < k_inode->inode->i_size)); - //kunmap_atomic(tmp_page, KM_USER0); kunmap(tmp_page); _kdfs_put_page(k_page); pageid++; } while (pageid < npages); + + // TODO If we are the last, then pack all directories entries. } else DEBUG(DBG_INFO, ----------------------------------------------------------------------- Summary of changes: fs/kdfs/dir.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 180 insertions(+), 33 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2011-01-10 09:01:40
|
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 b181310573abd91710fc46f94c350ebb83d46cdb (commit) via 651747c41cda1c7441c8fe6c2170af258eab9149 (commit) via 5beec156ca83753b3f8d21dd882ae051db48859c (commit) from 50baf57cb516e181ece3f3fb61d1dc9953b05fcb (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 b181310573abd91710fc46f94c350ebb83d46cdb Author: ad <leb...@fr...> Date: Mon Jan 10 09:04:04 2011 +0000 Switch debugging traces during the mount operations from PANIC to ALERT - Adrien diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 9df0fea..bcafba6 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -172,7 +172,7 @@ int __kdfs_fill_sb(struct kdfs_super_block *k_sb) k_sb->sb_file = open_phys_file(phys_filename, O_RDWR, 0644, 0, 0); if (IS_ERR(k_sb->sb_file)) { - DEBUG (DBG_PANIC, "Can't access the KDFS superfile\n" + DEBUG (DBG_ALERT, "Can't access the KDFS superfile\n" "Please verify the type of the partition %s, it should be a KDFS one", k_sb->k_opt->part_name); goto out_alloc; @@ -185,14 +185,14 @@ int __kdfs_fill_sb(struct kdfs_super_block *k_sb) res = kdfs_phys_read(k_sb->sb_file, (char *) &k_sb->root_nodeid, sizeof(k_sb->root_nodeid), &k_sb->sb_file->f_pos); if (res != sizeof(k_sb->root_nodeid)) { - DEBUG(DBG_PANIC, "Cannot get the node ID\n"); + DEBUG(DBG_ALERT, "Cannot get the node ID\n"); close_phys_file(k_sb->sb_file); goto out_alloc; } /* Check that k_sb->root_nodeid is reasonably bounded */ if (k_sb->root_nodeid < KDFS_MIN_NODEID || k_sb->root_nodeid > KDFS_MAX_NODEID) { - DEBUG (DBG_PANIC, + DEBUG (DBG_ALERT, "Unexpected node ID found in the " "KDFS superfile\nFound %d - expected a number between %d and %d\n", k_sb->root_nodeid, KDFS_MIN_NODEID, KDFS_MAX_NODEID); @@ -206,11 +206,11 @@ int __kdfs_fill_sb(struct kdfs_super_block *k_sb) res = sb_bitmap_load(k_sb->sb_file, k_sb->sb_file->f_pos, k_sb); DEBUG(DBG_INFO, "BMP size: %lu\n\n", k_sb->inode_bitmap->size); if (res == -1) { - DEBUG (DBG_PANIC, "You're using an old version of kDFS superblock file\n"); + DEBUG (DBG_ALERT, "You're using an old version of kDFS superblock file\n"); close_phys_file(k_sb->sb_file); goto out_alloc; } else if (res == -2) { - DEBUG (DBG_PANIC, "Short read - bitmap\n"); + DEBUG (DBG_ALERT, "Short read - bitmap\n"); close_phys_file(k_sb->sb_file); goto out_alloc; } commit 651747c41cda1c7441c8fe6c2170af258eab9149 Author: ad <leb...@fr...> Date: Sat Jan 8 19:26:20 2011 +0000 Fix 1./ kdfs_netinode PRAGMA size 2./ stack warning during import/export functions diff --git a/fs/kdfs/common.h b/fs/kdfs/common.h index 3aa92c5..1761bf9 100644 --- a/fs/kdfs/common.h +++ b/fs/kdfs/common.h @@ -29,14 +29,6 @@ #define KDFS_MAX_NO_NODES ((KDFS_MAX_NODEID) - (KDFS_MIN_NODEID) + 1) -/* 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 */ @@ -69,6 +61,7 @@ struct kdfs_inode { struct list_head extents_list; }; + /* * Network representation of kdfs_inode * exploited during import and export functions @@ -95,7 +88,16 @@ struct kdfs_netinode { /* k_inode flags*/ char flags; +}; + +/* Max number of extent records that fit/be imported/be exported in a kddm object + * if you change the kdfs_netinode or kdfs_file_extent_info + * structures, please update this constant! + */ +#define FILE_EXT_MAX_MEMBERS ((PAGE_SIZE - sizeof(struct kdfs_netinode)-sizeof(size_t))/sizeof(struct kdfs_file_extent_info))-1 +struct kdfs_fullnetinode{ + struct kdfs_netinode info; /* File extents portion */ size_t no_extents; struct kdfs_file_extent_info extents[FILE_EXT_MAX_MEMBERS]; diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index b071718..6440c2f 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -303,7 +303,7 @@ size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) } -void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_netinode *net_inode) +void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_fullnetinode *net_inode) { int list_count = 0; struct kdfs_file_extent *curr; @@ -329,7 +329,7 @@ void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_netinod } -void kdfs_file_extent_net_import(struct kdfs_inode *k_inode, struct kdfs_netinode *net_inode) +void kdfs_file_extent_net_import(struct kdfs_inode *k_inode, struct kdfs_fullnetinode *net_inode) { int index; struct kdfs_file_extent *new_extent, *curr; diff --git a/fs/kdfs/file_extent.h b/fs/kdfs/file_extent.h index c55e5e8..e2f29d1 100644 --- a/fs/kdfs/file_extent.h +++ b/fs/kdfs/file_extent.h @@ -28,8 +28,8 @@ kdfs_node_t kdfs_file_extent_get_page_owner(struct kdfs_inode *k_inode, pgoff_t size_t kdfs_file_extent_dump_to_file(struct kdfs_inode *k_inode, struct file *file); size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode); -void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_netinode *net_inode); -void kdfs_file_extent_net_import(struct kdfs_inode *k_inode, struct kdfs_netinode *net_inode); +void kdfs_file_extent_net_export(struct kdfs_inode *k_inode, struct kdfs_fullnetinode *net_inode); +void kdfs_file_extent_net_import(struct kdfs_inode *k_inode, struct kdfs_fullnetinode *net_inode); #endif /* __KDFS_FILE_EXTENT__ */ diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index dcea0f8..aa90b7d 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -70,48 +70,48 @@ void print_dentry_cont(struct dentry *entry, int print_inode_info) /* */ /*****************************************************************************/ -static inline void kdfs_export_kdfs_inode(struct kdfs_netinode *dest, struct kdfs_inode *src) +static inline void kdfs_export_kdfs_inode(struct kdfs_fullnetinode *dest, struct kdfs_inode *src) { /* export inode informations */ - dest->i_ino = src->inode->i_ino; - dest->i_size = src->inode->i_size; - dest->i_mode = src->inode->i_mode; - dest->i_nlink = src->inode->i_nlink; - dest->i_uid = src->inode->i_uid; - dest->i_gid = src->inode->i_gid; - dest->i_atime = src->inode->i_atime; - dest->i_mtime = src->inode->i_mtime; - dest->i_ctime = src->inode->i_ctime; - dest->i_version = src->inode->i_version; - dest->i_state = src->inode->i_state; - - atomic_set(&dest->cw_count, atomic_read(&src->cw_count)); + dest->info.i_ino = src->inode->i_ino; + dest->info.i_size = src->inode->i_size; + dest->info.i_mode = src->inode->i_mode; + dest->info.i_nlink = src->inode->i_nlink; + dest->info.i_uid = src->inode->i_uid; + dest->info.i_gid = src->inode->i_gid; + dest->info.i_atime = src->inode->i_atime; + dest->info.i_mtime = src->inode->i_mtime; + dest->info.i_ctime = src->inode->i_ctime; + dest->info.i_version = src->inode->i_version; + dest->info.i_state = src->inode->i_state; + + atomic_set(&dest->info.cw_count, atomic_read(&src->cw_count)); /* export miscellaneous */ - dest->content_setid = src->content_setid; - dest->flags = src->flags; + dest->info.content_setid = src->content_setid; + dest->info.flags = src->flags; } -static inline void kdfs_import_kdfs_inode (struct kdfs_inode *dest, struct kdfs_netinode *src) +static inline void kdfs_import_kdfs_inode (struct kdfs_inode *dest, struct kdfs_fullnetinode *src) { /* import inode informations */ - dest->inode->i_ino=src->i_ino; - dest->inode->i_size = src->i_size; - dest->inode->i_mode = src->i_mode; - dest->inode->i_nlink = src->i_nlink; - dest->inode->i_uid = src->i_uid; - dest->inode->i_gid = src->i_gid; - dest->inode->i_atime = src->i_atime; - dest->inode->i_mtime = src->i_mtime; - dest->inode->i_ctime = src->i_ctime; - dest->inode->i_version = src->i_version; - dest->inode->i_state = src->i_state; - - atomic_set(&dest->cw_count, atomic_read(&src->cw_count)); + dest->inode->i_ino=src->info.i_ino; + dest->inode->i_size = src->info.i_size; + dest->inode->i_mode = src->info.i_mode; + dest->inode->i_nlink = src->info.i_nlink; + dest->inode->i_uid = src->info.i_uid; + dest->inode->i_gid = src->info.i_gid; + dest->inode->i_atime = src->info.i_atime; + dest->inode->i_mtime = src->info.i_mtime; + dest->inode->i_ctime = src->info.i_ctime; + dest->inode->i_version = src->info.i_version; + dest->inode->i_state = src->info.i_state; + + atomic_set(&dest->cw_count, atomic_read(&src->info.cw_count)); /*export miscellaneous */ - dest->content_setid = src->content_setid; - dest->flags = src->flags; + dest->content_setid = src->info.content_setid; + dest->flags = src->info.flags; } /* @@ -1117,9 +1117,11 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, } // 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; @@ -1216,19 +1218,21 @@ int kdfs_iol_inode_export_object(struct rpc_desc *desc, int flags) { struct kdfs_inode *src = (struct kdfs_inode *) objEntry->object; - struct kdfs_netinode net_dest; + struct kdfs_fullnetinode *net_dest = kmalloc(sizeof(struct kdfs_fullnetinode), GFP_KERNEL); + int res = 0; PRINT_FUNCTION_NAME; /* export the inode part*/ - kdfs_export_kdfs_inode(&net_dest, src); + kdfs_export_kdfs_inode(net_dest, src); /* export the extents part */ - kdfs_file_extent_net_export(src, &net_dest); + kdfs_file_extent_net_export(src, net_dest); - res = rpc_pack_type(desc, net_dest); + res = rpc_pack_type(desc, *net_dest); + kfree(net_dest); PRINT_FUNCTION_EXIT; return res; } @@ -1248,18 +1252,19 @@ int kdfs_iol_inode_import_object(struct rpc_desc *desc, { int res = 0; struct kdfs_inode *inode_dst = (struct kdfs_inode*) objEntry->object; - struct kdfs_netinode net_src; + struct kdfs_fullnetinode *net_src = kmalloc(sizeof(struct kdfs_fullnetinode), GFP_KERNEL); PRINT_FUNCTION_NAME; - res = rpc_unpack_type(desc, net_src); + res = rpc_unpack_type(desc, *net_src); /* import the inode part*/ - kdfs_import_kdfs_inode(inode_dst, &net_src); + kdfs_import_kdfs_inode(inode_dst, net_src); /* import the extents part */ - kdfs_file_extent_net_import(inode_dst, &net_src); + kdfs_file_extent_net_import(inode_dst, net_src); + kfree(net_src); PRINT_FUNCTION_EXIT; return res; } diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 5021db6..9df0fea 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1923,7 +1923,7 @@ int kdfs_iol_sb_export(struct rpc_desc *desc, struct kdfs_cw_sb *k_cw_sb = NULL; struct kdfs_super_block *k_sb = NULL; struct kdfs_generic_sb *kgsb = NULL; - struct kdfs_netsb net_dest; + struct kdfs_netsb *net_dest = kmalloc(sizeof (struct kdfs_netsb), GFP_KERNEL); int res = 0; PRINT_FUNCTION_NAME; @@ -1937,8 +1937,8 @@ int kdfs_iol_sb_export(struct rpc_desc *desc, if (kgsb->type == KDFS_INFO_TYPE_SB_BMP) { DEBUG(DBG_TRACE, "export cw sb\n"); k_cw_sb = (struct kdfs_cw_sb *) kgsb->real_sb; - __kdfs_export_kdfs_cwsb(&net_dest, k_cw_sb); - res = rpc_pack_type(desc, net_dest); + __kdfs_export_kdfs_cwsb(net_dest, k_cw_sb); + res = rpc_pack_type(desc, *net_dest); } else { k_sb = (struct kdfs_super_block*) kgsb->real_sb; DEBUG(DBG_TRACE, "export sb %d\n", k_sb->sb_nodeid); @@ -1957,10 +1957,11 @@ int kdfs_iol_sb_export(struct rpc_desc *desc, if (__kdfs_local_statfs(k_sb) != 0) DEBUG(DBG_ALERT, "Cannot retrieve the local stat for sb %id\n", k_sb->sb_nodeid); - __kdfs_export_kdfs_sb(&net_dest, k_sb); - res = rpc_pack_type(desc, net_dest); + __kdfs_export_kdfs_sb(net_dest, k_sb); + res = rpc_pack_type(desc, *net_dest); } + kfree(net_dest); PRINT_FUNCTION_EXIT; return res; } @@ -1983,22 +1984,22 @@ int kdfs_iol_sb_import (struct rpc_desc *desc, struct kdfs_generic_sb *kgsb = objEntry->object; struct kdfs_super_block *k_sb; struct kdfs_cw_sb *k_cw_sb; - struct kdfs_netsb net_src; + struct kdfs_netsb *net_src = kmalloc(sizeof (struct kdfs_netsb), GFP_KERNEL); PRINT_FUNCTION_NAME; - res = rpc_unpack_type(desc, net_src); + res = rpc_unpack_type(desc, *net_src); /* * TODO NOW, Adrien / Marko * We should be able to use objid (objEntry->objid ??) */ - if (net_src.info_type == KDFS_INFO_TYPE_SB_BMP) { + if (net_src->info_type == KDFS_INFO_TYPE_SB_BMP) { k_cw_sb = kgsb->real_sb; - __kdfs_import_kdfs_cwsb(k_cw_sb, &net_src); - } else if (net_src.info_type == KDFS_INFO_TYPE_SB) { + __kdfs_import_kdfs_cwsb(k_cw_sb, net_src); + } else if (net_src->info_type == KDFS_INFO_TYPE_SB) { k_sb = kgsb->real_sb; - __kdfs_import_kdfs_sb(k_sb, &net_src); + __kdfs_import_kdfs_sb(k_sb, net_src); /* Set to NULL all irrelevant pointer references */ /* @@ -2022,6 +2023,7 @@ int kdfs_iol_sb_import (struct rpc_desc *desc, } else DEBUG(DBG_PANIC, "Unknown object imported!\n"); + kfree(net_src); PRINT_FUNCTION_EXIT; return 0; } commit 5beec156ca83753b3f8d21dd882ae051db48859c Author: ad <leb...@fr...> Date: Sat Jan 8 17:24:02 2011 +0000 Fix a silly error for debugging traces diff --git a/fs/kdfs/TODO b/fs/kdfs/TODO index 7c69c75..579c18f 100644 --- a/fs/kdfs/TODO +++ b/fs/kdfs/TODO @@ -38,6 +38,8 @@ Prio. added added Type What 2 adrien 100717 Bugfix check why we locally destroy the content kddm set the inode is dropped by the VFS (cfs. super.c kdfs_drop_inode) 2 adrien 100819 ls -al upon a directory returns a wrong size (should be 4096, however the realsize of the directory is returned) +2 adrien 100819 ls -al upon a directory returns a wrong size (should be 4096, however the realsize of the directory is returned) +2 adrien 110106 Study directories/files deletions (why it is so long, some sets seem to be created why ? At the first sight, it should be avoided) DONE ~~~~ diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 1848729..dcea0f8 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1179,9 +1179,8 @@ int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry, break; default: DEBUG(DBG_PANIC, - "Cannot set kdfs inode operations %o (ino %lu)\n", - k_inode->inode->i_mode & S_IFMT, k_inode->inode->i_ino); - DEBUG(DBG_PANIC, "filename %s\n", + "Cannot set kdfs inode operations %o (ino %lu, filename %s)\n", + k_inode->inode->i_mode & S_IFMT, k_inode->inode->i_ino, list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name); break; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/TODO | 2 + fs/kdfs/common.h | 18 +++++---- fs/kdfs/file_extent.c | 4 +- fs/kdfs/file_extent.h | 4 +- fs/kdfs/inode.c | 92 +++++++++++++++++++++++++----------------------- fs/kdfs/super.c | 34 +++++++++-------- 6 files changed, 82 insertions(+), 72 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2011-01-06 14:13:18
|
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 50baf57cb516e181ece3f3fb61d1dc9953b05fcb (commit) from a9396af95b248bccbcdc80c9ddb15de60478432d (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 50baf57cb516e181ece3f3fb61d1dc9953b05fcb Author: ad <leb...@fr...> Date: Thu Jan 6 08:25:34 2011 +0000 Fix wrong usage of inode->i_inode during inode deletion - Adrien diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 028be2d..5021db6 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1170,7 +1170,7 @@ void kdfs_drop_inode(struct inode *inode) k_sb = kdfs_getsb(kerrighed_node_id); /* Close the physical file before it is removed in kdfs_remove_local_ino */ /* TODO PRIORITY 1: if the file is deleted on another node that the one where it has been created, we do not remove the local_ino from the bitmap */ - kdfs_remove_local_ino(k_sb, inode->i_ino); + kdfs_remove_local_ino(k_sb, ino); __kdfs_putsb(k_sb); } } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/super.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- kdfs |
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 |
From: alebre <al...@us...> - 2010-12-23 15:13:05
|
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 98833b0b5cbed6daebe10dc95fec43b7e02216e1 (commit) via 2ce817f4d32527927caf84e043349ff34d0c61a0 (commit) from e022fc85cfe0f7df2194c7591e7fbd5e2ff624e2 (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 98833b0b5cbed6daebe10dc95fec43b7e02216e1 Merge: 2ce817f e022fc8 Author: ad <leb...@fr...> Date: Thu Dec 23 09:34:48 2010 +0000 Fix Conflict with last pull diff --cc fs/kdfs/address_space.c index c4c3b71,33bd7f9..4a90d2d --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@@ -615,17 -618,21 +615,11 @@@ int kdfs_iol_page_first_touch(kddm_obj_ } else k_page->flags = K_PG_ok; + page_addr = (char *) kmap(k_page->page); + pos = (loff_t)pageid * PAGE_SIZE; + - - /* The page should be filled only if it was not handled - * by another node before (i.e if the page is already in - * the cache, it means that the page has been inserted - * throught another kddm object call) - */ + iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); + kunmap(k_page->page); objEntry->object = (void *) k_page; diff --cc fs/kdfs/inode.c index ca2405a,53bde96..c89111e --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@@ -1109,8 -1109,9 +1109,8 @@@ int kdfs_iol_inode_first_touch(kddm_obj 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 %ld\n", objid); + DEBUG(DBG_PANIC, "Cannot find inode %lu\n", objid); k_inode->inode->i_ino = objid; - // insert_inode_hash(k_inode->inode); } // Case 2: the inode already exists, so fill it from the HDD else { diff --cc fs/kdfs/super.c index fd268c3,b52cc3d..c3e877f --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@@ -1183,13 -1160,38 +1183,12 @@@ void kdfs_drop_inode(struct inode *inod PRINT_FUNCTION_EXIT; } -/* - * WARNINGS: - * Currently, there is a STRONG issue: kdfs_idelete is call whatever the i_count value - * on other nodes. - * The basic idea consists in adding some check in order to know if we are the last node - * handling the object or not. - */ -void kdfs_delete_inode(struct inode *inode) +// Warning the k_inode should be locked (get/grab) +void destroy_content_kddmset(struct kdfs_inode *k_inode) { - /* - * If we are there, that's mean inode->i_nlink and inode->i_count - * have reached 0. So for this node, the inode is not more used. - * We have to take into account, potential access to this inode - * from remote nodes. - * In other words, only the last node which is using this inode, has - * to delete it. - */ - struct kdfs_inode *k_inode = NULL; - struct kdfs_super_block *k_sb = NULL; - - DEBUG(DBG_INFO, "Delete Inode %lu\n", inode->i_ino); - - k_sb = kdfs_getsb(kerrighed_node_id); + DEBUG(DBG_INFO, "Destroy the contentset associated to inode %ld\n", k_inode->inode->i_ino); - /* Get the inode and delete its associated content set and its entry in INODE KDDM Set */ - k_inode = kdfs_iget(inode->i_ino); - - // TODO check whether this is previously called by the vfs layer ? - truncate_inode_pages(&inode->i_data, 0); - - if (k_inode->content_setid != KDDM_SET_UNUSED) { - DEBUG(DBG_INFO, "kdfs gonna uninstantiate the set"); // WARNING, the set should exist somewhere in the cluster // Otherwise, we do not know what can happen from the kddm layer viewpoint // cf. kddm_set.h - Adrien December 2010 commit 2ce817f4d32527927caf84e043349ff34d0c61a0 Author: ad <leb...@fr...> Date: Thu Dec 23 09:29:57 2010 +0000 Fix kddm set destruction when inode is drop from the cache. Fix inode synchronization (my previous commit removed the synchronization of the inode each time (before the inode synchronization was performed at each page modification, now it is based on write operation (maybe too dangerous) diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 0b10c46..c4c3b71 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -611,27 +611,20 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { k_page->page = find_or_create_page(k_mapping, pageid, (mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); - //k_page->page = alloc_page(mapping_gfp_mask(k_mapping)|__GFP_ZERO) & ~__GFP_FS); - //lock_page(k_page->page); - k_page->flags = K_PG_locked; + } else + k_page->flags = K_PG_ok; - page_addr = (char *) kmap(k_page->page); - pos = (loff_t)pageid * PAGE_SIZE; + page_addr = (char *) kmap(k_page->page); + pos = (loff_t)pageid * PAGE_SIZE; - 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 - * by another node before (i.e if the page is already in - * the cache, it means that the page has been inserted - * throught another kddm object call) - */ - iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); - } else - k_page->flags = K_PG_ok; + /* The page should be filled only if it was not handled + * by another node before (i.e if the page is already in + * the cache, it means that the page has been inserted + * throught another kddm object call) + */ + iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); kunmap(k_page->page); objEntry->object = (void *) k_page; diff --git a/fs/kdfs/address_space.h b/fs/kdfs/address_space.h index 7fd9901..ab11551 100644 --- a/fs/kdfs/address_space.h +++ b/fs/kdfs/address_space.h @@ -154,6 +154,7 @@ kddm_set_t *__create_content_kddm_set(kddm_set_id_t set_id, int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int master); void kdfs_iol_content_uninstantiate(kddm_set_t *kddm_set, int destroy); +void destroy_content_kddmset(struct kdfs_inode *k_inode); /*--------------------------------------------------------------------------* * * * EXTERN VARIABLES * diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 74fd1a1..f7e02b6 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -100,6 +100,8 @@ ssize_t kdfs_write(struct file *filp, const char *buf, size_t count, loff_t *ppo /* Call generic_file_aio_write */ r = do_sync_write(filp, buf, count, ppos); + // WARNING, synchronizing inode right now can be dangerous + kdfs_mark_inode_dirty(kdfs_inode); kdfs_iput(filp->f_dentry->d_inode->i_ino); DEBUG(DBG_INFO, diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 5ebc699..ca2405a 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -1111,7 +1111,6 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, if (k_inode->inode == NULL) DEBUG(DBG_PANIC, "Cannot find inode %ld\n", objid); k_inode->inode->i_ino = objid; - // insert_inode_hash(k_inode->inode); } // Case 2: the inode already exists, so fill it from the HDD else { @@ -1336,9 +1335,31 @@ int kdfs_iol_inode_sync_object(kddm_obj_t *objEntry, int kdfs_iol_inode_remove_object(void *object, kddm_set_t *set, objid_t objid) { struct kdfs_inode *k_inode = (struct kdfs_inode *)object; + struct dentry *dentry, *dchild; + + PRINT_FUNCTION_NAME ; + /* Invalidate local dentries */ + /* We could have several dentries for a same inode due to the hardlink */ + list_for_each_entry(dentry, &k_inode->inode->i_dentry, d_alias) { + if ((k_inode->inode->i_mode & S_IFMT) == S_IFDIR) { + /* + * Invalidate negative child dentries for a directory, because of the following problem: + * Node B has a negative dentry for file /foo, + * Node A creates /foo (so invalidates inode /) + * the negative dentry on node B should be invalidated. + */ + list_for_each_entry(dchild, &dentry->d_subdirs, d_u.d_child) + if (!dchild->d_inode) + d_drop(dchild); /* Should we revalidate instead? */ + } + DEBUG(DBG_INFO, "drop dentry\n"); + d_drop(dentry); + } + // Free memory previously allocated. kdfs_file_extent_free(k_inode); kfree(k_inode); + PRINT_FUNCTION_EXIT; return 0; } diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 66ba12d..fd268c3 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1140,82 +1140,62 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) void kdfs_drop_inode(struct inode *inode) { long ino = inode->i_ino; - DEBUG(DBG_INFO, "inode id %ld\n", ino); + struct kdfs_inode *k_inode; + struct kdfs_super_block *k_sb; + + DEBUG(DBG_INFO, "Drop inode id %ld\n", ino); + k_inode = kdfs_iget(ino); if (inode->i_nlink) { - /* Generic forget is unfortunately not exported unfortunately */ + /* Generic forget is unfortunately not exported */ /* so we have to call generic_drop_inode */ generic_drop_inode(inode); - - // We should not remove a kDDM set locally (it can break for instance the chain owner) - // You should flush all objects and wait to remove the remaining data when someone - // is going to call kdddm_remove - // The flush of all objects is done through the truncate_inode_pages called by generic_drop_inode - + // TODO PRIORITY 2: Please note, destroying the kddm set is not effficient clusterwide + // However, there is no way to locallly flush a set since it can break the probably owner chain + destroy_content_kddmset(k_inode); + kdfs_iput(ino); kdfs_idrop(ino); - } else - generic_delete_inode(inode); + } else{ + /* + * WARNINGS: + * Currently, there is a STRONG issue: kdfs_idelete is call whatever the i_count value + * on other nodes. + * The basic idea consists in adding some check in order to know if we are the last node + * handling the object or not. + */ + generic_delete_inode(inode); + /* Cleanly remove inode from kddm inode set */ + destroy_content_kddmset(k_inode); + kdfs_idelete(ino); // equivalent to kdfs_iput() and remove + + DEBUG(DBG_INFO, "Freeing i_ino %ld from the bitmap\n", inode->i_ino); + + if (inode_linked_node(ino) == kerrighed_node_id) { + k_sb = kdfs_getsb(kerrighed_node_id); + /* Close the physical file before it is removed in kdfs_remove_local_ino */ + /* TODO PRIORITY 1: if the file is deleted on another node that the one where it has been created, we do not remove the local_ino from the bitmap */ + kdfs_remove_local_ino(k_sb, inode->i_ino); + __kdfs_putsb(k_sb); + } + } PRINT_FUNCTION_EXIT; } -/* - * WARNINGS: - * Currently, there is a STRONG issue: kdfs_idelete is call whatever the i_count value - * on other nodes. - * The basic idea consists in adding some check in order to know if we are the last node - * handling the object or not. - */ -void kdfs_delete_inode(struct inode *inode) +// Warning the k_inode should be locked (get/grab) +void destroy_content_kddmset(struct kdfs_inode *k_inode) { - /* - * If we are there, that's mean inode->i_nlink and inode->i_count - * have reached 0. So for this node, the inode is not more used. - * We have to take into account, potential access to this inode - * from remote nodes. - * In other words, only the last node which is using this inode, has - * to delete it. - */ - struct kdfs_inode *k_inode = NULL; - struct kdfs_super_block *k_sb = NULL; - - DEBUG(DBG_INFO, "Delete Inode %ld\n", inode->i_ino); + DEBUG(DBG_INFO, "Destroy the contentset associated to inode %ld\n", k_inode->inode->i_ino); - k_sb = kdfs_getsb(kerrighed_node_id); /* Get the inode and delete its associated content set and its entry in INODE KDDM Set */ - k_inode = kdfs_iget(inode->i_ino); - - // TODO check whether this is previously called by the vfs layer ? - truncate_inode_pages(&inode->i_data, 0); - - if (k_inode->content_setid != KDDM_SET_UNUSED) { - DEBUG(DBG_INFO, "kdfs gonna uninstantiate the set"); // WARNING, the set should exist somewhere in the cluster // Otherwise, we do not know what can happen from the kddm layer viewpoint // cf. kddm_set.h - Adrien December 2010 __destroy_kddm_set(kddm_def_ns, k_inode->content_setid); k_inode->content_setid = KDDM_SET_UNUSED; } - -DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete\n"); - - /* Cleanly remove inode from kddm inode set */ - kdfs_idelete(inode->i_ino); // equivalent to kdfs_iput() and remove - - DEBUG(DBG_INFO, "Freeing i_ino %ld from the bitmap\n", inode->i_ino); - - if (inode_linked_node(inode->i_ino) == kerrighed_node_id) { - /* Close the physical file before it is removed in kdfs_remove_local_ino */ - /* TODO PRIORITY 1: if the file is deleted on another node that the one where it has been created, we do not remove the local_ino from the bitmap */ - kdfs_remove_local_ino(k_sb, inode->i_ino); - } - - clear_inode(inode); - // destroy inode is done in generic_delete_inode - - __kdfs_putsb(k_sb); PRINT_FUNCTION_EXIT; } @@ -1323,7 +1303,6 @@ out: } static struct super_operations kdfs_sops = { - .delete_inode = kdfs_delete_inode, .drop_inode = kdfs_drop_inode, .show_options = kdfs_show_options, .statfs = kdfs_statfs, diff --git a/fs/namei.c b/fs/namei.c index 60835a8..bcdfa4d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2209,6 +2209,7 @@ static long do_rmdir(int dfd, const char __user *pathname) nd.flags &= ~LOOKUP_PARENT; mutex_lock_nested(&nd.path.dentry->d_inode->i_mutex, I_MUTEX_PARENT); + dentry = lookup_hash(&nd); error = PTR_ERR(dentry); if (IS_ERR(dentry)) ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 23 ++--------- fs/kdfs/address_space.h | 1 + fs/kdfs/file.c | 2 + fs/kdfs/inode.c | 23 +++++++++++- fs/kdfs/super.c | 94 ++++++++++++++++++----------------------------- fs/namei.c | 1 + 6 files changed, 67 insertions(+), 77 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-12-21 20:28:24
|
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 e022fc85cfe0f7df2194c7591e7fbd5e2ff624e2 (commit) from e14c559171de11d5ac30d0bc2e92592d88e06ee6 (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 e022fc85cfe0f7df2194c7591e7fbd5e2ff624e2 Author: Marko Obrovac <mar...@in...> Date: Tue Dec 21 22:27:09 2010 +0100 [CLEAN] replace %ld with %lu where appropriate (in DEBUG outputs) diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 0b10c46..33bd7f9 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -128,7 +128,7 @@ int __kdfs_prepare_write (struct file *file, struct page *page, struct kdfs_page *k_page = NULL; struct kdfs_inode *k_inode = NULL; - DEBUG (DBG_INFO, "prepare_write for file %s (ino %ld), page %ld from %d to %d (count = %d, mapping = %p)\n", + DEBUG (DBG_INFO, "prepare_write for file %s (ino %lu), page %lu from %d to %d (count = %d, mapping = %p)\n", file->f_dentry->d_name.name, file->f_dentry->d_inode->i_ino, page->index, offset, _to, page_count(page), page->mapping); BUG_ON (page->mapping == NULL); @@ -185,7 +185,7 @@ int __kdfs_commit_write(struct file *file, { struct kdfs_inode *k_inode = NULL; - DEBUG(DBG_INFO, "commit_write for page %ld for file %s" + DEBUG(DBG_INFO, "commit_write for page %lu for file %s" "(ino %lu) (from %u to %u) (count = %d)\n", page->index, file->f_dentry->d_name.name, file->f_dentry->d_inode->i_ino, offset, _to, @@ -269,7 +269,7 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) /* The whole page is invalidated so it should be removed */ /* TODO Should we really remove the page from the physical storage */ /* Currently only the inode is updated, it seems to be sufficient */ - DEBUG(DBG_INFO, "Gonna invalidate page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); + DEBUG(DBG_INFO, "Gonna invalidate page %lu (objid %lu from set %lu)\n", page->index, k_page->obj_id,k_page->set_id); if(kddm_flush_object(kddm_def_ns, k_page->set_id, k_page->obj_id, KERRIGHED_NODE_ID_NONE) == -ENOSPC) /* There is only one copy, so we should exploit remove instead of flush */ kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); @@ -293,7 +293,7 @@ int kdfs_releasepage(struct page *page, gfp_t mask) ASSERT (page->mapping != NULL); k_page = (struct kdfs_page *) page->private; - DEBUG(DBG_INFO, "Gonna release page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); + DEBUG(DBG_INFO, "Gonna release page %lu (objid %lu from set %lu)\n", page->index, k_page->obj_id,k_page->set_id); if(kddm_flush_object(kddm_def_ns, k_page->set_id, k_page->obj_id, KERRIGHED_NODE_ID_NONE) == -ENOSPC) /* There is only one copy, so we should exploit remove instead of flush */ kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); @@ -336,7 +336,7 @@ struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id objid = pageindex_to_contentobjid(masternode, page_id); - DEBUG(DBG_INFO, "Get page %ld (masternode %d, objid %ld from set %ld)\n", page_id, masternode, objid, k_inode->content_setid); + DEBUG(DBG_INFO, "Get page %lu (masternode %d, objid %lu from set %lu)\n", page_id, masternode, objid, k_inode->content_setid); BUG_ON(objid == -1); k_page =kdfs_get_page(k_inode->content_setid,objid); @@ -345,7 +345,7 @@ struct kdfs_page *kdfs_get_distpage(struct kdfs_inode *k_inode, pgoff_t page_id struct kdfs_page *kdfs_get_page(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Get object %ld from set %ld\n", obj_id, set_id); + DEBUG(DBG_INFO, "Get object %lu from set %lu\n", obj_id, set_id); return kddm_get_object(kddm_def_ns, set_id, obj_id); } @@ -366,7 +366,7 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id } else if (masternode != kerrighed_node_id) { // the page already exists but teh grab is done remotely to the masternode, so : grab the previous object and reassign this page to the current node objid = pageindex_to_contentobjid(masternode, page_id); - DEBUG(DBG_INFO, "Gonna grab prevpage %ld from set %ld (objid = %ld)\n", page_id, k_inode->content_setid, objid); + DEBUG(DBG_INFO, "Gonna grab prevpage %lu from set %lu (objid = %lu)\n", page_id, k_inode->content_setid, objid); k_prevpage=kdfs_grab_page(k_inode->content_setid, objid); /* set the page's owner to this node */ @@ -376,7 +376,7 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id } objid = pageindex_to_contentobjid(masternode, page_id); - DEBUG(DBG_INFO, "Gonna grab page %ld from set %ld (objid = %ld)\n", page_id, k_inode->content_setid, objid); + DEBUG(DBG_INFO, "Gonna grab page %lu from set %lu (objid = %lu)\n", page_id, k_inode->content_setid, objid); k_newpage=kdfs_grab_page(k_inode->content_setid, objid); if(k_prevpage){ @@ -393,14 +393,14 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id struct kdfs_page *kdfs_grab_page(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Grab object %ld from set %ld\n", obj_id, set_id); + DEBUG(DBG_INFO, "Grab object %lu from set %lu\n", obj_id, set_id); return kddm_grab_object(kddm_def_ns, set_id, obj_id); } struct kdfs_page *kdfs_findlocal_page(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Grab object %ld from set %ld\n", obj_id, set_id); + DEBUG(DBG_INFO, "Grab object %lu from set %lu\n", obj_id, set_id); return kddm_find_object(kddm_def_ns, set_id, obj_id); } @@ -411,12 +411,12 @@ void __kdfs_put_page(kddm_set_id_t set_id, objid_t obj_id) void _kdfs_put_page(struct kdfs_page *k_page) { - DEBUG(DBG_INFO, "Put object %ld from set %ld\n", k_page->obj_id, k_page->set_id); + DEBUG(DBG_INFO, "Put object %lu from set %lu\n", k_page->obj_id, k_page->set_id); kddm_put_object(kddm_def_ns, k_page->set_id, k_page->obj_id); } void kdfs_distmark_page_dirty(struct kdfs_inode *k_inode, pgoff_t page_id){ - DEBUG(DBG_INFO, "Gonna sync page %ld from set %ld\n", page_id, k_inode->content_setid); + DEBUG(DBG_INFO, "Gonna sync page %lu from set %lu\n", page_id, k_inode->content_setid); kdfs_mark_page_dirty(k_inode->content_setid, pageindex_to_contentobjid( kdfs_file_extent_get_page_owner(k_inode, page_id),page_id)); @@ -424,7 +424,7 @@ void kdfs_distmark_page_dirty(struct kdfs_inode *k_inode, pgoff_t page_id){ void kdfs_mark_page_dirty(kddm_set_id_t set_id, objid_t obj_id) { - DEBUG(DBG_INFO, "Sync object %ld from set %lu\n", obj_id, set_id); + DEBUG(DBG_INFO, "Sync object %lu from set %lu\n", obj_id, set_id); kddm_sync_frozen_object(kddm_def_ns, set_id, obj_id); } @@ -466,7 +466,7 @@ kddm_set_t *__create_content_kddm_set(kddm_set_id_t set_id, content_data, sizeof(struct content_iolinker_data), KDDM_FT_LINKED); if (IS_ERR(kddm_set)) - DEBUG(DBG_PANIC, "Can't create content kddm_set for inode %ld\n", k_inode->inode->i_ino); + DEBUG(DBG_PANIC, "Can't create content kddm_set for inode %lu\n", k_inode->inode->i_ino); /* We can free all the memory allocated */ kfree(content_data); @@ -532,19 +532,19 @@ int kdfs_iol_page_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) pageid = contentobjid_to_pageindex(objid); - DEBUG(DBG_INFO, "Before Alloc objid %ld from set %lu (page id %ld)\n", objid, set->id, pageid); + DEBUG(DBG_INFO, "Before Alloc objid %lu from set %lu (page id %lu)\n", objid, set->id, pageid); /* The page can be already in the cache, especially when we dynamically change the default owner */ k_page->page = find_get_page(k_mapping, pageid); if (!k_page->page) { DEBUG(DBG_ALERT, - "Can't find page for file/directory = %ld and page id = %ld @mapping = %p, So created and locked\n", + "Can't find page for file/directory = %lu and page id = %lu @mapping = %p, So created and locked\n", k_mapping->host->i_ino, objid,k_mapping); k_page->page = find_or_create_page(k_mapping, pageid, mapping_gfp_mask(k_mapping) & ~__GFP_FS); k_page->flags = K_PG_locked; } else k_page->flags = K_PG_ok; - DEBUG(DBG_INFO, "After Alloc new page %ld from set %lu (page addr=%p count=%d)\n", objid, set->id, k_page->page, page_count(k_page->page)); + DEBUG(DBG_INFO, "After Alloc new page %lu from set %lu (page addr=%p count=%d)\n", objid, set->id, k_page->page, page_count(k_page->page)); k_page->set_id = set->id; k_page->obj_id = objid; @@ -590,7 +590,7 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, /* What do you mean : locking the physical file, what kddm object ? the inode one ? */ k_mapping = ((struct content_iolinker_data *) set->private_data)->k_mapping; BUG_ON(k_mapping == NULL); - DEBUG(DBG_TRACE, "file/directory = %ld, pageid = %ld, objid = %ld, @mapping = %p\n", iolinker_data->ino,pageid, objid, k_mapping); + DEBUG(DBG_TRACE, "file/directory = %lu, pageid = %lu, objid = %lu, @mapping = %p\n", iolinker_data->ino,pageid, objid, k_mapping); /* First_Touch has to be called only on the node currently in charge */ /* of the page. */ @@ -619,8 +619,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, "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, + DEBUG(DBG_TRACE, "The page for file/directory = %lu and " \ + "page id = %lu 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 @@ -636,7 +636,7 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, kunmap(k_page->page); objEntry->object = (void *) k_page; - DEBUG(DBG_INFO, "After first touch, page %ld from set %lu (page addr=%p count=%d)\n", objid, set->id, k_page->page, page_count(k_page->page)); + DEBUG(DBG_INFO, "After first touch, page %lu from set %lu (page addr=%p count=%d)\n", objid, set->id, k_page->page, page_count(k_page->page)); // Note: the page has not been release, this action should be perform // in the insert or export function according the kddm operation (get or grab) PRINT_FUNCTION_EXIT; @@ -706,7 +706,7 @@ int kdfs_iol_page_export (struct rpc_desc *desc, PRINT_FUNCTION_NAME; - DEBUG(DBG_INFO, "Gonna export objid %ld from set %ld with state\n", objid,k_page->set_id); + DEBUG(DBG_INFO, "Gonna export objid %lu from set %lu with state\n", objid,k_page->set_id); res = rpc_pack(desc, 0, &k_page->flags, sizeof(k_page->flags)); if (res < 0) DEBUG(DBG_ALERT, "can't pack export page state (res=%d)\n", res); @@ -775,7 +775,7 @@ int kdfs_iol_page_invalidate(kddm_obj_t *objEntry, kddm_set_t *set, */ BUG_ON(contentobjid_to_pageindex(objid)!=k_page->page->index); - DEBUG(DBG_INFO, "Try to invalidate objid %ld (page id %ld page addr %p) of set %lu\n", objid, k_page->page->index, k_page->page, set->id); + DEBUG(DBG_INFO, "Try to invalidate objid %lu (page id %lu page addr %p) of set %lu\n", objid, k_page->page->index, k_page->page, set->id); trylock_page(k_page->page); remove_from_page_cache(k_page->page); @@ -818,7 +818,7 @@ int kdfs_iol_page_import(struct rpc_desc *desc, res = rpc_unpack(desc, 0,&k_page->flags, sizeof(k_page->flags)); - DEBUG(DBG_INFO, "Gonna import objid %ld from set %ld with state\n", objid,k_page->set_id); + DEBUG(DBG_INFO, "Gonna import objid %lu from set %lu with state\n", objid,k_page->set_id); if(!res && k_page->flags!=K_PG_invalid){ // We should not import a page which is not consistent with // the implicit striping mechanim. @@ -855,7 +855,7 @@ int kdfs_iol_page_sync(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) ASSERT(k_page != NULL); ASSERT(k_page->page != NULL); - DEBUG(DBG_INFO, "Try to sync page %ld (page addr %p) of set %lu\n", objid, k_page->page, set->id); + DEBUG(DBG_INFO, "Try to sync page %lu (page addr %p) of set %lu\n", objid, k_page->page, set->id); file_pos = ((loff_t)contentobjid_to_pageindex(objid) * PAGE_SIZE) + k_page->offset; page_addr = (char *) kmap(k_page->page); @@ -906,7 +906,7 @@ int kdfs_iol_page_remove(void *object, struct kddm_set *set, objid_t objid) struct kdfs_page *k_page = (struct kdfs_page *) object; PRINT_FUNCTION_NAME; - DEBUG(DBG_INFO, "Gonna remove objid %ld from set %ld\n", k_page->obj_id,k_page->set_id); + DEBUG(DBG_INFO, "Gonna remove objid %lu from set %lu\n", k_page->obj_id,k_page->set_id); if ((!PageLocked(k_page->page))) { /* * This is not the kernel trying to remove the page but the KDDMs, @@ -959,7 +959,7 @@ int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int m ASSERT(kddm_set->private_data != NULL); content_data = (struct content_iolinker_data *) kddm_set->private_data; - DEBUG(DBG_INFO, "Instantiate kddm %ld with ino : %ld\n", kddm_set->id, content_data->ino); + DEBUG(DBG_INFO, "Instantiate kddm %lu with ino : %lu\n", kddm_set->id, content_data->ino); if (kddm_set->def_owner == kerrighed_node_id || kddm_set->def_owner == KDDM_CUSTOM_DEF_OWNER) { content_data->phys_dirname = kmalloc(PATH_MAX, GFP_KERNEL); @@ -1039,10 +1039,10 @@ void kdfs_iol_content_uninstantiate(kddm_set_t *kddm_set, int destroy) ASSERT(kddm_set->private_data != NULL); content_data = (struct content_iolinker_data *) kddm_set->private_data; - DEBUG (DBG_INFO, "uninstantiate content kddm_set link to inode %ld (pid: %d, %s, %d)\n", content_data->ino, current->pid, current->comm, task_pid_knr(current) ); + DEBUG (DBG_INFO, "uninstantiate content kddm_set link to inode %lu (pid: %d, %s, %d)\n", content_data->ino, current->pid, current->comm, task_pid_knr(current) ); if (content_data->phys_dirname != NULL) { - DEBUG (DBG_TRACE, "uninstantiate content kddm_set link to inode %ld (physical file:%s)", + DEBUG (DBG_TRACE, "uninstantiate content kddm_set link to inode %lu (physical file:%s)", content_data->ino,content_data->phys_dirname); kfree(content_data->phys_dirname); } diff --git a/fs/kdfs/dir.c b/fs/kdfs/dir.c index daef9c7..022d60d 100644 --- a/fs/kdfs/dir.c +++ b/fs/kdfs/dir.c @@ -61,7 +61,7 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file void *page_addr = NULL ; DEBUG (DBG_INFO, - "Look up for entry %s in directory %ld\n", + "Look up for entry %s in directory %lu\n", filename, dir->inode->i_ino); npages = (dir->inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; @@ -82,7 +82,7 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file *k_page = kdfs_grab_distpage(dir, pageid); if (IS_ERR(*k_page)) DEBUG (DBG_PANIC, - "Can't grab page %ld for the directory %ld", + "Can't grab page %lu for the directory %lu", pageid, dir->content_setid); tmp_page = (*k_page)->page; @@ -92,15 +92,15 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file /* For each entry contained in the page */ do { DEBUG (DBG_INFO, - "Grab page %ld:" - "page addr (mapped %p, unmapped %p), dentry_addr %p (file size %lld)\n", + "Grab page %lu:" + "page addr (mapped %p, unmapped %p), dentry_addr %p (file size %llu)\n", pageid, page_addr, tmp_page, dentry_addr, dir->inode->i_size); /* Get the directory entry */ dir_entry = (struct kdfs_dir_entry *) dentry_addr; /* Did we find the right entry */ - DEBUG (DBG_INFO, "filelen %d dirfilelen %d, filename %s dirname %s, dirlen %d (dirino %ld)\n", + DEBUG (DBG_INFO, "filelen %d dirfilelen %d, filename %s dirname %s, dirlen %d (dirino %lu)\n", filename_len, dir_entry->name_len, filename, dir_entry->name,dir_entry->rec_len, dir_entry->ino); if (dir_entry->name_len == filename_len && strncmp (dir_entry->name, filename, filename_len) == 0) @@ -124,7 +124,7 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file } // end if there are some entries - DEBUG (DBG_INFO, "Look up for file %s in directory %ld : notfound \n", + DEBUG (DBG_INFO, "Look up for file %s in directory %lu : notfound \n", filename, dir->inode->i_ino); // TODO PRIORITY 1: put_kddm_set required a reference on the set. // I have to add a reference inside kdfs_page structure :( @@ -133,7 +133,7 @@ struct kdfs_dir_entry *kdfs_grab_entry (struct kdfs_inode *dir, const char *file found: DEBUG (DBG_INFO, - "Look up for file %s in directory %ld: found : %p\n", + "Look up for file %s in directory %lu: found : %p\n", filename, dir->inode->i_ino, dir_entry); return dir_entry; } @@ -165,7 +165,7 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, void *page_addr = NULL; DEBUG(DBG_INFO, - "Look up for entry %s in directory %ld\n", + "Look up for entry %s in directory %lu\n", filename, dir->inode->i_ino); npages = (dir->inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; @@ -187,7 +187,7 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, *k_page = kdfs_get_distpage(dir,pageid); if (IS_ERR(*k_page)) DEBUG(DBG_PANIC, - "Can't get page %ld for the directory %ld\n", + "Can't get page %lu for the directory %lu\n", pageid, dir->content_setid); tmp_page = (*k_page)->page; @@ -197,14 +197,14 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, /* For each entry contained in the page */ do { DEBUG(DBG_INFO, - "page addr %p, dentry_addr %p (file size %lld)\n", + "page addr %p, dentry_addr %p (file size %llu)\n", page_addr, dentry_addr, dir->inode->i_size); /* Get the directory entry */ dir_entry = (struct kdfs_dir_entry *) dentry_addr; /* Did we find the right entry */ DEBUG(DBG_INFO, - "file:%s (filename_len %d), dir:%s (dirfilename_len %d), dirlen %d (dirino %ld)\n", + "file:%s (filename_len %d), dir:%s (dirfilename_len %d), dirlen %d (dirino %lu)\n", filename, filename_len, dir_entry->name, dir_entry->name_len, dir_entry->rec_len, dir_entry->ino); if (dir_entry->name_len == filename_len && strncmp (dir_entry->name, filename, filename_len) == 0) @@ -229,7 +229,7 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, } // end if there are some entries DEBUG(DBG_INFO, - "Look up for file %s in directory %ld : notfound\n", + "Look up for file %s in directory %lu : notfound\n", filename, dir->inode->i_ino); // TODO PRIORITY 1: put_kddm_set required a reference on the set. // I have to add a reference inside kdfs_page structure :( @@ -238,7 +238,7 @@ struct kdfs_dir_entry *kdfs_find_entry(struct kdfs_inode *dir, found: DEBUG(DBG_INFO, - "Look up for file %s in directory %ld: found : %p\n", + "Look up for file %s in directory %lu: found : %p\n", filename, dir->inode->i_ino, dir_entry); return dir_entry; } @@ -272,7 +272,7 @@ ino_t kdfs_inode_by_name(struct kdfs_inode *dir, struct dentry *dentry) dir_entry = kdfs_find_entry(dir, dentry->d_name.name, &k_page); if (dir_entry) { res = le32_to_cpu(dir_entry->ino); - DEBUG(DBG_INFO, "ino : %ld \n", res); + DEBUG(DBG_INFO, "ino : %lu \n", res); _kdfs_put_page(k_page); // TODO PRIORITY 1: put_kddm_set required a reference on the set. // I have to add a reference inside kdfs_page structure :( @@ -378,7 +378,7 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, ASSERT(kdfs_pdir != NULL); DEBUG(DBG_INFO, - "Adding file %s to directory (inode %ld) with mode %o\n", filename, + "Adding file %s to directory (inode %lu) with mode %o\n", filename, kdfs_pdir->inode->i_ino, mode); /* TODO PRIORITY 2: should be useless since kdfs_pdir is logically already grabbed but requires a confirmation */ @@ -408,7 +408,7 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, kdfs_page = kdfs_grab_distpage(kdfs_pdir, pageid); ASSERT(kdfs_page != NULL); - DEBUG(DBG_INFO, "Page Grabbed, gonna add an entry at pageid %ld offset %ld\n", pageid, offset); + DEBUG(DBG_INFO, "Page Grabbed, gonna add an entry at pageid %lu offset %lu\n", pageid, offset); /* Fill the new directory entry */ page_addr = kmap (kdfs_page->page); @@ -423,7 +423,7 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, dir_entry->rec_len = __cpu_to_le16(KDFS_DIRENT_SIZE); DEBUG(DBG_INFO, - "Size of direntry %d size of filename %d inode %ld\n", + "Size of direntry %d size of filename %d inode %lu\n", dir_entry->rec_len, dir_entry->name_len, dir_entry->ino); dir_entry->mode = mode; @@ -451,7 +451,7 @@ int kdfs_add_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino, // kdfs_iput(kdfs_pdir->inode->i_ino); DEBUG(DBG_INFO, - "Adding file %s (with ino %ld) to directory (inode %ld): done\n", + "Adding file %s (with ino %lu) to directory (inode %lu): done\n", filename, dir_entry->ino, kdfs_pdir->inode->i_ino); return 0; @@ -490,7 +490,7 @@ int kdfs_del_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino) /* We found the direntry, let's remove it! */ res = le32_to_cpu(dir_entry->ino); - DEBUG(DBG_INFO, "found direntry : ino = %ld \n", res); + DEBUG(DBG_INFO, "found direntry : ino = %lu \n", res); page_addr = page_address(k_page->page); /* TODO PRIORITY 1: Should we grab parent dir inode */ @@ -546,7 +546,7 @@ int kdfs_del_dir_entry(struct kdfs_inode *kdfs_pdir, char *filename, ino_t ino) } } - DEBUG(DBG_INFO, "new file size : %lld\n", kdfs_pdir->inode->i_size); + DEBUG(DBG_INFO, "new file size : %llu\n", kdfs_pdir->inode->i_size); /* Update timestamps */ kdfs_pdir->inode->i_mtime = kdfs_pdir->inode->i_ctime = CURRENT_TIME_SEC; @@ -600,7 +600,7 @@ int kdfs_make_empty(struct kdfs_inode *k_pdir, struct kdfs_inode *k_dir) */ int kdfs_dir_empty(struct kdfs_inode *k_dir) { - DEBUG(DBG_INFO, "Directory size: %llu empty if: %ld\n", k_dir->inode->i_size, KDFS_DIRENT_SIZE * 2); + DEBUG(DBG_INFO, "Directory size: %llu empty if: %lu\n", k_dir->inode->i_size, KDFS_DIRENT_SIZE * 2); if (k_dir->inode->i_size > KDFS_DIRENT_SIZE * 2) return 0; return 1; @@ -648,7 +648,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) int res = 0; DEBUG(DBG_INFO, - "readdir %s: file offset = %d, file size = %lld, (inode %ld)\n", + "readdir %s: file offset = %d, file size = %llu, (inode %lu)\n", filp->f_dentry->d_name.name, (int) filp->f_pos, filp->f_dentry->d_inode->i_size, filp->f_dentry->d_inode->i_ino); /* Retrieve the dir kddm_set associated with the directory */ @@ -688,7 +688,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) if (IS_ERR(k_page)) DEBUG(DBG_PANIC, - "Can't get page %ld for the directory %ld\n", + "Can't get page %lu for the directory %lu\n", pageid, k_inode->content_setid); tmp_page = k_page->page; @@ -700,7 +700,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) /* Get the directory entry */ dir_entry = (struct kdfs_dir_entry *) dentry_addr; DEBUG(DBG_INFO, - "dentry_addr %p (dir_len %d, dirname %s, namelen %d, file size %lld, file pos %lld PAGESIZE=%ld pageoffset=%u)\n", + "dentry_addr %p (dir_len %d, dirname %s, namelen %d, file size %llu, file pos %llu PAGESIZE=%lu pageoffset=%u)\n", dentry_addr,dir_entry->rec_len, dir_entry->name, dir_entry->name_len, k_inode->inode->i_size, filp->f_pos, PAGE_SIZE, pageoffset); /* Fill the buffer with the current directory entry */ @@ -737,7 +737,7 @@ int kdfs_readdir(struct file *filp, void *dirent, filldir_t filldir) } else DEBUG(DBG_INFO, - "kDFS : readdir %s: file is zero length (file size = %lld, inode %ld)\n", + "kDFS : readdir %s: file is zero length (file size = %llu, inode %lu)\n", filp->f_dentry->d_name.name, filp->f_dentry->d_inode->i_size, filp->f_dentry->d_inode->i_ino); out: @@ -784,11 +784,11 @@ kddm_set_t *create_dir_kddm_set(struct kdfs_inode *dir) if (!IS_ERR(kddm_set)) { dir->content_setid = kddm_set->id; DEBUG(DBG_TRACE, - "Create content kddm_set for directory %ld with id %ld\n", + "Create content kddm_set for directory %lu with id %lu\n", dir->inode->i_ino, dir->content_setid); } else DEBUG(DBG_PANIC, - "Can't create content kddm_set for directory %ld\n", + "Can't create content kddm_set for directory %lu\n", dir->inode->i_ino); return kddm_set; diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 74fd1a1..f04018a 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -42,13 +42,13 @@ loff_t kdfs_llseek(struct file *filp, loff_t offset, int origin) loff_t r; DEBUG(DBG_INFO, - "lseek on file %s at offset %lld current offset is %lld\n", + "lseek on file %s at offset %llu current offset is %llu\n", filp->f_dentry->d_name.name, offset, filp->f_pos); r = generic_file_llseek(filp, offset, origin); DEBUG(DBG_INFO, - "lseek on file %s offset is now %lld: done with err %lld\n", + "lseek on file %s offset is now %llu: done with err %llu\n", filp->f_dentry->d_name.name, filp->f_pos, r); @@ -61,7 +61,7 @@ ssize_t kdfs_read(struct file *filp, char *buf, size_t count, loff_t *ppos) struct kdfs_inode *kdfs_inode = NULL; DEBUG(DBG_INFO, - "Start to read %zd bytes from file %s at offset %lld in buffer %p\n", + "Start to read %zd bytes from file %s at offset %llu in buffer %p\n", count, filp->f_dentry->d_name.name, *ppos, buf); kdfs_inode = kdfs_iget(filp->f_dentry->d_inode->i_ino); @@ -76,7 +76,7 @@ ssize_t kdfs_read(struct file *filp, char *buf, size_t count, loff_t *ppos) kdfs_iput(filp->f_dentry->d_inode->i_ino); - DEBUG(DBG_INFO, "read of file %s at offset %lld: done\n", + DEBUG(DBG_INFO, "read of file %s at offset %llu: done\n", filp->f_dentry->d_name.name, *ppos); return r; @@ -88,7 +88,7 @@ ssize_t kdfs_write(struct file *filp, const char *buf, size_t count, loff_t *ppo struct kdfs_inode *kdfs_inode = NULL; DEBUG(DBG_INFO, - "write %zd bytes to file %s at offset %lld\n", + "write %zd bytes to file %s at offset %llu\n", count, filp->f_dentry->d_name.name, *ppos); kdfs_inode = kdfs_igrab(filp->f_dentry->d_inode->i_ino); @@ -103,7 +103,7 @@ ssize_t kdfs_write(struct file *filp, const char *buf, size_t count, loff_t *ppo kdfs_iput(filp->f_dentry->d_inode->i_ino); DEBUG(DBG_INFO, - "write to file %s at offset %lld: " + "write to file %s at offset %llu: " "done with return value %zd\n", filp->f_dentry->d_name.name, *ppos, r); @@ -139,7 +139,7 @@ int kdfs_open(struct inode *inode, struct file *filp) struct kdfs_inode *k_inode; int r = 0; - DEBUG(DBG_INFO, "open file %s - inode %ld\n", + DEBUG(DBG_INFO, "open file %s - inode %lu\n", filp->f_dentry->d_name.name, inode->i_ino); k_cwsb = __kdfs_get_cwsb(); @@ -162,7 +162,7 @@ int kdfs_open(struct inode *inode, struct file *filp) __kdfs_putsb(k_sb); out: - DEBUG(DBG_INFO, "open file %s: inode %ld: done with error %d\n", + DEBUG(DBG_INFO, "open file %s: inode %lu: done with error %d\n", filp->f_dentry->d_name.name, inode->i_ino, r); return r; @@ -176,7 +176,7 @@ int kdfs_release(struct inode *inode, struct file *filp) // struct kdfs_inode *k_inode; DEBUG(DBG_INFO, - "Release file %s (i_size %lld) (inode %p)\n", + "Release file %s (i_size %llu) (inode %p)\n", filp->f_dentry->d_name.name, filp->f_dentry->d_inode->i_size, filp->f_dentry->d_inode); @@ -231,11 +231,11 @@ kddm_set_t *create_file_kddm_set(struct kdfs_inode *k_inode) #endif if (!IS_ERR(kddm_set)) { k_inode->content_setid=kddm_set->id; - DEBUG(DBG_INFO, "Create content kddm_set for file %s (inode %ld) with id %lu\n", + DEBUG(DBG_INFO, "Create content kddm_set for file %s (inode %lu) with id %lu\n", list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name, k_inode->inode->i_ino, k_inode->content_setid); } else { - DEBUG(DBG_PANIC, "Can't create content kddm_set for file%s (inode %ld)\n", + DEBUG(DBG_PANIC, "Can't create content kddm_set for file%s (inode %lu)\n", list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name, k_inode->inode->i_ino); } diff --git a/fs/kdfs/file_extent.c b/fs/kdfs/file_extent.c index f3c0279..b071718 100644 --- a/fs/kdfs/file_extent.c +++ b/fs/kdfs/file_extent.c @@ -213,7 +213,7 @@ kdfs_node_t kdfs_file_extent_get_page_owner(struct kdfs_inode *k_inode, pgoff_t { struct kdfs_file_extent *extent_before, *extent_in, *extent_after; - DEBUG(DBG_INFO, "Try to access the extent of ino : %ld\n",k_inode->inode->i_ino); + DEBUG(DBG_INFO, "Try to access the extent of ino : %lu\n",k_inode->inode->i_ino); kdfs_file_extent_find(&k_inode->extents_list, page_no, &extent_before, &extent_in, &extent_after); if (extent_in) { @@ -285,7 +285,7 @@ size_t kdfs_file_extent_read_from_file(struct kdfs_inode *k_inode) close_phys_file(file); } else { DEBUG(DBG_ALERT, - "Can't access to the KDFS inode %ld\n" + "Can't access to the KDFS inode %lu\n" "Please verify type of the partition %s, it should be a KDFS one", k_inode->inode->i_ino, ((struct kdfs_super_block*)k_inode->inode->i_sb->s_fs_info)->k_opt->part_name); } diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 5ebc699..53bde96 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -37,8 +37,8 @@ void print_inode_cont(struct inode *node) { printk("\n\n\n=== INODE DUMP ===\n"); - printk(" i_ino: %ld\n", node->i_ino); - printk(" i_count: %d\n", node->i_count.counter); + printk(" i_ino: %lu\n", node->i_ino); + printk(" i_count: %u\n", node->i_count.counter); printk(" i_nlink: %u\n", node->i_nlink); printk(" i_uid: %u\n", node->i_uid); printk(" i_gid: %u\n", node->i_gid); @@ -135,7 +135,7 @@ struct kdfs_inode *__kdfs_mknod(struct kdfs_inode *k_pdir, struct kdfs_super_block *k_sb; DEBUG(DBG_TRACE, - "Internal mknod %s (parent dir %ld ino)\n", + "Internal mknod %s (parent dir %lu ino)\n", dentry->d_name.name, k_pdir->inode->i_ino); k_sb = kdfs_grabsb(kerrighed_node_id); @@ -153,7 +153,7 @@ struct kdfs_inode *__kdfs_mknod(struct kdfs_inode *k_pdir, k_nnod = kdfs_icreate(ino); /* get a kDFS inode from the kDDM set (k_inode is lock)*/ if (IS_ERR(k_nnod)) { - DEBUG(DBG_ALERT, "Can't grab new file inode object (ino=%ld)\n", ino); + DEBUG(DBG_ALERT, "Can't grab new file inode object (ino=%lu)\n", ino); return k_nnod; } @@ -205,7 +205,7 @@ struct kdfs_inode *__kdfs_mknod(struct kdfs_inode *k_pdir, DEBUG(DBG_TRACE, "i_count before d_instantiate %d\n", atomic_read(&k_nnod->inode->i_count)); d_instantiate(dentry, k_nnod->inode); DEBUG(DBG_TRACE, "i_count after d_instantiate %d\n", atomic_read(&k_nnod->inode->i_count)); - DEBUG(DBG_TRACE, "New nod done (ino=%ld, size=%lld)\n", k_nnod->inode->i_ino, k_nnod->inode->i_size); + DEBUG(DBG_TRACE, "New nod done (ino=%lu, size=%llu)\n", k_nnod->inode->i_ino, k_nnod->inode->i_size); return k_nnod; } @@ -233,7 +233,7 @@ int kdfs_mknod(struct inode *dir, struct kdfs_inode *k_pdir, *k_nnod; DEBUG(DBG_TRACE, - "New nod %s (parent dir %ld ino)\n", + "New nod %s (parent dir %lu ino)\n", dentry->d_name.name, dir->i_ino); /* Grab the parent directory */ @@ -245,7 +245,7 @@ int kdfs_mknod(struct inode *dir, if (k_nnod) { kdfs_iput(k_nnod->inode->i_ino); DEBUG(DBG_TRACE, - "New nod (ino=%ld, size=%lld)\n", + "New nod (ino=%lu, size=%llu)\n", k_nnod->inode->i_ino,k_nnod->inode->i_size); } else // TODO PRIORITY 2, Adrien, if we got an error we should release the local inode if needed ! @@ -271,7 +271,7 @@ int kdfs_create(struct inode *dir, struct dentry *dentry, { int res = 0; DEBUG(DBG_TRACE, - "create %s (parent dir %ld ino)\n", + "create %s (parent dir %lu ino)\n", dentry->d_name.name, dir->i_ino); res = kdfs_mknod(dir, dentry, mode|S_IFREG, 0); @@ -296,7 +296,7 @@ int kdfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) struct kdfs_inode *k_pdir, *k_nnod; DEBUG(DBG_TRACE, - "mkdir %s (parent dir %ld ino)\n", + "mkdir %s (parent dir %lu ino)\n", dentry->d_name.name, dir->i_ino); /* Grab the parent directory */ @@ -373,7 +373,7 @@ int kdfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) k_page = kdfs_grab_distpage(k_nnod, 0); if (IS_ERR(k_page)) DEBUG (DBG_PANIC, - "Can't grab page for newnode %ld (contentset_id %ld)\n", + "Can't grab page for newnode %lu (contentset_id %lu)\n", k_nnod->inode->i_ino, k_nnod->content_setid); /* Write the symlink in the page */ @@ -462,7 +462,7 @@ int __kdfs_unlink(struct kdfs_inode *k_pdir, struct dentry *dentry) retval = kdfs_del_dir_entry(k_pdir, (char *) dentry->d_name.name, dentry->d_inode->i_ino); if (retval < 0 ) { DEBUG(DBG_INFO, - "Cannot delete direntry (file %s) in directory %ld)\n", + "Cannot delete direntry (file %s) in directory %lu)\n", dentry->d_name.name, k_pdir->inode->i_ino); goto out; } @@ -541,7 +541,7 @@ int kdfs_rename (struct inode *cur_dir, int err = 0; DEBUG (DBG_TRACE, - "(Start) move entry %s from directory %ld to %s in directory %ld\n", + "(Start) move entry %s from directory %lu to %s in directory %lu\n", cur_dentry->d_name.name, cur_dir->i_ino, new_dentry->d_name.name, new_dir->i_ino); @@ -593,7 +593,7 @@ int kdfs_rename (struct inode *cur_dir, err = kdfs_del_dir_entry(k_currentdir, (char *) cur_dentry->d_name.name, cur_dentry->d_inode->i_ino); if (err < 0) { - DEBUG(DBG_INFO, "Cannot delete direntry (file %s) in directory %ld)\n", cur_dentry->d_name.name, cur_dir->i_ino); + DEBUG(DBG_INFO, "Cannot delete direntry (file %s) in directory %lu)\n", cur_dentry->d_name.name, cur_dir->i_ino); kdfs_iput(cur_dir->i_ino); kdfs_iput(k_curinode->inode->i_ino); return err; @@ -647,7 +647,7 @@ int kdfs_rename (struct inode *cur_dir, err = kdfs_add_dir_entry(k_newdir, (char *) new_dentry->d_name.name, cur_dentry->d_inode->i_ino, cur_dentry->d_inode->i_mode); if (err < 0) DEBUG(DBG_PANIC, - "Cannot add direntry (file %s) in directory %ld)\n", + "Cannot add direntry (file %s) in directory %lu)\n", new_dentry->d_name.name, new_dir->i_ino); else { /* If we are moving a directory we must increment the link count of the new parent... */ @@ -656,7 +656,7 @@ int kdfs_rename (struct inode *cur_dir, err = kdfs_del_dir_entry(k_currentdir, (char *) cur_dentry->d_name.name, cur_dir->i_ino); if (err < 0) DEBUG(DBG_PANIC, - "Cannot delete direntry (file %s) in directory %ld)\n", + "Cannot delete direntry (file %s) in directory %lu)\n", cur_dentry->d_name.name, cur_dir->i_ino); else { /* ... and decrement the link count of the old parent */ @@ -677,11 +677,11 @@ int kdfs_rename (struct inode *cur_dir, out: if (err < 0) - DEBUG(DBG_TRACE, "(Exit) can't move entry %s from directory %ld to %s in directory %ld: (err=%d)\n", + DEBUG(DBG_TRACE, "(Exit) can't move entry %s from directory %lu to %s in directory %lu: (err=%d)\n", cur_dentry->d_name.name, cur_dir->i_ino, new_dentry->d_name.name, new_dir->i_ino,err); else - DEBUG(DBG_TRACE, "(Exit) move entry %s from directory %ld to %s in directory %ld\n", + DEBUG(DBG_TRACE, "(Exit) move entry %s from directory %lu to %s in directory %lu\n", cur_dentry->d_name.name, cur_dir->i_ino, new_dentry->d_name.name, new_dir->i_ino); @@ -784,7 +784,7 @@ int kdfs_getattr(struct vfsmount *mnt, struct kdfs_cw_sb *k_cwsb; int r = 0; - DEBUG (DBG_TRACE, "getattr for file %s (inodeid=%ld)\n", dentry->d_name.name,inode->i_ino); + DEBUG (DBG_TRACE, "getattr for file %s (inodeid=%lu)\n", dentry->d_name.name,inode->i_ino); // Check whether the node storing the .meta file is reachable or not // TODO: Adrien, performance impact ? @@ -802,7 +802,7 @@ int kdfs_getattr(struct vfsmount *mnt, //TODO Find a way to determine n for 2^n = (k_inode->inode->i_blkbits/8) k_inode->inode->i_blocks = (k_inode->inode->i_size >> 9 ) + 1; DEBUG(DBG_INFO, - "blocks = %ld, size= %lld, blksize =%d\n", + "blocks = %lu, size= %llu, blksize =%d\n", k_inode->inode->i_blocks, k_inode->inode->i_size, (k_inode->inode->i_blkbits / 8)); /* Build stat fields from the inode */ generic_fillattr(k_inode->inode, stat); @@ -928,7 +928,7 @@ struct kdfs_inode *kdfs_icreate(unsigned long ino) /* Release a copy */ void __kdfs_iput(struct kdfs_inode *k_inode) { - DEBUG(DBG_INFO, "Inode: %ld, i_count = %d\n", k_inode->inode->i_ino, atomic_read(&k_inode->inode->i_count)); + DEBUG(DBG_INFO, "Inode: %lu, i_count = %u\n", k_inode->inode->i_ino, atomic_read(&k_inode->inode->i_count)); if (k_inode->flags & K_INODE_DIRTY) { kddm_sync_frozen_object(kddm_def_ns, KDFS_INODE_KDDM_ID, k_inode->inode->i_ino); k_inode->flags &= ~K_INODE_DIRTY; @@ -1027,7 +1027,7 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, */ if (objEntry->object == NULL) { - DEBUG (DBG_INFO, "Alloc inode (%ld;%ld)\n", kddm_set->id, objid); + DEBUG (DBG_INFO, "Alloc inode (%lu;%lu)\n", kddm_set->id, objid); /* Object have been not allocated before */ k_inode = kmalloc(sizeof(struct kdfs_inode), GFP_KERNEL); ASSERT(k_inode != NULL); @@ -1048,7 +1048,7 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, k_inode->flags = K_INODE_INITIALIZING; if (k_inode->inode == NULL) - DEBUG(DBG_PANIC, "Cannot find inode %ld\n", objid); + DEBUG(DBG_PANIC, "Cannot find inode %lu\n", objid); k_inode->content_setid = KDDM_SET_UNUSED; @@ -1056,7 +1056,7 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, objEntry->object = k_inode; } else { /* Object id has been already allocated so reused the same structure */ - DEBUG(DBG_PANIC, "Object %ld was already allocated \n", objid); + DEBUG(DBG_PANIC, "Object %lu was already allocated \n", objid); } __kdfs_twice_putsb(k_sb); @@ -1089,7 +1089,7 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, ASSERT(k_sb != NULL); DEBUG(DBG_TRACE, - "function ENTER: First touch inode (%ld;%ld) (creation = %d)\n", + "function ENTER: First touch inode (%lu;%lu) (creation = %d)\n", kddm_set->id, objid, (flags & KDDM_CREATE_ON_FT)); k_inode = kmalloc(sizeof(struct kdfs_inode), GFP_KERNEL); @@ -1109,7 +1109,7 @@ int kdfs_iol_inode_first_touch(kddm_obj_t *objEntry, 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 %ld\n", objid); + DEBUG(DBG_PANIC, "Cannot find inode %lu\n", objid); k_inode->inode->i_ino = objid; // insert_inode_hash(k_inode->inode); } @@ -1143,7 +1143,7 @@ int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry, { struct kdfs_inode *k_inode = (struct kdfs_inode *) objEntry->object; - DEBUG(DBG_INFO, "Insert inode (%ld;%ld)\n", set->id, objid); + DEBUG(DBG_INFO, "Insert inode (%lu;%lu)\n", set->id, objid); /* * If this is the first insert in the set (just called after the first_touch) @@ -1177,7 +1177,7 @@ int kdfs_iol_inode_insert_object(kddm_obj_t *objEntry, break; default: DEBUG(DBG_PANIC, - "Cannot set kdfs inode operations %o (ino %ld)\n", + "Cannot set kdfs inode operations %o (ino %lu)\n", k_inode->inode->i_mode & S_IFMT, k_inode->inode->i_ino); DEBUG(DBG_PANIC, "filename %s\n", list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name); @@ -1279,7 +1279,7 @@ int kdfs_iol_inode_invalidate_object(kddm_obj_t *objEntry, struct kdfs_inode *k_inode; struct dentry *dentry, *dchild; - DEBUG(DBG_INFO, "Invalidate inode (%ld;%ld)\n", + DEBUG(DBG_INFO, "Invalidate inode (%lu;%lu)\n", set->id, objid); k_inode = objEntry->object; @@ -1318,7 +1318,7 @@ int kdfs_iol_inode_sync_object(kddm_obj_t *objEntry, struct kdfs_inode *kdfs_inode = NULL; ASSERT(objEntry != NULL); - DEBUG(DBG_INFO, "Sync inode %ld\n", objid); + DEBUG(DBG_INFO, "Sync inode %lu\n", objid); kdfs_inode = objEntry->object; ASSERT(kdfs_inode != NULL); diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index f8e1c57..3ce8533 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -429,7 +429,7 @@ int kdfs_phys_write(struct file *file, char *addr, size_t len, loff_t *pos) int ret; mm_segment_t old_fs; - DEBUG(DBG_INFO, "Write Native file %s to position %lld (size %ld )\n", file->f_dentry->d_name.name, *pos, len); + DEBUG(DBG_INFO, "Write Native file %s to position %llu (size %lu )\n", file->f_dentry->d_name.name, *pos, len); old_fs = get_fs(); set_fs(KERNEL_DS); /* Enable to read in kernel memory */ diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 66ba12d..b52cc3d 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -104,19 +104,19 @@ int kdfs_proc_inodes_write(struct file *filp, const char __user *buf, printk("Dumping s_inodes list\n"); list_for_each_entry(inode, &k_sb->sb->s_inodes, i_sb_list) { struct kdfs_inode *k_inode = kdfs_iget(inode->i_ino); - printk(" Inode %ld, count %d, cw_count %d, mode %u, size %lld\n", inode->i_ino, + printk(" Inode %lu, count %d, cw_count %d, mode %u, size %llu\n", inode->i_ino, atomic_read(&inode->i_count), atomic_read(&k_inode->cw_count), inode->i_mode, inode->i_size); kdfs_iput(inode->i_ino); } printk("Dumping s_dirty list\n"); list_for_each_entry(inode, &k_sb->sb->s_dirty, i_list) - 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(" Inode %lu, count %d, mode %u, size %llu\n", inode->i_ino, atomic_read(&inode->i_count), inode->i_mode, inode->i_size); printk("Dumping s_io list\n"); list_for_each_entry(inode, &k_sb->sb->s_io, i_list) - 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(" Inode %lu, count %d, mode %u, size %llu\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 %ld", atomic_read(&file->f_count)); + printk(" File with count %lu", atomic_read(&file->f_count)); } else printk("There is no kDFS superblock file on the current node\n"); @@ -179,7 +179,7 @@ int __kdfs_fill_sb(struct kdfs_super_block *k_sb) } /* Get root_nodeid */ - DEBUG(DBG_INFO, "file name %s, file position %lld \n", + DEBUG(DBG_INFO, "file name %s, file position %llu \n", k_sb->sb_file->f_dentry->d_name.name, k_sb->sb_file->f_pos); res = kdfs_phys_read(k_sb->sb_file, (char *) &k_sb->root_nodeid, @@ -204,7 +204,7 @@ int __kdfs_fill_sb(struct kdfs_super_block *k_sb) /* Load the complete bitmap */ res = sb_bitmap_load(k_sb->sb_file, k_sb->sb_file->f_pos, k_sb); - DEBUG(DBG_INFO, "BMP size: %ld\n\n", k_sb->inode_bitmap->size); + DEBUG(DBG_INFO, "BMP size: %lu\n\n", k_sb->inode_bitmap->size); if (res == -1) { DEBUG (DBG_PANIC, "You're using an old version of kDFS superblock file\n"); close_phys_file(k_sb->sb_file); @@ -260,7 +260,7 @@ ino_t kdfs_get_freeino(struct kdfs_super_block *k_sb) goto out; } - DEBUG(DBG_INFO, "Allocated inode #%ld\n", ino); + DEBUG(DBG_INFO, "Allocated inode #%lu\n", ino); DEBUG(DBG_INFO, "Next free inode #: %lu\n", sb_bitmap_get_available(k_sb)); @@ -296,7 +296,7 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) int res = 0; PRINT_FUNCTION_NAME; - DEBUG(DBG_INFO, "free inode: %ld\n", ino); + DEBUG(DBG_INFO, "free inode: %lu\n", ino); BUG_ON(inode_linked_node(ino) != kerrighed_node_id); @@ -409,9 +409,9 @@ void kdfs_getphysicalpath(struct kdfs_super_block *k_sb, unsigned long ino, /* Find the physical path corresponding to the KDFS inode */ tmp_ino = KDFS_EXTRACT_INO(ino); tmp_nodeid = inode_linked_node(ino); - sprintf(phys_filename, "%s%d/%ld-%ld/%ld", k_sb->k_opt->part_name, tmp_nodeid, + 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); - DEBUG(DBG_INFO, "function EXIT: Physical file for inode %ld: %s\n", ino, phys_filename); + DEBUG(DBG_INFO, "function EXIT: Physical file for inode %lu: %s\n", ino, phys_filename); } /* @@ -1048,7 +1048,7 @@ int kdfs_fill_kinode(struct super_block *sb, unsigned long ino, struct kdfs_inod } else DEBUG(DBG_ALERT, - "Can't access to the KDFS inode %ld\n" + "Can't access to the KDFS inode %lu\n" "Please verify type of the partition %s, it should be a KDFS one", k_inode->inode->i_ino, ((struct kdfs_super_block*)k_inode->inode->i_sb->s_fs_info)->k_opt->part_name); @@ -1115,7 +1115,7 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) close_phys_file(file); } else { DEBUG (DBG_PANIC, - "Can't access/create the KDFS inode %ld metafile \nPlease "\ + "Can't access/create the KDFS inode %lu metafile \nPlease "\ "verify type of the partition %s, it should be a KDFS one "\ " (error %ld)\n", inode->i_ino, ((struct kdfs_super_block*)inode->i_sb->s_fs_info)->k_opt->part_name, @@ -1140,7 +1140,7 @@ int __kdfs_write_inode(struct kdfs_inode *k_inode) void kdfs_drop_inode(struct inode *inode) { long ino = inode->i_ino; - DEBUG(DBG_INFO, "inode id %ld\n", ino); + DEBUG(DBG_INFO, "inode id %lu\n", ino); if (inode->i_nlink) { /* Generic forget is unfortunately not exported unfortunately */ @@ -1180,7 +1180,7 @@ void kdfs_delete_inode(struct inode *inode) struct kdfs_inode *k_inode = NULL; struct kdfs_super_block *k_sb = NULL; - DEBUG(DBG_INFO, "Delete Inode %ld\n", inode->i_ino); + DEBUG(DBG_INFO, "Delete Inode %lu\n", inode->i_ino); k_sb = kdfs_getsb(kerrighed_node_id); /* Get the inode and delete its associated content set and its entry in INODE KDDM Set */ @@ -1204,7 +1204,7 @@ DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete\n"); /* Cleanly remove inode from kddm inode set */ kdfs_idelete(inode->i_ino); // equivalent to kdfs_iput() and remove - DEBUG(DBG_INFO, "Freeing i_ino %ld from the bitmap\n", inode->i_ino); + DEBUG(DBG_INFO, "Freeing i_ino %lu from the bitmap\n", inode->i_ino); if (inode_linked_node(inode->i_ino) == kerrighed_node_id) { /* Close the physical file before it is removed in kdfs_remove_local_ino */ @@ -1395,7 +1395,7 @@ int kdfs_fill_super(struct kdfs_super_block *k_sb, void *data, int silent) /* Get root inode */ kdfs_root_inode = kdfs_iget(KDFS_COMPUTE_ROOT_INODEID(k_sb)); /* Create the root dentry */ - DEBUG(DBG_INFO, "KDFS: root inodeid %ld\n", kdfs_root_inode->inode->i_ino); + DEBUG(DBG_INFO, "KDFS: root inodeid %lu\n", kdfs_root_inode->inode->i_ino); root_dentry = d_alloc_root(kdfs_root_inode->inode); /* Release the root_inode if we can't create the related dentry */ @@ -1823,7 +1823,7 @@ struct kdfs_super_block *__kdfs_sb_alloc(unsigned long nodeid) int kdfs_iol_sb_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) { int res = 0; - DEBUG (DBG_INFO, "Alloc superbloc (%ld)\n", objid); + DEBUG (DBG_INFO, "Alloc superbloc (%lu)\n", objid); if (!objEntry->object) { struct kdfs_generic_sb *kgsb = kmalloc(sizeof(*kgsb), GFP_KERNEL); @@ -1841,7 +1841,7 @@ int kdfs_iol_sb_alloc(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) objEntry->object = kgsb; } else { /* Object id has been already allocated so reuse the same structure */ - DEBUG(DBG_PANIC, "Object %ld was already allocated \n", objid); + DEBUG(DBG_PANIC, "Object %lu was already allocated \n", objid); } PRINT_FUNCTION_EXIT; @@ -1864,7 +1864,7 @@ int kdfs_iol_sb_first_touch (kddm_obj_t *objEntry, objid_t objid, int flags) { int res = 0; - DEBUG (DBG_INFO, "First touch sb (%ld;%ld)\n", + DEBUG (DBG_INFO, "First touch sb (%lu;%lu)\n", kddm_set->id, objid); if (!objEntry->object) { struct kdfs_generic_sb *kgsb = kmalloc(sizeof(*kgsb), GFP_KERNEL); @@ -1882,7 +1882,7 @@ int kdfs_iol_sb_first_touch (kddm_obj_t *objEntry, objEntry->object = kgsb; } else { /* Object id has been already allocated so reused the same structure */ - DEBUG (DBG_PANIC, "Object %ld was already allocated \n",objid); + DEBUG (DBG_PANIC, "Object %lu was already allocated \n",objid); } PRINT_FUNCTION_EXIT; @@ -2152,7 +2152,7 @@ int kdfs_iol_sb_sync_object (kddm_obj_t *objEntry, ASSERT(objEntry != NULL); - DEBUG(DBG_INFO, "Sync superblock (sbid=%ld)\n", objid); + DEBUG(DBG_INFO, "Sync superblock (sbid=%lu)\n", objid); kgsb = objEntry->object; if (objid != KDFS_CWSB_ID) { ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 58 +++++++++++++++++++++++----------------------- fs/kdfs/dir.c | 54 +++++++++++++++++++++--------------------- fs/kdfs/file.c | 22 +++++++++--------- fs/kdfs/file_extent.c | 4 +- fs/kdfs/inode.c | 58 +++++++++++++++++++++++----------------------- fs/kdfs/physical_fs.c | 2 +- fs/kdfs/super.c | 42 +++++++++++++++++----------------- 7 files changed, 120 insertions(+), 120 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-12-21 19:10:23
|
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 e14c559171de11d5ac30d0bc2e92592d88e06ee6 (commit) from 8e688c6c4e8f6aa7e4a8024459518b586b2f5e70 (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 e14c559171de11d5ac30d0bc2e92592d88e06ee6 Author: Marko Obrovac <mar...@in...> Date: Tue Dec 21 21:08:46 2010 +0100 [BUGFIX] Represent the directory permissions in octal mode when creating a directory [CLEAN] Fix a minor grammar error in one message diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index f2237fb..f8e1c57 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -292,7 +292,7 @@ long check_create_phys_dir(const char *pathname, str_move_last_block(buf, path, '/'); error = create_phys_dir(path, mode, uid, gid); if (error != 0){ - DEBUG(DBG_ALERT, "Creation of dir %s does not succeed (error=%d)\n", path, error); + DEBUG(DBG_ALERT, "Creation of dir %s did not succeed (error=%d)\n", path, error); break; } } @@ -360,7 +360,7 @@ struct file* check_create_phys_file(const char *pathname, // Third, create the missing directory/ies while (strlen(buf)) { str_move_last_block(buf, path, '/'); - error = create_phys_dir(path, 755, uid, gid); + error = create_phys_dir(path, 0755, uid, gid); if (error != 0) goto out; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/physical_fs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-12-21 16:34:54
|
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 8e688c6c4e8f6aa7e4a8024459518b586b2f5e70 (commit) from 54d395e59a5fca78a4cfa9754497d3f156575924 (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 8e688c6c4e8f6aa7e4a8024459518b586b2f5e70 Author: ad <leb...@fr...> Date: Tue Dec 21 15:00:00 2010 +0000 Fix wrong mode for directory creation - Adrien diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index f8c979b..f2237fb 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -274,8 +274,10 @@ long check_create_phys_dir(const char *pathname, strcpy(path, pathname); fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, uid, gid); - if (!IS_ERR(fp)) - goto out_close; + if (!IS_ERR(fp)){ + close_phys_file(fp); + goto out; + } do { str_move_last_block(path, buf, '/'); @@ -289,12 +291,11 @@ long check_create_phys_dir(const char *pathname, while (strlen(buf)) { str_move_last_block(buf, path, '/'); error = create_phys_dir(path, mode, uid, gid); - if (error != 0) - goto out; + if (error != 0){ + DEBUG(DBG_ALERT, "Creation of dir %s does not succeed (error=%d)\n", path, error); + break; + } } - -out_close: - close_phys_file(fp); out: kfree(path); kfree(buf); @@ -348,18 +349,18 @@ struct file* check_create_phys_file(const char *pathname, buf[0] = 0; // Second, analyze what are the missing entries do { - str_move_last_block(path, buf, '/'); fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, uid, gid); if (!IS_ERR(fp)){ close_phys_file(fp); break; } + str_move_last_block(path, buf, '/'); } while (strlen(path)); // Third, create the missing directory/ies while (strlen(buf)) { str_move_last_block(buf, path, '/'); - error = create_phys_dir(path, mode, uid, gid); + error = create_phys_dir(path, 755, uid, gid); if (error != 0) goto out; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/physical_fs.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-12-21 14:02:37
|
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 54d395e59a5fca78a4cfa9754497d3f156575924 (commit) from 8d8c25a410ddabb5c0165caa6dc42e878e4644fa (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 54d395e59a5fca78a4cfa9754497d3f156575924 Author: ad <leb...@fr...> Date: Tue Dec 21 12:27:37 2010 +0000 Fix stupid debugging error (PRINT_FUNCTION_NAME should still be called at the beginning of the function, please make a particular attention to variable initialization) - Make a workaround to fix stupid kddm_set creation during destroy_kddm_set call (this fix allows to delete a file clusterwide) diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index a604aa5..0b10c46 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -288,9 +288,9 @@ int kdfs_releasepage(struct page *page, gfp_t mask) { struct kdfs_page *k_page; - ASSERT (page->mapping != NULL); PRINT_FUNCTION_NAME; + ASSERT (page->mapping != NULL); k_page = (struct kdfs_page *) page->private; DEBUG(DBG_INFO, "Gonna release page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); @@ -943,12 +943,16 @@ int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int m int result = 0; struct file *filp; + struct kdfs_super_block *k_sb; + + PRINT_FUNCTION_NAME; + /* TODO NOW: Adrien */ /* Ugly, we decided to forbid calling kddm grab/get functions * at such level in order to avoid deadlock */ - struct kdfs_super_block *k_sb = kdfs_getsb(kerrighed_node_id); - PRINT_FUNCTION_NAME; + + k_sb= kdfs_twice_getsb(kerrighed_node_id); ASSERT(k_sb != NULL); ASSERT(kddm_set != NULL); @@ -1015,7 +1019,7 @@ int kdfs_iol_content_instantiate(kddm_set_t *kddm_set, void *private_data, int m if (!content_data->k_mapping) DEBUG(DBG_PANIC, "k_mapping was not cleanly initialized\n"); - __kdfs_putsb(k_sb); + __kdfs_twice_putsb(k_sb); PRINT_FUNCTION_EXIT; return result; } diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 072b18f..5ebc699 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -370,7 +370,7 @@ int kdfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) } else { /* Get the first file page to write the symb link into */ create_file_kddm_set(k_nnod); - k_page = kdfs_distgrab_page(k_nnod->content_setid, 0); + k_page = kdfs_grab_distpage(k_nnod, 0); if (IS_ERR(k_page)) DEBUG (DBG_PANIC, "Can't grab page for newnode %ld (contentset_id %ld)\n", @@ -910,16 +910,12 @@ struct inode_operations kdfs_symlink_inode_operations = { /* Get a read only copy */ struct kdfs_inode *kdfs_iget(unsigned long ino) { - PRINT_FUNCTION_NAME; - PRINT_FUNCTION_EXIT; return kddm_get_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino); } /* Get the write master copy */ struct kdfs_inode *kdfs_igrab(unsigned long ino) { - PRINT_FUNCTION_NAME; - PRINT_FUNCTION_EXIT; return kddm_grab_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino); } @@ -1019,8 +1015,9 @@ int kdfs_iol_inode_alloc_object (kddm_obj_t *objEntry, * Ugly, we decided to forbid calling kddm grab/get functions * at such level in order to avoid deadlock */ - struct kdfs_super_block *k_sb = kdfs_twice_grabsb(kerrighed_node_id); + struct kdfs_super_block *k_sb ; PRINT_FUNCTION_NAME; + k_sb = kdfs_twice_grabsb(kerrighed_node_id); ASSERT(k_sb != NULL); /* diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index f450ef9..f8c979b 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -109,6 +109,7 @@ long create_phys_dir(const char *pathname, out: if (error != 0) DEBUG(DBG_ALERT, "function EXIT: Physical operation does not succeed (error %d)\n",error); + __revert_old_creds(overridden_creds, old_creds); return error; diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 7506a1d..66ba12d 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -148,9 +148,10 @@ int __kdfs_fill_sb(struct kdfs_super_block *k_sb) int res = -1; char *phys_filename = NULL; + PRINT_FUNCTION_NAME; + ASSERT(k_sb != NULL); ASSERT(k_sb->k_opt != NULL); - PRINT_FUNCTION_NAME; /* Is there a kDFS partition? */ if (strcmp(k_sb->k_opt->part_name, "none") == 0) { @@ -337,7 +338,6 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) kdfs_getphysicalpath(k_sb, ino, phys_dirname); sprintf(phys_dirname, "%s/" KDFS_CONTENT_FILENAME, phys_dirname); DEBUG(DBG_INFO, "Try to remove phys_file %s\n", phys_dirname); -// UNE LIGNE IMPORTANTE QUI POSE UN PROBLEME PUISQU'IL EN DECOULE une inode a null et donc un fichier qui ne pourra etre fermé proprement dans kdfs_iol_content_uninstantiate remove_phys_file(phys_dirname, 0, 0); if (res){ DEBUG(DBG_ALERT, "Cannot remove phys file %s (res=%d)\n", phys_dirname, res); @@ -853,7 +853,6 @@ int cw_bitmap_is_legit(void *data) { struct kdfs_cw_sb *ptr = (struct kdfs_cw_sb *)data; - PRINT_FUNCTION_NAME; if (ptr == NULL) return 0; @@ -1193,11 +1192,14 @@ void kdfs_delete_inode(struct inode *inode) if (k_inode->content_setid != KDDM_SET_UNUSED) { DEBUG(DBG_INFO, "kdfs gonna uninstantiate the set"); - destroy_kddm_set(kddm_def_ns, k_inode->content_setid); + // WARNING, the set should exist somewhere in the cluster + // Otherwise, we do not know what can happen from the kddm layer viewpoint + // cf. kddm_set.h - Adrien December 2010 + __destroy_kddm_set(kddm_def_ns, k_inode->content_setid); k_inode->content_setid = KDDM_SET_UNUSED; } -//DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete (pid: %d, %s, %d)\n", current->pid, current->comm,task_pid_knr(current) ); +DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete\n"); /* Cleanly remove inode from kddm inode set */ kdfs_idelete(inode->i_ino); // equivalent to kdfs_iput() and remove diff --git a/include/kddm/kddm_set.h b/include/kddm/kddm_set.h index 65a1372..de739ef 100644 --- a/include/kddm/kddm_set.h +++ b/include/kddm/kddm_set.h @@ -213,6 +213,10 @@ static inline struct kddm_set *create_new_kddm_set(struct kddm_ns *ns, obj_size, NULL, 0, flags); } +// Added by Adrien to avoid kddm_set instantiation when destroy is called from one node that does not use the set. +// December 2010 - cf. Kerrighed dev mailing list +int __destroy_kddm_set(struct kddm_ns *ns, kddm_set_id_t set_id); + int _destroy_kddm_set(struct kddm_set * kddm_set); int destroy_kddm_set(struct kddm_ns *ns, kddm_set_id_t set_id); diff --git a/kddm/kddm_set.c b/kddm/kddm_set.c index 38a7574..a85d5cd 100644 --- a/kddm/kddm_set.c +++ b/kddm/kddm_set.c @@ -376,9 +376,9 @@ struct kddm_set *__find_get_kddm_set(struct kddm_ns *ns, */ spin_lock(&kddm_set->lock); - if (kddm_set->state == KDDM_SET_INVALID) + if (kddm_set->state == KDDM_SET_INVALID){ kddm_set->state = KDDM_SET_NEED_LOOKUP; - +} goto check_no_lock; recheck_state: @@ -717,6 +717,25 @@ int handle_req_kddm_set_destroy(struct rpc_desc* desc, /* High level function to destroy a kddm set. */ +// Added by Adrien to avoid kddm_set instantiation when destroy is called from one node that does not use the set. +// December 2010 - cf. Kerrighed dev mailing list +int __destroy_kddm_set(struct kddm_ns *ns, kddm_set_id_t set_id) +{ + kddm_id_msg_t kddm_id; + + kddm_id.set_id = set_id; + kddm_id.ns_id = ns->id; + + if (kddm_nb_nodes == 1) + return do_kddm_set_destroy(&kddm_id); + + rpc_async_m(REQ_KDDM_SET_DESTROY, ns->rpc_comm, &krgnode_kddm_map, + &kddm_id, sizeof(kddm_id_msg_t)); + return 0; +} +EXPORT_SYMBOL(__destroy_kddm_set); + + int _destroy_kddm_set(struct kddm_set * kddm_set) { kddm_id_msg_t kddm_id; @@ -726,10 +745,8 @@ int _destroy_kddm_set(struct kddm_set * kddm_set) if (kddm_nb_nodes == 1) return do_kddm_set_destroy(&kddm_id); + rpc_async_m(REQ_KDDM_SET_DESTROY, kddm_set->ns->rpc_comm, &krgnode_kddm_map, -// Changed by Adrien, destroy should be synchrone (temporarily went back to -// asynchronous call in order to resolve the file count issue during file deletion. -// rpc_sync_m(REQ_KDDM_SET_DESTROY, kddm_set->ns->rpc_comm, &krgnode_kddm_map, &kddm_id, sizeof(kddm_id_msg_t)); return 0; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 12 ++++++++---- fs/kdfs/inode.c | 9 +++------ fs/kdfs/physical_fs.c | 1 + fs/kdfs/super.c | 12 +++++++----- include/kddm/kddm_set.h | 4 ++++ kddm/kddm_set.c | 27 ++++++++++++++++++++++----- 6 files changed, 45 insertions(+), 20 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-12-20 15:33:58
|
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 8d8c25a410ddabb5c0165caa6dc42e878e4644fa (commit) from 8bb8fee611cfe981850e8752ac394f6af4716f64 (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 8d8c25a410ddabb5c0165caa6dc42e878e4644fa Author: ad <leb...@fr...> Date: Mon Dec 20 16:33:09 2010 +0000 Some Fixes - Adrien/Marko diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index 8ba57c0..a604aa5 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -207,8 +207,10 @@ int __kdfs_commit_write(struct file *file, kdfs_distmark_page_dirty(k_inode, page->index); _kdfs_put_page((struct kdfs_page*)page->private); - // TODO: Why synchronize the inode at each page modification, I presume that it should be done - kdfs_mark_inode_dirty(k_inode); + // TODO, NOW Adrien Fix that point ASAP (the inode is currently not synchronized) + // Why synchronize the inode at each page modification, I presume that it should be done + // not for each page but at the higher level (write/read/..... functions) + // kdfs_mark_inode_dirty(k_inode); kdfs_iput(k_inode->inode->i_ino); PRINT_FUNCTION_EXIT; diff --git a/fs/kdfs/file.c b/fs/kdfs/file.c index 4f6b131..74fd1a1 100644 --- a/fs/kdfs/file.c +++ b/fs/kdfs/file.c @@ -231,7 +231,7 @@ kddm_set_t *create_file_kddm_set(struct kdfs_inode *k_inode) #endif if (!IS_ERR(kddm_set)) { k_inode->content_setid=kddm_set->id; - DEBUG(DBG_INFO, "Create content kddm_set for file %s (inode %ld) with id %ld\n", + DEBUG(DBG_INFO, "Create content kddm_set for file %s (inode %ld) with id %lu\n", list_entry(k_inode->inode->i_dentry.next, struct dentry, d_alias)->d_name.name, k_inode->inode->i_ino, k_inode->content_setid); } else { diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index 880d0ab..072b18f 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -149,7 +149,6 @@ struct kdfs_inode *__kdfs_mknod(struct kdfs_inode *k_pdir, /* Get an inode ID */ ino = kdfs_get_freeino(k_sb); - // TODO PRIORITY 2 Adrien put here or later __kdfs_putsb(k_sb); k_nnod = kdfs_icreate(ino); /* get a kDFS inode from the kDDM set (k_inode is lock)*/ @@ -294,11 +293,6 @@ int kdfs_create(struct inode *dir, struct dentry *dentry, int kdfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) { int err = 0; - /* - * TODO Adrien, NOW - * Fix err when kdfs_igrab or __mkknod crash - */ - struct kdfs_inode *k_pdir, *k_nnod; DEBUG(DBG_TRACE, @@ -332,7 +326,6 @@ int kdfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) "mkdir %s done: res = %d\n", dentry->d_name.name, err); return err; - } /* @@ -377,7 +370,7 @@ int kdfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) } else { /* Get the first file page to write the symb link into */ create_file_kddm_set(k_nnod); - k_page = kdfs_grab_page(k_nnod->content_setid, 0); + k_page = kdfs_distgrab_page(k_nnod->content_setid, 0); if (IS_ERR(k_page)) DEBUG (DBG_PANIC, "Can't grab page for newnode %ld (contentset_id %ld)\n", diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index d68c0be..7506a1d 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1743,15 +1743,10 @@ void kdfs_removesb(unsigned long sbid) struct kdfs_super_block *kdfs_twice_grabsb(unsigned long sbid) { struct kdfs_generic_sb *kgsb = kddm_find_object(kddm_def_ns, KDFS_SB_KDDM_ID, sbid); - struct kdfs_super_block *k_sb = NULL; if (!kgsb) - return NULL; - k_sb = kgsb->real_sb; - if (!k_sb) { kgsb = kddm_grab_object(kddm_def_ns, KDFS_SB_KDDM_ID, sbid); - k_sb = kgsb->real_sb; - } - return k_sb; + + return kgsb->real_sb; } /* @@ -1762,12 +1757,9 @@ struct kdfs_super_block *kdfs_twice_grabsb(unsigned long sbid) struct kdfs_super_block *kdfs_twice_getsb(unsigned long sbid) { struct kdfs_generic_sb *kgsb = kddm_find_object(kddm_def_ns, KDFS_SB_KDDM_ID, sbid); - struct kdfs_super_block *k_sb = kgsb->real_sb; - if (!k_sb) { + if (!kgsb) kgsb = kddm_get_object(kddm_def_ns, KDFS_SB_KDDM_ID, sbid); - k_sb = kgsb->real_sb; - } - return k_sb; + return kgsb->real_sb; } /* Release a copy */ diff --git a/kddm/kddm_set.c b/kddm/kddm_set.c index 4443dd6..38a7574 100644 --- a/kddm/kddm_set.c +++ b/kddm/kddm_set.c @@ -787,7 +787,7 @@ void kddm_set_init() kddm_tree_lvl_cachep = KMEM_CACHE(kddm_tree_lvl, SLAB_PANIC); __rpc_register(REQ_KDDM_SET_LOOKUP, - RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_VOID, + RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_VOID, kddm_server, handle_req_kddm_set_lookup, 0); __rpc_register(REQ_KDDM_CHANGE_MGR, @@ -796,8 +796,8 @@ void kddm_set_init() __rpc_register(REQ_KDDM_SET_DESTROY, // Change proposed by Louis Rilling - // RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_VOID, - RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_INT, + // RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_INT, + RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_VOID, kddm_server, handle_req_kddm_set_destroy, 0); ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 6 ++++-- fs/kdfs/file.c | 2 +- fs/kdfs/inode.c | 9 +-------- fs/kdfs/super.c | 16 ++++------------ kddm/kddm_set.c | 6 +++--- 5 files changed, 13 insertions(+), 26 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-12-11 19:14:57
|
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 8bb8fee611cfe981850e8752ac394f6af4716f64 (commit) from 45671550ccc4be80b65ed03ca6224e2e588fcce2 (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 8bb8fee611cfe981850e8752ac394f6af4716f64 Author: ad <leb...@fr...> Date: Sat Dec 11 20:14:16 2010 +0000 First progress on file deletions (still some bugs, please refer to the kerrighed-dev ML diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index 0f8801d..f450ef9 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -18,6 +18,11 @@ #include <linux/namei.h> #include <linux/fs_struct.h> + +// Used by unlink stuff... +#include <linux/mount.h> +#include <linux/security.h> + #include "physical_fs.h" #include "debug_kdfs.h" @@ -142,7 +147,7 @@ long remove_phys_dir(const char *pathname, uid_t uid, gid_t gid) goto out; } - dentry = file->f_dentry; + dentry = dget(file->f_dentry); dir = dentry->d_parent->d_inode; filp_close(file,current->files); @@ -153,18 +158,15 @@ long remove_phys_dir(const char *pathname, uid_t uid, gid_t gid) res = vfs_rmdir(dir, dentry); - DEBUG(DBG_INFO, "After vfs_rmdir dir %s from dir %s\n", dentry->d_name.name, - dentry->d_parent->d_name.name); + DEBUG(DBG_INFO, "After vfs_rmdir dir %s from dir %s (res=%ld)\n", dentry->d_name.name, + dentry->d_parent->d_name.name,res); - // TODO PRIORITY 3, Adrien Usefull / Useless ? - // Check Renaud code from kerrighed/fs/physical_fs.c dput(dentry); - put_filp(file); out: __revert_old_creds(overridden_creds, old_creds); - return res; + return res; } @@ -200,11 +202,7 @@ struct file *open_phys_file(const char *filename, int flags, int mode, uid_t uid lockdep_off(); file = filp_open(filename, flags, mode); lockdep_on(); - if (!IS_ERR(file)){ -// atomic_inc(file->f_dentry); - get_file(file); - filp_close(file, current->files); -} + DEBUG(DBG_INFO, "Open physical file %s done : %p\n", filename, file); out: @@ -229,15 +227,10 @@ out: int close_phys_file(struct file *file) { int res=1; - - struct dentry *dentry = file->f_dentry; - - + DEBUG(DBG_INFO, "Close physical file %s\n", file->f_dentry->d_name.name); -// res = filp_close(file, current->files); + res = filp_close(file, current->files); - dput(dentry); - put_filp(file); return res; } @@ -279,13 +272,13 @@ long check_create_phys_dir(const char *pathname, buf[0] = 0; strcpy(path, pathname); - fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, 0, 0); + fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, uid, gid); if (!IS_ERR(fp)) goto out_close; do { str_move_last_block(path, buf, '/'); - fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, 0, 0); + fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, uid, gid); if (!IS_ERR(fp)){ close_phys_file(fp); break; @@ -296,12 +289,12 @@ long check_create_phys_dir(const char *pathname, str_move_last_block(buf, path, '/'); error = create_phys_dir(path, mode, uid, gid); if (error != 0) - goto out_close; + goto out; } out_close: - if (!IS_ERR(fp)) close_phys_file(fp); +out: kfree(path); kfree(buf); return error; @@ -344,7 +337,7 @@ struct file* check_create_phys_file(const char *pathname, buf[0] = 0; strcpy(path, pathname); - fp = open_phys_file(path, O_CREAT|O_LARGEFILE|O_RDWR, mode, 0, 0); + fp = open_phys_file(path, O_CREAT|O_LARGEFILE|O_RDWR, mode, uid, gid); if (!IS_ERR(fp)) goto out; @@ -355,7 +348,7 @@ struct file* check_create_phys_file(const char *pathname, // Second, analyze what are the missing entries do { str_move_last_block(path, buf, '/'); - fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, 0, 0); + fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, uid, gid); if (!IS_ERR(fp)){ close_phys_file(fp); break; @@ -369,7 +362,7 @@ struct file* check_create_phys_file(const char *pathname, if (error != 0) goto out; } - fp = open_phys_file(pathname,O_CREAT|O_LARGEFILE|O_RDWR, mode, 0, 0); + fp = open_phys_file(pathname,O_CREAT|O_LARGEFILE|O_RDWR, mode, uid, gid); out: kfree(path); @@ -453,51 +446,74 @@ int kdfs_phys_write(struct file *file, char *addr, size_t len, loff_t *pos) * * @author Adrien Lebre * - * @param filename the file name to be removed + * @param pathname the path to the file to be removed * @param uid owner user id * @param gid owner group id * * @return 0 success * != 0 error code + * + * TODO PRIORITY 2, Adrien + * Merge remove_phys_dir and remove_phys_file in one function + * Note: the following code is strongly based on the do_unlinkat function from namei.c */ -int remove_phys_file(const char *filename, uid_t uid, gid_t gid) + +int remove_phys_file(const char *filepathname, uid_t uid, gid_t gid) { - struct file *file = NULL; - struct dentry *dentry; - struct inode *dir, *inode; + struct dentry *d_child; int res = 0; const struct cred *old_creds; struct cred *overridden_creds; - DEBUG(DBG_TRACE, "Remove file %s\n", filename); + struct inode *inode = NULL; + + struct nameidata nd; + + DEBUG(DBG_TRACE, "Remove file %s\n", filepathname); res = __change_creds(&overridden_creds, &old_creds, uid, gid); if (res) goto out; + + res = path_lookup(filepathname, LOOKUP_OPEN, &nd); + if (res){ + DEBUG(DBG_ALERT, "path_lookup for %s does not succeed\n", filepathname); + return res; + } + d_child = dget(nd.path.dentry); + mutex_lock_nested(&nd.path.dentry->d_parent->d_inode->i_mutex, I_MUTEX_PARENT); - file = filp_open(filename, O_LARGEFILE|O_RDONLY, 0644); - - if (IS_ERR(file) && PTR_ERR(file) == -ENOENT) { - DEBUG(DBG_INFO, "Can't access to physical file %s\n", filename); + if (IS_ERR(d_child)) { + DEBUG(DBG_ALERT, "Can't find the dentry for physical file %s\n", filepathname); + res = PTR_ERR(d_child); goto out; } - /* TODO PRIORITY 1, Adrien, the dentry could be dropped from the caches if we close the file before to remove it */ - dentry = file->f_dentry; - dir = dentry->d_parent->d_inode; - inode = dentry->d_inode; - filp_close(file,current->files); - -DEBUG(DBG_INFO, + DEBUG(DBG_INFO, "Remove file %s from dir %s\n", - dentry->d_name.name, dentry->d_parent->d_name.name); + d_child->d_name.name, d_child->d_parent->d_name.name); + inode = d_child->d_inode; + if (inode) + atomic_inc(&inode->i_count); + + res = mnt_want_write(nd.path.mnt); + if (res) + goto exit; + res = security_path_unlink(&nd.path, d_child); + if (res) + goto exit_umount; + + res = vfs_unlink(d_child->d_parent->d_inode, d_child); - res = vfs_unlink(dir, dentry); +exit_umount: + mnt_drop_write(nd.path.mnt); +exit: + dput(d_child); + mutex_unlock(&nd.path.dentry->d_parent->d_inode->i_mutex); - // TODO PRIORITY 3, Adrien Useful / Useless ? - // Check Renaud code from kerrighed/fs/physical_fs.c - // dput(dentry); - // put_filp(file); + if (inode) + iput(inode); /* truncate the inode here */ + path_put(&nd.path); DEBUG(DBG_INFO, "After vfs_unlink res = %d\n", res); out: @@ -505,106 +521,3 @@ out: return res; } - -// -///** -// * Prepares a directory operation by taking the mutex on the parent inode of -// * an entry and returning a dentry for the entry. -// * -// * @param child_name path to the entry, assumed absolute from configfs -// * scheduler subsystem entry. -// * -// * @return a valid dentry to the target entry, or error. The valid -// * dentry must be released with put_child_dentry. -// */ -//static struct dentry *get_child_dentry(const char *child_name) -//{ -// struct dentry *d_dir; -// struct dentry *d_child; -// const char *last_child_comp; -// const char *real_child_name = child_name; -// int err; -// -// d_dir = dget(krg_scheduler_subsys.su_group.cg_item.ci_dentry); -// -// last_child_comp = strrchr(child_name, '/'); -// if (last_child_comp) { -// struct nameidata nd; -// -// err = vfs_path_lookup(d_dir, scheduler_fs_mount, -// child_name, LOOKUP_PARENT, &nd); -// -// dput(d_dir); -// -// if (err) -// return ERR_PTR(err); -// -// d_dir = dget(nd.path.dentry); -// path_put(&nd.path); -// BUG_ON(!last_child_comp[1]); -// real_child_name = last_child_comp + 1; -// } -// -// mutex_lock_nested(&d_dir->d_inode->i_mutex, I_MUTEX_PARENT); -// d_child = lookup_one_len(real_child_name, d_dir, strlen(real_child_name)); -// if (IS_ERR(d_child)) -// mutex_unlock(&d_dir->d_inode->i_mutex); -// dput(d_dir); -// return d_child; -//} -// -// -// -// -// -// -// -//static void put_child_dentry(struct dentry *d_child) -//{ -// struct dentry *d_dir; -// -// d_dir = dget(d_child->d_parent); -// dput(d_child); -// mutex_unlock(&d_dir->d_inode->i_mutex); -// dput(d_dir); -//} -// -// -//int remove_phys_file(const char *filename, uid_t uid, gid_t gid) -//{ -// struct dentry *d_child; -// struct inode *dir; -// int res = 0; -// const struct cred *old_creds; -// struct cred *overridden_creds; -// -// DEBUG(DBG_TRACE, "Remove file %s\n", filename); -// -// res = __change_creds(&overridden_creds, &old_creds, uid, gid); -// if (res) -// goto out; -// -// d_child = get_child_dentry(filename); -// if (IS_ERR(d_child)) { -// DEBUG(DBG_INFO, "Can't find the dentry for physical file %s\n", filename); -// res = PTR_ERR(d_child); -// goto out; -// } -// -// DEBUG(DBG_INFO, -// "Remove file %s from dir %s\n", -// dentry->d_name.name, dentry->d_parent->d_name.name); -// -// res = vfs_unlink(dentr_>d_parent->d_inode, d_child); -// -// put_child_dentry(d_child); -// -// DEBUG(DBG_INFO, "After vfs_unlink res = %d\n", res); -// -//out: -// __revert_old_creds(overridden_creds, old_creds); -// -// return res; -//} -// -// diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index affc245..d68c0be 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -315,8 +315,11 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) strcat(phys_dirname, "/" KDFS_INODE_FILENAME); DEBUG(DBG_INFO, "Try to remove phys_file %s\n", phys_dirname); - remove_phys_file(phys_dirname, 0, 0); - + res = remove_phys_file(phys_dirname, 0, 0); + if (res){ + DEBUG(DBG_ALERT, "Cannot remove phys file %s (res=%d)\n", phys_dirname, res); + goto exit; + } /* TODO NOW: Pierre, * Please, provide a clean way to integrate FS checkpoint mechanisms */ #if 0 @@ -336,7 +339,10 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) DEBUG(DBG_INFO, "Try to remove phys_file %s\n", phys_dirname); // UNE LIGNE IMPORTANTE QUI POSE UN PROBLEME PUISQU'IL EN DECOULE une inode a null et donc un fichier qui ne pourra etre fermé proprement dans kdfs_iol_content_uninstantiate remove_phys_file(phys_dirname, 0, 0); - + if (res){ + DEBUG(DBG_ALERT, "Cannot remove phys file %s (res=%d)\n", phys_dirname, res); + goto exit; + } #if 0 kdfs_getphysicalpath(k_sb, ino, phys_dirname); sprintf(phys_dirname, "%s/.extents%d", phys_dirname, id_meta); @@ -352,8 +358,12 @@ void kdfs_remove_local_ino(struct kdfs_super_block *k_sb, unsigned long ino) kdfs_getphysicalpath(k_sb, ino, phys_dirname); DEBUG(DBG_INFO, "Try to remove phys_dir %s\n", phys_dirname); res = remove_phys_dir(phys_dirname, 0, 0); - BUG_ON(res < 0); + if (res){ + DEBUG(DBG_ALERT, "Cannot remove phys dir %s (res=%d)\n", phys_dirname, res); + goto exit; + } + exit: sb_bitmap_set_free(k_sb, KDFS_EXTRACT_INO(ino)); kfree(phys_dirname); @@ -1180,7 +1190,6 @@ void kdfs_delete_inode(struct inode *inode) // TODO check whether this is previously called by the vfs layer ? truncate_inode_pages(&inode->i_data, 0); -DEBUG(DBG_INFO, "kdfs idelete has not been called"); if (k_inode->content_setid != KDDM_SET_UNUSED) { DEBUG(DBG_INFO, "kdfs gonna uninstantiate the set"); ----------------------------------------------------------------------- Summary of changes: fs/kdfs/physical_fs.c | 217 +++++++++++++++---------------------------------- fs/kdfs/super.c | 19 +++- 2 files changed, 79 insertions(+), 157 deletions(-) hooks/post-receive -- kdfs |
From: alebre <al...@us...> - 2010-12-02 10:16:53
|
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 45671550ccc4be80b65ed03ca6224e2e588fcce2 (commit) via 5e7b123fa1f14255ea26b54962595df68125de77 (commit) via 1ba56cbdd2d4d1f735b43af4e489e7be7dc4fe4f (commit) from 9fa22c86a9d5807862c05edfaad953775763b184 (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 45671550ccc4be80b65ed03ca6224e2e588fcce2 Merge: 5e7b123 9fa22c8 Author: ad <leb...@fr...> Date: Thu Dec 2 01:10:30 2010 +0000 Merge branch 'make_kdfs_compile' of ssh://kdfs.git.sourceforge.net/gitroot/kdfs/kernel into make_kdfs_compile Conflicts: fs/kdfs/super.c diff --cc fs/kdfs/super.c index 29711c7,9069dcd..affc245 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@@ -1343,24 -1359,23 +1364,23 @@@ int kdfs_fill_super(struct kdfs_super_b if (!parse_options((char *) data, k_sb)) goto failed_mount; - + - // Check whether root_nodeid is reachable - // struct kdfs_cw_sb *k_cw_sb = NULL; - // __kdfs_get_cwsb(); - // if(k_cw - // DEBUG(DBG_ALERT, "The root node id of this kDFS file is not mounted (please mount kDFS from kerrighed node id %dk\n", k_sb->sb->root_nodeid ); - // __kdfs_put_cwsb; - // goto failed_mount; - // } - // __kdfs_put_cwsb; - - /* Retrieve root inodeid and inode bitmap from super metafile */ - /* - * TODO NOW, Marko - * Take into account return values - */ - __kdfs_fill_sb(k_sb); + /* Retrieve root inodeid and inode bitmap from super metafile */ + if (__kdfs_fill_sb(k_sb) != 0) + goto failed_mount; + /* Check whether the ROOT node has been mounted */ + if (kerrighed_node_id != k_rootsb_nodeid) { + kdfs_cwsb = __kdfs_get_cwsb(); + BUG_ON(kdfs_cwsb == NULL); + if (cw_bitmap_is_mounted(kdfs_cwsb, k_rootsb_nodeid) == 0) { + DEBUG(DBG_ALERT, "KDFS: The root node has not been mounted yet! Cannot mount this partition!\n"); + __kdfs_put_cwsb(); + goto failed_mount; + } + __kdfs_put_cwsb(); + } + /* Get root inode */ kdfs_root_inode = kdfs_iget(KDFS_COMPUTE_ROOT_INODEID(k_sb)); /* Create the root dentry */ commit 5e7b123fa1f14255ea26b54962595df68125de77 Author: ad <leb...@fr...> Date: Wed Dec 1 12:56:49 2010 +0000 Still working on file deletions diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index ca8b6e3..8ba57c0 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -704,7 +704,7 @@ int kdfs_iol_page_export (struct rpc_desc *desc, PRINT_FUNCTION_NAME; - DEBUG(DBG_INFO, "Gonna export objid %ld from set %ld with state\n", objid,k_page->set_id, k_page->flags); + DEBUG(DBG_INFO, "Gonna export objid %ld from set %ld with state\n", objid,k_page->set_id); res = rpc_pack(desc, 0, &k_page->flags, sizeof(k_page->flags)); if (res < 0) DEBUG(DBG_ALERT, "can't pack export page state (res=%d)\n", res); @@ -816,7 +816,7 @@ int kdfs_iol_page_import(struct rpc_desc *desc, res = rpc_unpack(desc, 0,&k_page->flags, sizeof(k_page->flags)); - DEBUG(DBG_INFO, "Gonna import objid %ld from set %ld with state\n", objid,k_page->set_id, k_page->flags); + DEBUG(DBG_INFO, "Gonna import objid %ld from set %ld with state\n", objid,k_page->set_id); if(!res && k_page->flags!=K_PG_invalid){ // We should not import a page which is not consistent with // the implicit striping mechanim. @@ -1033,6 +1033,7 @@ void kdfs_iol_content_uninstantiate(kddm_set_t *kddm_set, int destroy) ASSERT(kddm_set->private_data != NULL); content_data = (struct content_iolinker_data *) kddm_set->private_data; + DEBUG (DBG_INFO, "uninstantiate content kddm_set link to inode %ld (pid: %d, %s, %d)\n", content_data->ino, current->pid, current->comm, task_pid_knr(current) ); if (content_data->phys_dirname != NULL) { DEBUG (DBG_TRACE, "uninstantiate content kddm_set link to inode %ld (physical file:%s)", diff --git a/fs/kdfs/common.h b/fs/kdfs/common.h index b426bad..3aa92c5 100644 --- a/fs/kdfs/common.h +++ b/fs/kdfs/common.h @@ -12,6 +12,7 @@ #ifndef __KDFS_COMMON__ #define __KDFS_COMMON__ +#define KRG 1 #include <linux/list.h> #include <linux/pagemap.h> @@ -20,7 +21,11 @@ #define KDFS_NONE_NODEID 0 #define KDFS_MIN_NODEID 1 +#ifdef KRG +#define KDFS_MAX_NODEID KERRIGHED_MAX_NODES - 1 +#else #define KDFS_MAX_NODEID 255 +#endif #define KDFS_MAX_NO_NODES ((KDFS_MAX_NODEID) - (KDFS_MIN_NODEID) + 1) diff --git a/fs/kdfs/debug_kdfs.h b/fs/kdfs/debug_kdfs.h index abe9ac0..35c92e4 100644 --- a/fs/kdfs/debug_kdfs.h +++ b/fs/kdfs/debug_kdfs.h @@ -21,6 +21,7 @@ /* Kerrighed headers (dynamical debugging) */ #include <kerrighed/debug.h> +#include <kerrighed/pid.h> //#include <kerrighed/debug_tools2.h> /* DEBUG Level */ @@ -45,7 +46,7 @@ # define DEBUG(level, format, ...) \ do { \ if (KDFS_DEBUG_LEVEL >= level) { \ - pr_debug("%s @ %d | " format, __func__, __LINE__, ##__VA_ARGS__) ; \ + pr_debug("%s @ %d | " format " | pid: %d, %s, %d", __func__, __LINE__, ##__VA_ARGS__, current->pid, current->comm, task_pid_knr(current)) ; \ } \ if(level == DBG_PANIC)\ BUG();\ diff --git a/fs/kdfs/physical_fs.c b/fs/kdfs/physical_fs.c index 66b65e9..0f8801d 100644 --- a/fs/kdfs/physical_fs.c +++ b/fs/kdfs/physical_fs.c @@ -200,7 +200,11 @@ struct file *open_phys_file(const char *filename, int flags, int mode, uid_t uid lockdep_off(); file = filp_open(filename, flags, mode); lockdep_on(); - + if (!IS_ERR(file)){ +// atomic_inc(file->f_dentry); + get_file(file); + filp_close(file, current->files); +} DEBUG(DBG_INFO, "Open physical file %s done : %p\n", filename, file); out: @@ -224,10 +228,16 @@ out: */ int close_phys_file(struct file *file) { - int res; + int res=1; + + struct dentry *dentry = file->f_dentry; + DEBUG(DBG_INFO, "Close physical file %s\n", file->f_dentry->d_name.name); - res = filp_close(file, current->files); +// res = filp_close(file, current->files); + + dput(dentry); + put_filp(file); return res; } @@ -276,8 +286,10 @@ long check_create_phys_dir(const char *pathname, do { str_move_last_block(path, buf, '/'); fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, 0, 0); - if (!IS_ERR(fp)) + if (!IS_ERR(fp)){ + close_phys_file(fp); break; + } } while (strlen(path)); while (strlen(buf)) { @@ -333,26 +345,33 @@ struct file* check_create_phys_file(const char *pathname, strcpy(path, pathname); fp = open_phys_file(path, O_CREAT|O_LARGEFILE|O_RDWR, mode, 0, 0); - if (IS_ERR(fp)){ + if (!IS_ERR(fp)) + goto out; + // Parent directory(ies) does/do not exist, so create it/them // First, remove filename - str_move_last_block(path, buf, '/'); - buf[0] = 0; - // Second create the missing directory/ies + str_move_last_block(path, buf, '/'); + buf[0] = 0; + // Second, analyze what are the missing entries do { - str_move_last_block(path, buf, '/'); - fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, 0, 0); - if (!IS_ERR(fp)) - break; - } while (strlen(path)); + str_move_last_block(path, buf, '/'); + fp = open_phys_file(path, O_LARGEFILE|O_RDONLY, 0644, 0, 0); + if (!IS_ERR(fp)){ + close_phys_file(fp); + break; + } + } while (strlen(path)); - while (strlen(buf)) { + // Third, create the missing directory/ies + while (strlen(buf)) { str_move_last_block(buf, path, '/'); error = create_phys_dir(path, mode, uid, gid); - } while (strlen(path) && (error !=0)); - - fp = open_phys_file(pathname,O_CREAT|O_LARGEFILE|O_RDWR, mode, 0, 0); + if (error != 0) + goto out; } + fp = open_phys_file(pathname,O_CREAT|O_LARGEFILE|O_RDWR, mode, 0, 0); + +out: kfree(path); kfree(buf); return fp; @@ -445,11 +464,10 @@ int remove_phys_file(const char *filename, uid_t uid, gid_t gid) { struct file *file = NULL; struct dentry *dentry; - struct inode *dir; + struct inode *dir, *inode; int res = 0; const struct cred *old_creds; struct cred *overridden_creds; - DEBUG(DBG_TRACE, "Remove file %s\n", filename); res = __change_creds(&overridden_creds, &old_creds, uid, gid); @@ -457,7 +475,7 @@ int remove_phys_file(const char *filename, uid_t uid, gid_t gid) goto out; file = filp_open(filename, O_LARGEFILE|O_RDONLY, 0644); - + if (IS_ERR(file) && PTR_ERR(file) == -ENOENT) { DEBUG(DBG_INFO, "Can't access to physical file %s\n", filename); goto out; @@ -466,20 +484,19 @@ int remove_phys_file(const char *filename, uid_t uid, gid_t gid) /* TODO PRIORITY 1, Adrien, the dentry could be dropped from the caches if we close the file before to remove it */ dentry = file->f_dentry; dir = dentry->d_parent->d_inode; - + inode = dentry->d_inode; filp_close(file,current->files); - DEBUG(DBG_INFO, +DEBUG(DBG_INFO, "Remove file %s from dir %s\n", dentry->d_name.name, dentry->d_parent->d_name.name); res = vfs_unlink(dir, dentry); + // TODO PRIORITY 3, Adrien Useful / Useless ? // Check Renaud code from kerrighed/fs/physical_fs.c - dput(dentry); - put_filp(file); - - + // dput(dentry); + // put_filp(file); DEBUG(DBG_INFO, "After vfs_unlink res = %d\n", res); @@ -488,3 +505,106 @@ out: return res; } + +// +///** +// * Prepares a directory operation by taking the mutex on the parent inode of +// * an entry and returning a dentry for the entry. +// * +// * @param child_name path to the entry, assumed absolute from configfs +// * scheduler subsystem entry. +// * +// * @return a valid dentry to the target entry, or error. The valid +// * dentry must be released with put_child_dentry. +// */ +//static struct dentry *get_child_dentry(const char *child_name) +//{ +// struct dentry *d_dir; +// struct dentry *d_child; +// const char *last_child_comp; +// const char *real_child_name = child_name; +// int err; +// +// d_dir = dget(krg_scheduler_subsys.su_group.cg_item.ci_dentry); +// +// last_child_comp = strrchr(child_name, '/'); +// if (last_child_comp) { +// struct nameidata nd; +// +// err = vfs_path_lookup(d_dir, scheduler_fs_mount, +// child_name, LOOKUP_PARENT, &nd); +// +// dput(d_dir); +// +// if (err) +// return ERR_PTR(err); +// +// d_dir = dget(nd.path.dentry); +// path_put(&nd.path); +// BUG_ON(!last_child_comp[1]); +// real_child_name = last_child_comp + 1; +// } +// +// mutex_lock_nested(&d_dir->d_inode->i_mutex, I_MUTEX_PARENT); +// d_child = lookup_one_len(real_child_name, d_dir, strlen(real_child_name)); +// if (IS_ERR(d_child)) +// mutex_unlock(&d_dir->d_inode->i_mutex); +// dput(d_dir); +// return d_child; +//} +// +// +// +// +// +// +// +//static void put_child_dentry(struct dentry *d_child) +//{ +// struct dentry *d_dir; +// +// d_dir = dget(d_child->d_parent); +// dput(d_child); +// mutex_unlock(&d_dir->d_inode->i_mutex); +// dput(d_dir); +//} +// +// +//int remove_phys_file(const char *filename, uid_t uid, gid_t gid) +//{ +// struct dentry *d_child; +// struct inode *dir; +// int res = 0; +// const struct cred *old_creds; +// struct cred *overridden_creds; +// +// DEBUG(DBG_TRACE, "Remove file %s\n", filename); +// +// res = __change_creds(&overridden_creds, &old_creds, uid, gid); +// if (res) +// goto out; +// +// d_child = get_child_dentry(filename); +// if (IS_ERR(d_child)) { +// DEBUG(DBG_INFO, "Can't find the dentry for physical file %s\n", filename); +// res = PTR_ERR(d_child); +// goto out; +// } +// +// DEBUG(DBG_INFO, +// "Remove file %s from dir %s\n", +// dentry->d_name.name, dentry->d_parent->d_name.name); +// +// res = vfs_unlink(dentr_>d_parent->d_inode, d_child); +// +// put_child_dentry(d_child); +// +// DEBUG(DBG_INFO, "After vfs_unlink res = %d\n", res); +// +//out: +// __revert_old_creds(overridden_creds, old_creds); +// +// return res; +//} +// +// diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index f0e6a28..29711c7 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1160,14 +1160,16 @@ void kdfs_delete_inode(struct inode *inode) // TODO check whether this is previously called by the vfs layer ? truncate_inode_pages(&inode->i_data, 0); -DEBUG(DBG_INFO, "kdfs idelete has not been called\n"); +DEBUG(DBG_INFO, "kdfs idelete has not been called"); if (k_inode->content_setid != KDDM_SET_UNUSED) { + DEBUG(DBG_INFO, "kdfs gonna uninstantiate the set"); destroy_kddm_set(kddm_def_ns, k_inode->content_setid); k_inode->content_setid = KDDM_SET_UNUSED; } -DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete\n"); +//DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete (pid: %d, %s, %d)\n", current->pid, current->comm,task_pid_knr(current) ); + /* Cleanly remove inode from kddm inode set */ kdfs_idelete(inode->i_ino); // equivalent to kdfs_iput() and remove @@ -1175,6 +1177,7 @@ DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete\n"); if (inode_linked_node(inode->i_ino) == kerrighed_node_id) { /* Close the physical file before it is removed in kdfs_remove_local_ino */ + /* TODO PRIORITY 1: if the file is deleted on another node that the one where it has been created, we do not remove the local_ino from the bitmap */ kdfs_remove_local_ino(k_sb, inode->i_ino); } diff --git a/include/net/krgrpc/rpc.h b/include/net/krgrpc/rpc.h index b08c2af..e94e65b 100644 --- a/include/net/krgrpc/rpc.h +++ b/include/net/krgrpc/rpc.h @@ -301,7 +301,7 @@ int rpc_sync_m(enum rpcid rpcid, first = 0; }else error = error || (r != rold); - i++; + // i++; }; end: diff --git a/kddm/kddm_set.c b/kddm/kddm_set.c index d67352b..4443dd6 100644 --- a/kddm/kddm_set.c +++ b/kddm/kddm_set.c @@ -726,8 +726,10 @@ int _destroy_kddm_set(struct kddm_set * kddm_set) if (kddm_nb_nodes == 1) return do_kddm_set_destroy(&kddm_id); - rpc_async_m(REQ_KDDM_SET_DESTROY, kddm_set->ns->rpc_comm, &krgnode_kddm_map, +// Changed by Adrien, destroy should be synchrone (temporarily went back to +// asynchronous call in order to resolve the file count issue during file deletion. +// rpc_sync_m(REQ_KDDM_SET_DESTROY, kddm_set->ns->rpc_comm, &krgnode_kddm_map, &kddm_id, sizeof(kddm_id_msg_t)); return 0; } @@ -793,9 +795,12 @@ void kddm_set_init() kddm_server, handle_req_kddm_set_change_mgr, 0); __rpc_register(REQ_KDDM_SET_DESTROY, - RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_VOID, + // Change proposed by Louis Rilling + // RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_VOID, + RPC_TARGET_NODE, RPC_HANDLER_KTHREAD_INT, kddm_server, handle_req_kddm_set_destroy, 0); + printk ("KDDM set init : done\n"); } commit 1ba56cbdd2d4d1f735b43af4e489e7be7dc4fe4f Author: ad <leb...@fr...> Date: Thu Nov 25 13:31:19 2010 +0000 replace atoi (deprecated) by strtol diff --git a/fs/kdfs/inode.c b/fs/kdfs/inode.c index c1e21dd..880d0ab 100644 --- a/fs/kdfs/inode.c +++ b/fs/kdfs/inode.c @@ -917,6 +917,8 @@ struct inode_operations kdfs_symlink_inode_operations = { /* Get a read only copy */ struct kdfs_inode *kdfs_iget(unsigned long ino) { + PRINT_FUNCTION_NAME; + PRINT_FUNCTION_EXIT; return kddm_get_object(kddm_def_ns, KDFS_INODE_KDDM_ID, ino); } diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 0314574..f0e6a28 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1160,12 +1160,14 @@ void kdfs_delete_inode(struct inode *inode) // TODO check whether this is previously called by the vfs layer ? truncate_inode_pages(&inode->i_data, 0); -// ICI +DEBUG(DBG_INFO, "kdfs idelete has not been called\n"); + if (k_inode->content_setid != KDDM_SET_UNUSED) { destroy_kddm_set(kddm_def_ns, k_inode->content_setid); k_inode->content_setid = KDDM_SET_UNUSED; } +DEBUG(DBG_INFO, "kdfs uninstantiate has been called now it idelete\n"); /* Cleanly remove inode from kddm inode set */ kdfs_idelete(inode->i_ino); // equivalent to kdfs_iput() and remove @@ -1339,7 +1341,17 @@ int kdfs_fill_super(struct kdfs_super_block *k_sb, void *data, int silent) if (!parse_options((char *) data, k_sb)) goto failed_mount; - /* Retrieve root inodeid and inode bitmap from super metafile */ + // Check whether root_nodeid is reachable +// struct kdfs_cw_sb *k_cw_sb = NULL; +// __kdfs_get_cwsb(); +// if(k_cw +// DEBUG(DBG_ALERT, "The root node id of this kDFS file is not mounted (please mount kDFS from kerrighed node id %dk\n", k_sb->sb->root_nodeid ); +// __kdfs_put_cwsb; +// goto failed_mount; +// } +// __kdfs_put_cwsb; + +/* Retrieve root inodeid and inode bitmap from super metafile */ /* * TODO NOW, Marko * Take into account return values @@ -1667,6 +1679,7 @@ struct kdfs_super_block *kdfs_getsb(unsigned long sbid) struct kdfs_generic_sb *kgsb; DEBUG(DBG_TRACE, "Superblock nodeid %lu\n", sbid); kgsb = kddm_get_object(kddm_def_ns, KDFS_SB_KDDM_ID, sbid); + PRINT_FUNCTION_EXIT; return kgsb->real_sb; } ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 5 +- fs/kdfs/common.h | 5 ++ fs/kdfs/debug_kdfs.h | 3 +- fs/kdfs/inode.c | 2 + fs/kdfs/physical_fs.c | 172 +++++++++++++++++++++++++++++++++++++++------- fs/kdfs/super.c | 10 ++- include/net/krgrpc/rpc.h | 2 +- kddm/kddm_set.c | 9 ++- 8 files changed, 174 insertions(+), 34 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-11-30 22:38:18
|
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 9fa22c86a9d5807862c05edfaad953775763b184 (commit) from 3303c67049a17ffb86f800943c35d7a6f0b8ec8e (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 9fa22c86a9d5807862c05edfaad953775763b184 Author: Marko Obrovac <mar...@in...> Date: Wed Dec 1 00:26:08 2010 +0100 [BUGFIX] Ensure only the 8 least significant bits are returned when calculating the node's id out of the inode id [CODEFIX] Remove the (futile) ifdef which changes the number of bits available for the node id diff --git a/fs/kdfs/inode.h b/fs/kdfs/inode.h index fd33d86..e5d6371 100644 --- a/fs/kdfs/inode.h +++ b/fs/kdfs/inode.h @@ -68,7 +68,7 @@ void kdfs_copy_inode(struct inode *dest, struct inode *src); static inline short inode_linked_node(unsigned long ino) { - return (short) (ino >> 24); + return (short) ((ino >> 24) & 0xff); } static inline unsigned long full_inode_number(unsigned long ino, short node_id) diff --git a/include/kerrighed/sys/types.h b/include/kerrighed/sys/types.h index 7bb6a97..fdf769c 100644 --- a/include/kerrighed/sys/types.h +++ b/include/kerrighed/sys/types.h @@ -14,11 +14,11 @@ * * *--------------------------------------------------------------------------*/ -#ifdef CONFIG_KRG_AUTONODEID +//////#ifdef CONFIG_KRG_AUTONODEID #define NR_BITS_IN_MAX_NODE_ID 8 -#else -#define NR_BITS_IN_MAX_NODE_ID 7 -#endif +//////#else +//////#define NR_BITS_IN_MAX_NODE_ID 7 +//////#endif #define KERRIGHED_MAX_NODES (1<<NR_BITS_IN_MAX_NODE_ID) /* Real limit 32766 */ #define KERRIGHED_HARD_MAX_NODES 256 ----------------------------------------------------------------------- Summary of changes: fs/kdfs/inode.h | 2 +- include/kerrighed/sys/types.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-11-30 11:04:45
|
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 3303c67049a17ffb86f800943c35d7a6f0b8ec8e (commit) from ef910377aab96ccc92c31391eb2be4c9d61ceb0a (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 3303c67049a17ffb86f800943c35d7a6f0b8ec8e Author: Marko Obrovac <mar...@in...> Date: Tue Nov 30 13:01:51 2010 +0100 [BUGFIX] If the partition cannot be mounted, instead of removing the related kddm object, put it back and leave it in the memory. [CLEANUP] Remove an unreachable block of code diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index f091226..9069dcd 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -1434,25 +1434,12 @@ int kdfs_get_sb(struct file_system_type *fs_type, int flags, DEBUG(DBG_ALERT, "Cannot fill the superblock\n"); up_write(&(k_sb->sb->s_umount)); deactivate_super(k_sb->sb); - kdfs_removesb(kerrighed_node_id); + __kdfs_putsb(k_sb); return error; } //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; 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 - kdfs_removesb(kerrighed_node_id); - return error; - } k_sb->sb->s_count++; if (!(k_sb->s_mount_opt & KDFS_MOUNT_DISKLESS)) { ----------------------------------------------------------------------- Summary of changes: fs/kdfs/super.c | 15 +-------------- 1 files changed, 1 insertions(+), 14 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-11-27 17:35: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 ef910377aab96ccc92c31391eb2be4c9d61ceb0a (commit) from df5c8a1e9e7ea4604a45a715bfc80dd663905001 (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 ef910377aab96ccc92c31391eb2be4c9d61ceb0a Author: Marko Obrovac <mar...@in...> Date: Sat Nov 27 19:18:41 2010 +0100 [BUGFIX] Do not mount a partition if the root partition hasn't been mounted yet The node trying to mount the partition fills its sb info. During this process it discovers the id of the root node. It gets the cluster-wide sb bitmap, and, using the new cw_bitmap_is_mounted function, checks whether the root node has mounted its partition. For this to be possible, kdfs_iol_sb_default_owner has been rewritten: it assumes that if the root node's id is unknown, the current node is the root one. The assumption is perfectly safe to make, since all other nodes trying to get the cw sb will have already set k_rootsb_nodeid. [BUGFIX] Take into account the return value of __kdfs_fill_sb [BUGFIX] Remove a possible null-pointer bug in kdfs_twice_grabsb diff --git a/fs/kdfs/super.c b/fs/kdfs/super.c index 0314574..f091226 100644 --- a/fs/kdfs/super.c +++ b/fs/kdfs/super.c @@ -853,6 +853,26 @@ int cw_bitmap_is_legit(void *data) return 0; } +/* + * Check whether the partition with the given nodeid is mounted + * + * @author Marko Obrovac + * + * @param cw_sb the cluster-wide superblock bitmap containing + * the mounted superblocks + * @param nodeid the nodeid to check + * + * @return 0 the partition is not mounted or a wrong nodeid + * was given + * 1 the partition is mounted + */ +int cw_bitmap_is_mounted(struct kdfs_cw_sb *cw_sb, unsigned long nodeid) +{ + if (nodeid < 1 || nodeid >= cw_sb->cw_bitmap->size) + return 0; + return test_bit(nodeid, (unsigned long *)cw_sb->cw_bitmap->map); +} + /******************************************************************************/ /* */ @@ -1317,6 +1337,7 @@ int kdfs_fill_super(struct kdfs_super_block *k_sb, void *data, int silent) { struct kdfs_inode *kdfs_root_inode; struct dentry *root_dentry; + struct kdfs_cw_sb *kdfs_cwsb = NULL; PRINT_FUNCTION_NAME; @@ -1338,14 +1359,23 @@ int kdfs_fill_super(struct kdfs_super_block *k_sb, void *data, int silent) if (!parse_options((char *) data, k_sb)) goto failed_mount; - + /* Retrieve root inodeid and inode bitmap from super metafile */ - /* - * TODO NOW, Marko - * Take into account return values - */ - __kdfs_fill_sb(k_sb); + if (__kdfs_fill_sb(k_sb) != 0) + goto failed_mount; + /* Check whether the ROOT node has been mounted */ + if (kerrighed_node_id != k_rootsb_nodeid) { + kdfs_cwsb = __kdfs_get_cwsb(); + BUG_ON(kdfs_cwsb == NULL); + if (cw_bitmap_is_mounted(kdfs_cwsb, k_rootsb_nodeid) == 0) { + DEBUG(DBG_ALERT, "KDFS: The root node has not been mounted yet! Cannot mount this partition!\n"); + __kdfs_put_cwsb(); + goto failed_mount; + } + __kdfs_put_cwsb(); + } + /* Get root inode */ kdfs_root_inode = kdfs_iget(KDFS_COMPUTE_ROOT_INODEID(k_sb)); /* Create the root dentry */ @@ -1378,7 +1408,7 @@ int kdfs_get_sb(struct file_system_type *fs_type, int flags, struct kdfs_cw_sb *kdfs_cwsb = NULL; PRINT_FUNCTION_NAME; - + k_sb = kdfs_grabsb(kerrighed_node_id); if (k_sb == NULL) { DEBUG(DBG_ALERT, "Cannot retrieve the kddm superblock\n"); @@ -1711,7 +1741,10 @@ void kdfs_removesb(unsigned long sbid) struct kdfs_super_block *kdfs_twice_grabsb(unsigned long sbid) { struct kdfs_generic_sb *kgsb = kddm_find_object(kddm_def_ns, KDFS_SB_KDDM_ID, sbid); - struct kdfs_super_block *k_sb = kgsb->real_sb; + struct kdfs_super_block *k_sb = NULL; + if (!kgsb) + return NULL; + k_sb = kgsb->real_sb; if (!k_sb) { kgsb = kddm_grab_object(kddm_def_ns, KDFS_SB_KDDM_ID, sbid); k_sb = kgsb->real_sb; @@ -2088,7 +2121,17 @@ kerrighed_node_t kdfs_iol_sb_default_owner(kddm_set_t *kddm_set, objid_t objid, * We should be able to return the same default node for the cw sb object. * For the moment, we use a global value k_rootsb_nodeid */ - return (objid != KDFS_CWSB_ID ? objid : k_rootsb_nodeid); + if (objid != KDFS_CWSB_ID) + return objid; + /* + * TODO PRIORITY 4: Marko + * Here we assume we're located on the root node, since we acquire + * k_rootsb_nodeid during mount time (here we assume the root node's + * partition hasn't yet been mounted + */ + if (k_rootsb_nodeid == KERRIGHED_NODE_ID_NONE) + k_rootsb_nodeid = kerrighed_node_id; + return k_rootsb_nodeid; } /* ----------------------------------------------------------------------- Summary of changes: fs/kdfs/super.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 52 insertions(+), 9 deletions(-) hooks/post-receive -- kdfs |
From: Marko O. <d0...@us...> - 2010-11-25 20:34:56
|
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 "UNNAMED PROJECT". The branch, master has been updated via e18d0c55ce0f094075668124463c4a6a262288b8 (commit) from 5f7ab1e90999db1fd5a35bfdd55c619e0ac8bdf6 (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 e18d0c55ce0f094075668124463c4a6a262288b8 Author: Marko Obrovac <mar...@in...> Date: Thu Nov 25 22:33:54 2010 +0100 [BUGFIX] Check the user's privileges before executing mkfs.kdfs diff --git a/tools/mkfs_kdfs.c b/tools/mkfs_kdfs.c index 56f5bfb..9a4bf32 100644 --- a/tools/mkfs_kdfs.c +++ b/tools/mkfs_kdfs.c @@ -145,7 +145,11 @@ int main(int argc, char* argv[]) // backmode = umask(0); // printf("mode %o \n", backmode); - /* TODO PRIORITY 3: Only root should be granted to call mkfs.kdfs */ + // check for root privileges + if (getuid() != 0) { + fprintf(stderr, "Error: you need root privileges to run this program!\n"); + exit(EXIT_FAILURE); + } if (argc != 3) { usage(); ----------------------------------------------------------------------- Summary of changes: tools/mkfs_kdfs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) hooks/post-receive -- UNNAMED PROJECT |
From: alebre <al...@us...> - 2010-11-25 18:55:45
|
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 "UNNAMED PROJECT". The branch, master has been updated via 5f7ab1e90999db1fd5a35bfdd55c619e0ac8bdf6 (commit) via 305f637c323aadc73d659df7dc6a01bce19a4806 (commit) via 25bd02ce956edb10c9bc63307d41e5df87b13d1a (commit) via 55a43f7b96bbb0086392b1d7967619e26fa98f97 (commit) via 37371415f53d37ef83aec6094e34f180013180ca (commit) via b6c8ca8e4344452710a94add535df104faa1ca79 (commit) via ebed94b849c9ad64b66cb9ea5203f4e0c72f89cc (commit) via bbb575785890cf03c5c4045cb9edaf29b6954511 (commit) via 95acb8c947067313340bd0effb25c0bcceb667ab (commit) from 13bc25cdf1c8055f8a94e7113ae2d6f376a566a9 (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 5f7ab1e90999db1fd5a35bfdd55c619e0ac8bdf6 Author: ad <leb...@fr...> Date: Thu Nov 25 13:32:00 2010 +0000 replace atoi (deprecated) by strtol diff --git a/tools/mkfs_kdfs.c b/tools/mkfs_kdfs.c index 0376dc0..56f5bfb 100644 --- a/tools/mkfs_kdfs.c +++ b/tools/mkfs_kdfs.c @@ -166,8 +166,8 @@ int main(int argc, char* argv[]) strcat(directory_path,".sb"); errno=0; -// root_nodeid = strtol(argv[2],0,10); - root_nodeid = atoi(argv[2]); + root_nodeid = strtol(argv[2],0,10); +// root_nodeid = atoi(argv[2]); if (errno != 0){ fprintf(stderr, "Root node id is wrong or too "\ "large (errno=%d) !\n", errno); commit 305f637c323aadc73d659df7dc6a01bce19a4806 Merge: 13bc25c 25bd02c Author: ad <leb...@fr...> Date: Mon Oct 4 06:13:55 2010 +0000 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/tools commit 25bd02ce956edb10c9bc63307d41e5df87b13d1a Author: Louis Rilling <lou...@ke...> Date: Fri Jul 23 15:50:02 2010 +0200 [KTP] Fix interrupted system call errors in krgltp-smp.sh Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index d144e8c..377b904 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -120,19 +120,23 @@ function run_all_instances() { shift - for i in `seq 1 $nr_ps`; do - status_fifo=${STATUS_FIFO}-$i + # Run background jobs in a sub shell to avoid interrupting later shell + # commands with SIGCHLD + ( + for i in `seq 1 $nr_ps`; do + status_fifo=${STATUS_FIFO}-$i - ( ( - check_krgcap - # Run the test in its own pgrp - set -m - $BASETEST/$@ - ) - echo $? > $status_fifo || echo "Could not write status fifo ${status_fifo}!" - ) & - done + ( + check_krgcap + # Run the test in its own pgrp + set -m + $BASETEST/$@ + ) + echo $? > $status_fifo || echo "Could not write status fifo ${status_fifo}!" + ) & + done + ) for i in `seq 1 $nr_ps`; do $check_fun $i commit 55a43f7b96bbb0086392b1d7967619e26fa98f97 Author: Louis Rilling <lou...@ke...> Date: Fri Jul 23 15:48:27 2010 +0200 [KTP] Protect fifo synchronizations from Kerrighed capabilities Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index d067bf2..d144e8c 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -211,12 +211,14 @@ function rsingle(){ echo "*** $@ *** SINGLE run" - # Load any background pipe in its own pgrp - set -m - check_krgcap - $BASETEST/$@ || exit 1 - # Restore default behavior in non-interactive shell - set +m + # Add capabilities only in a sub shell, so that status fifos are always + # written to from the same node + ( + # Load any background pipe in its own pgrp + set -m + check_krgcap + $BASETEST/$@ + ) || exit 1 let nbpassed=nbpassed+1 } commit 37371415f53d37ef83aec6094e34f180013180ca Author: Matthieu Fertré <mat...@ke...> Date: Fri Jul 2 16:25:08 2010 +0200 libkrgcb: callbacks must not be interrupted by another signal diff --git a/libs/libkrgcb/libkrgcb.c b/libs/libkrgcb/libkrgcb.c index 0632a96..717cd16 100755 --- a/libs/libkrgcb/libkrgcb.c +++ b/libs/libkrgcb/libkrgcb.c @@ -420,7 +420,7 @@ static int initialize_signal_handlers(void) sa.sa_handler = handle_signal; sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); + sigfillset(&sa.sa_mask); r = sigaction(SIG_CB_RUN_CHKPT, &sa, NULL); if (r) commit b6c8ca8e4344452710a94add535df104faa1ca79 Author: Matthieu Fertré <mat...@ke...> Date: Thu Jul 1 14:54:49 2010 +0200 [JANITOR] Try to have usable messages for kerrighed-host script Do not print the different steps. Starting stops with a dedicated error message as soon as one step has failed. diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index a814558..b33c751 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -52,49 +52,34 @@ d_start_container() { # Function that starts the daemon/service. # d_start() { - log_progress_msg "isolate_uts" - if ! d_set_isolate_ns "$ISOLATE_UTS" isolate_uts; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_UTS" isolate_uts || return 1 - log_progress_msg "isolate_mnt" - if ! d_set_isolate_ns "$ISOLATE_MNT" isolate_mnt; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_MNT" isolate_mnt || return 1 - log_progress_msg "isolate_net" - if ! d_set_isolate_ns "$ISOLATE_NET" isolate_net; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_NET" isolate_net || return 1 - log_progress_msg "isolate_user" - if ! d_set_isolate_ns "$ISOLATE_USER" isolate_user; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_USER" isolate_user || return 1 - log_progress_msg "cluster_init" if ! echo -n $CLUSTER_INIT_HELPER > /sys/kerrighed/hotplug/cluster_init_helper; then - log_progress_msg "(failed)"; STATUS=1 + log_failure_msg "cluster_init" + return 1 fi - log_progress_msg "net_devices" for dev in $NET_DEVICES; do - log_progress_msg "$dev" if ! echo $dev > /sys/kerrighed/net_devices; then - log_progress_msg "(failed)"; STATUS=1 + log_failure_msg "setup of $dev"; + return 1 fi done if test "$(cat /sys/kerrighed/node_id)" = "$BOOT_ID"; then - log_progress_msg "container" - if [ "$STATUS" = "1" ]; then - log_progress_msg "not starting due to previous errors" - elif ! d_start_container; then - log_progress_msg "(failed)"; STATUS=1 + if ! d_start_container; then + log_failure_msg "start of the container"; + return 1 fi fi - return ${STATUS:-0} + return 0 } d_set_isolate_ns() { @@ -108,7 +93,7 @@ d_set_isolate_ns() { x) ;; *) - log_progress_msg "value of ISOLATE_xxx in $CFG must be either 'true' or 'false'" + log_failure_msg "value of ISOLATE_xxx in $CFG must be either 'true' or 'false'" STATUS=1 ;; esac @@ -144,8 +129,7 @@ else case "$1" in start) log_daemon_msg "Starting $DESC" - d_start || log_end_msg 1 - log_end_msg 0 + d_start && log_progress_msg "done" && log_end_msg 0 ;; stop) log_daemon_msg "Stopping $DESC" commit ebed94b849c9ad64b66cb9ea5203f4e0c72f89cc Author: Louis Rilling <lou...@ke...> Date: Fri Jul 23 15:51:15 2010 +0200 [BUGFIX] [KTP] ipcshm_tool: Fix and cleanup message size handling And fix segmentation faults happening with cr_ipc_shm01 and probably others. shm_size was not correctly computed for WRITE, WRITE_FROM_FILE, and READ operations. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/apps/ipcshm-tool.c b/tests/apps/ipcshm-tool.c index ddded4f..fffffaa 100644 --- a/tests/apps/ipcshm-tool.c +++ b/tests/apps/ipcshm-tool.c @@ -64,12 +64,28 @@ int create_shm(const char* path) return shmid; } +int get_shm_size(int shmid) +{ + struct shmid_ds buf; + int r; + + r = shmctl(shmid, IPC_STAT, &buf); + if (r) { + fprintf(stderr, "get_shm_size(%d)::shmctl: %s\n", shmid, + strerror(errno)); + return r; + } + + shm_size = buf.shm_segsz; + + return 0; +} + /* return -1 in case of error */ int get_shm(const char* path) { key_t key; - struct shmid_ds buf; - int shmid = -1, r; + int shmid = -1; key = get_key(path); if (key == -1) @@ -82,14 +98,6 @@ int get_shm(const char* path) return shmid; } - r = shmctl(shmid, IPC_STAT, &buf); - if (r) { - fprintf(stderr, "get_shm(%s)::shmctl: %s\n", path, - strerror(errno)); - return r; - } - shm_size = buf.shm_segsz; - return shmid; } @@ -155,7 +163,6 @@ void parse_args(int argc, char *argv[]) break; case 'c': action = CREATE; - shm_size = strlen(optarg)+1; msg = optarg; break; case 'C': @@ -203,6 +210,7 @@ void print_msg(const char *format, ...) int main(int argc, char* argv[]) { int shmid, r; + size_t msg_size = 0; /* Quiet gcc */ char *data; if (argc < 3) { @@ -217,6 +225,29 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } + /* Compute msg_size */ + switch (action) { + case CREATE: + case WRITE: + msg_size = strlen(msg) + 1; + break; + case CREATE_FROM_FILE: + case WRITE_FROM_FILE: { + struct stat buf; + + r = stat(path_msg, &buf); + if (r) { + perror("stat"); + exit(EXIT_FAILURE); + } + msg_size = buf.st_size; + print_msg("size: %zd\n", msg_size); + break; + } default: + /* READ: the whole shm is read */ + break; + } + if (action == CREATE || action == CREATE_FROM_FILE) { if (use_id) { @@ -224,20 +255,7 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } - if (action == CREATE) - shm_size = strlen(msg) + 1; - else { - /* CREATE_FROM_FILE */ - struct stat buf; - r = stat(path_msg, &buf); - if (r) { - perror("stat"); - exit(EXIT_FAILURE); - } - shm_size = buf.st_size; - print_msg("size: %zd\n", shm_size); - } - + shm_size = msg_size; shmid = create_shm(argv[argc-1]); } else if (use_id) { @@ -262,8 +280,17 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } + /* Truncate too long messages */ + if (action == WRITE || action == WRITE_FROM_FILE) { + r = get_shm_size(shmid); + if (r) + exit(EXIT_FAILURE); + if (msg_size > shm_size) + msg_size = shm_size; + } + if (action == CREATE || action == WRITE) { - memcpy(data, msg, shm_size); + memcpy(data, msg, msg_size); print_msg("%d:%s\n", shmid, msg); } else if (action == CREATE_FROM_FILE || action == WRITE_FROM_FILE) { r = open(path_msg, O_RDONLY); @@ -272,15 +299,15 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } - msg = mmap(NULL, shm_size, PROT_READ, MAP_PRIVATE, r, 0); + msg = mmap(NULL, msg_size, PROT_READ, MAP_PRIVATE, r, 0); if (msg == MAP_FAILED) { perror("mmap"); exit(EXIT_FAILURE); } - memcpy(data, msg, shm_size); + memcpy(data, msg, msg_size); - munmap(msg, shm_size); + munmap(msg, msg_size); close(r); @@ -289,6 +316,10 @@ int main(int argc, char* argv[]) /* action == READ */ int i; + r = get_shm_size(shmid); + if (r) + exit(EXIT_FAILURE); + for (i = 0; i < nb_loops; i++) { int n = 0; commit bbb575785890cf03c5c4045cb9edaf29b6954511 Author: Jean Parpaillon <jea...@ke...> Date: Thu Aug 12 17:57:38 2010 +0200 Fix kerrighed.py methods for adding and removing nodes diff --git a/libs/kerrighed.py b/libs/kerrighed.py index 346f051..b6b5920 100644 --- a/libs/kerrighed.py +++ b/libs/kerrighed.py @@ -294,9 +294,9 @@ def krg_cluster_reboot(subclusterid=0): def krg_nodes_add(node_set): """ """ - libkerrighed.krg_nodes_add(node_set) + libkerrighed.krg_nodes_add(node_set.c) def krg_nodes_remove(node_set): """ """ - libkerrighed.krg_nodes_remove(node_set) + libkerrighed.krg_nodes_remove(node_set.c) commit 95acb8c947067313340bd0effb25c0bcceb667ab Author: Jean Parpaillon <jea...@ke...> Date: Fri Jul 16 14:01:08 2010 +0200 Replace failure by warning when kerrighed init script is not run from a Kerrighed container diff --git a/tools/kerrighed.init b/tools/kerrighed.init index a655f93..6f31af2 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -110,8 +110,8 @@ d_status() { } if ! d_check_kerrighed; then - log_failure_msg "Must be run inside Kerrighed container" - STATUS=1 + log_warning_msg "Must be run inside Kerrighed container" + STATUS=0 else case "$1" in start) ----------------------------------------------------------------------- Summary of changes: libs/kerrighed.py | 4 +- libs/libkrgcb/libkrgcb.c | 2 +- tests/apps/ipcshm-tool.c | 89 +++++++++++++++++++++++++++------------- tests/ktp/krgltp-smp.sh.in | 40 ++++++++++-------- tools-host/kerrighed-host.init | 44 ++++++------------- tools/kerrighed.init | 4 +- tools/mkfs_kdfs.c | 4 +- 7 files changed, 104 insertions(+), 83 deletions(-) hooks/post-receive -- UNNAMED PROJECT |