From: alebre <al...@us...> - 2010-04-08 21:37:09
|
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 f2224460b8a9dc2773dab44caf9df1c1450b273e (commit) from 15a599ff9119ab06b14d3d6544c6f5fc9061ea65 (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 f2224460b8a9dc2773dab44caf9df1c1450b273e Author: ad <leb...@fr...> Date: Tue Apr 6 18:58:25 2010 +0000 [FIX] few fixes concerning the sharing page issue occuring when the master in charge of a k_page was changed (kdfs_distrgrab...) diff --git a/fs/kdfs/address_space.c b/fs/kdfs/address_space.c index aed2e77..88c3a49 100644 --- a/fs/kdfs/address_space.c +++ b/fs/kdfs/address_space.c @@ -257,6 +257,7 @@ void kdfs_invalidatepage(struct page *page, unsigned long offset) k_page = (struct kdfs_page *) page->private; if (offset == 0) { /* The whole page is invalidated so it should be removed */ + DEBUG(DBG_INFO, "Gonna remove page %ld (objid %ld from set %ld)\n", page->index, k_page->obj_id,k_page->set_id); kddm_remove_object(kddm_def_ns, k_page->set_id, k_page->obj_id); ClearPagePrivate(page); } @@ -354,8 +355,12 @@ struct kdfs_page *kdfs_grab_distpage(struct kdfs_inode *k_inode, pgoff_t page_id k_newpage=kdfs_grab_page(k_inode->content_setid, objid); if(k_prevpage){ + // TODO BUG set the reference to the local page to NULL, otherwise, k_prepage can still refer to the page managed by the + // kdfs k_newpage. + k_prevpage->page=NULL; _kdfs_put_page(k_prevpage); // TODO Now - Adrien : destroy the k_prevpage (memory leak) + } return k_newpage; @@ -586,15 +591,22 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, pgoff_t pageid; iolinker_data = (struct content_iolinker_data *) set->private_data; - // First_Touch has to be called only on the node currently in charge of the page - BUG_ON(kerrighed_node_id != page_linked_node(objid)); - pageid = contentobjid_to_pageindex(objid); + pageid = contentobjid_to_pageindex(objid); + /* WARNING: quite ugly, we should not access to a local inode without locking the corresponding kddm object*/ /* 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); + + /* First_Touch has to be called only on the node currently in charge */ + /* of the page. */ + // TODO NOW - Adrine + // Commented till directory management is not correctly + // striped (dir.c still continues to call kdfs_grap_page + // instead of kdfs_distgrab/get.... + // BUG_ON(kerrighed_node_id != page_linked_node(objid)); /* Allocate kdfs_page and retrieve page address */ k_page = kmalloc(sizeof(struct kdfs_page), GFP_KERNEL); @@ -615,16 +627,22 @@ int kdfs_iol_page_first_touch(kddm_obj_t *objEntry, pageid); 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; + + 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); + } else k_page->flags = K_PG_ok; DEBUG(DBG_TRACE, "After find Page count=%d\n", page_count(k_page->page)); - page_addr = (char *) kmap(k_page->page); - pos = (loff_t)pageid * PAGE_SIZE; - - iolinker_data->content_readphyspage(iolinker_data, page_addr, pos); - kunmap(k_page->page); if (!IS_ERR(k_page->page)) @@ -850,8 +868,6 @@ int kdfs_iol_page_put(kddm_obj_t *objEntry, kddm_set_t *set, objid_t objid) ASSERT(objEntry != NULL); k_page = (struct kdfs_page *)objEntry->object; - DEBUG(DBG_ALERT, "Page count = %d\n", page_count(k_page->page)); - //page_cache_release(k_page->page); PRINT_FUNCTION_EXIT; ----------------------------------------------------------------------- Summary of changes: fs/kdfs/address_space.c | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-) hooks/post-receive -- kdfs |