Author: sparky Date: Sun Nov 19 04:37:34 2006 GMT Module: SOURCES Tag: HEAD ---- Log message: - now it includes all reiser4 patches from -mm3
---- Files affected: SOURCES: kernel-desktop-reiser4.patch (1.6 -> 1.7) ---- Diffs: ================================================================ Index: SOURCES/kernel-desktop-reiser4.patch diff -u SOURCES/kernel-desktop-reiser4.patch:1.6 SOURCES/kernel-desktop-reiser4.patch:1.7 --- SOURCES/kernel-desktop-reiser4.patch:1.6 Sun Nov 19 05:15:59 2006 +++ SOURCES/kernel-desktop-reiser4.patch Sun Nov 19 05:37:28 2006 @@ -487,7 +487,7 @@ + --- linux-2.6.18.orig/fs/reiser4/as_ops.c 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.18.reiser4/fs/reiser4/as_ops.c 2006-11-19 02:58:41.369150237 +0000 -@@ -0,0 +1,389 @@ +@@ -0,0 +1,336 @@ +/* Copyright 2003 by Hans Reiser, licensing governed by reiser4/README */ + +/* Interface to VFS. Reiser4 address_space_operations are defined here. */ @@ -541,7 +541,7 @@ + * @page: page to be dirtied + * + * Operation of struct address_space_operations. This implementation is used by -+ * unix and crc file plugins. ++ * unix and cryptcompress file plugins. + * + * This is called when reiser4 page gets dirtied outside of reiser4, for + * example, when dirty bit is moved from pte to physical page. @@ -556,11 +556,11 @@ + /* this page can be unformatted only */ + assert("vs-1734", (page->mapping && + page->mapping->host && -+ get_super_fake(page->mapping->host->i_sb) != ++ reiser4_get_super_fake(page->mapping->host->i_sb) != + page->mapping->host -+ && get_cc_fake(page->mapping->host->i_sb) != ++ && reiser4_get_cc_fake(page->mapping->host->i_sb) != + page->mapping->host -+ && get_bitmap_fake(page->mapping->host->i_sb) != ++ && reiser4_get_bitmap_fake(page->mapping->host->i_sb) != + page->mapping->host)); + + if (!TestSetPageDirty(page)) { @@ -586,64 +586,6 @@ + return 0; +} + -+static int filler(void *vp, struct page *page) -+{ -+ return page->mapping->a_ops->readpage(vp, page); -+} -+ -+/** -+ * reiser4_readpages - submit read for a set of pages -+ * @file: file to read -+ * @mapping: address space -+ * @pages: list of pages to submit read for -+ * @nr_pages: number of pages no the list -+ * -+ * Operation of struct address_space_operations. This implementation is used by -+ * unix and crc file plugins. -+ * -+ * Calls read_cache_pages or readpages hook if it is set. -+ */ -+int -+reiser4_readpages(struct file *file, struct address_space *mapping, -+ struct list_head *pages, unsigned nr_pages) -+{ -+ reiser4_context *ctx; -+ reiser4_file_fsdata *fsdata; -+ -+ ctx = init_context(mapping->host->i_sb); -+ if (IS_ERR(ctx)) -+ return PTR_ERR(ctx); -+ -+ fsdata = reiser4_get_file_fsdata(file); -+ if (IS_ERR(fsdata)) { -+ reiser4_exit_context(ctx); -+ return PTR_ERR(fsdata); -+ } -+ -+ if (fsdata->ra2.readpages) -+ fsdata->ra2.readpages(mapping, pages, fsdata->ra2.data); -+ else { -+ /* -+ * filler (reiser4 readpage method) may involve tree search -+ * which is not allowed when lock stack is not clean. If lock -+ * stack is not clean - do nothing. -+ */ -+ if (lock_stack_isclean(get_current_lock_stack())) -+ read_cache_pages(mapping, pages, filler, file); -+ else { -+ while (!list_empty(pages)) { -+ struct page *victim; -+ -+ victim = list_entry(pages->prev, struct page, lru); -+ list_del(&victim->lru); -+ page_cache_release(victim); -+ } -+ } -+ } -+ reiser4_exit_context(ctx); -+ return 0; -+} -+ +/* ->invalidatepage method for reiser4 */ + +/* @@ -681,9 +623,9 @@ + * + * After many troubles with vmtruncate() based truncate (including + * races with flush, tail conversion, etc.) it was re-written in the -+ * top-to-bottom style: items are killed in cut_tree_object() and -+ * pages belonging to extent are invalidated in kill_hook_extent(). So -+ * probably now additional call to capture is not needed here. ++ * top-to-bottom style: items are killed in reiser4_cut_tree_object() ++ * and pages belonging to extent are invalidated in kill_hook_extent(). ++ * So probably now additional call to capture is not needed here. + */ + + assert("nikita-3137", PageLocked(page)); @@ -697,11 +639,11 @@ + * during mount) it is simpler to let ->invalidatepage to be called on + * them. Check for this, and do nothing. + */ -+ if (get_super_fake(inode->i_sb) == inode) ++ if (reiser4_get_super_fake(inode->i_sb) == inode) + return; -+ if (get_cc_fake(inode->i_sb) == inode) ++ if (reiser4_get_cc_fake(inode->i_sb) == inode) + return; -+ if (get_bitmap_fake(inode->i_sb) == inode) ++ if (reiser4_get_bitmap_fake(inode->i_sb) == inode) + return; + assert("vs-1426", PagePrivate(page)); + assert("vs-1427", @@ -710,7 +652,7 @@ + assert("", ergo(inode_file_plugin(inode) != + file_plugin_by_id(CRC_FILE_PLUGIN_ID), offset == 0)); + -+ ctx = init_context(inode->i_sb); ++ ctx = reiser4_init_context(inode->i_sb); + if (IS_ERR(ctx)) + return; + @@ -722,7 +664,7 @@ + jref(node); + JF_SET(node, JNODE_HEARD_BANSHEE); + page_clear_jnode(page, node); -+ uncapture_jnode(node); ++ reiser4_uncapture_jnode(node); + unhash_unformatted_jnode(node); + jput(node); + reiser4_exit_context(ctx); @@ -741,7 +683,7 @@ + JF_SET(node, JNODE_HEARD_BANSHEE); + /* page cannot be detached from jnode concurrently, because it + * is locked */ -+ uncapture_page(page); ++ reiser4_uncapture_page(page); + + /* this detaches page from jnode, so that jdelete will not try + * to lock page which is already locked */ @@ -778,7 +720,7 @@ + * clean, not it atom yet, and still having fake block number. For + * example, node just created in jinit_new(). + */ -+ if (blocknr_is_fake(jnode_get_block(node))) ++ if (reiser4_blocknr_is_fake(jnode_get_block(node))) + return 0; + + /* @@ -826,7 +768,7 @@ + assert("nikita-2257", PagePrivate(page)); + assert("nikita-2259", PageLocked(page)); + assert("nikita-2892", !PageWriteback(page)); -+ assert("nikita-3019", schedulable()); ++ assert("nikita-3019", reiser4_schedulable()); + + /* NOTE-NIKITA: this can be called in the context of reiser4 call. It + is not clear what to do in this case. A lot of deadlocks seems be @@ -840,6 +782,11 @@ + if (PageDirty(page)) + return 0; + ++ /* extra page reference is used by reiser4 to protect ++ * jnode<->page link from this ->releasepage(). */ ++ if (page_count(page) > 3) ++ return 0; ++ + /* releasable() needs jnode lock, because it looks at the jnode fields + * and we need jload_lock here to avoid races with jload(). */ + spin_lock_jnode(node); @@ -863,7 +810,7 @@ + } else { + spin_unlock(&(node->load)); + spin_unlock_jnode(node); -+ assert("nikita-3020", schedulable()); ++ assert("nikita-3020", reiser4_schedulable()); + return 0; + } +} @@ -879,7 +826,7 @@ +*/ --- linux-2.6.18.orig/fs/reiser4/block_alloc.c 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.18.reiser4/fs/reiser4/block_alloc.c 2006-11-19 02:58:40.307150237 +0000 -@@ -0,0 +1,1139 @@ +@@ -0,0 +1,1144 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + +#include "debug.h" @@ -1001,20 +948,20 @@ + impossible to overload this counter during one transaction life. */ + +/* Initialize a blocknr hint. */ -+void blocknr_hint_init(reiser4_blocknr_hint * hint) ++void reiser4_blocknr_hint_init(reiser4_blocknr_hint * hint) +{ + memset(hint, 0, sizeof(reiser4_blocknr_hint)); +} + +/* Release any resources of a blocknr hint. */ -+void blocknr_hint_done(reiser4_blocknr_hint * hint UNUSED_ARG) ++void reiser4_blocknr_hint_done(reiser4_blocknr_hint * hint UNUSED_ARG) +{ + /* No resources should be freed in current blocknr_hint implementation. */ +} + +/* see above for explanation of fake block number. */ +/* Audited by: green(2002.06.11) */ -+int blocknr_is_fake(const reiser4_block_nr * da) ++int reiser4_blocknr_is_fake(const reiser4_block_nr * da) +{ + /* The reason for not simply returning result of '&' operation is that + while return value is (possibly 32bit) int, the reiser4_block_nr is @@ -1100,13 +1047,13 @@ +/* super block has 6 counters: free, used, grabbed, fake allocated + (formatted and unformatted) and flush reserved. Their sum must be + number of blocks on a device. This function checks this */ -+int check_block_counters(const struct super_block *super) ++int reiser4_check_block_counters(const struct super_block *super) +{ + __u64 sum; + + sum = reiser4_grabbed_blocks(super) + reiser4_free_blocks(super) + + reiser4_data_blocks(super) + reiser4_fake_allocated(super) + -+ reiser4_fake_allocated_unformatted(super) + flush_reserved(super) + ++ reiser4_fake_allocated_unformatted(super) + reiser4_flush_reserved(super) + + reiser4_clustered_blocks(super); + if (reiser4_block_count(super) != sum) { + printk("super block counters: " @@ -1119,7 +1066,7 @@ + (unsigned long long)reiser4_fake_allocated(super), + (unsigned long long) + reiser4_fake_allocated_unformatted(super), -+ (unsigned long long)flush_reserved(super), ++ (unsigned long long)reiser4_flush_reserved(super), + (unsigned long long)reiser4_clustered_blocks(super), + (unsigned long long)sum, + (unsigned long long)reiser4_block_count(super)); @@ -1177,7 +1124,7 @@ + ctx->grabbed_initially = count; +#endif + -+ assert("nikita-2986", check_block_counters(ctx->super)); ++ assert("nikita-2986", reiser4_check_block_counters(ctx->super)); + + /* disable grab space in current context */ + ctx->grab_enabled = 0; @@ -1227,7 +1174,7 @@ + * Solution is to reserve 5% of disk space for truncates and + * unlinks. Specifically, normal space grabbing requests don't grab space from + * reserved area. Only requests with BA_RESERVED bit in flags are allowed to -+ * drain it. Per super block delete_sema semaphore is used to allow only one ++ * drain it. Per super block delete mutex is used to allow only one + * thread at a time to grab from reserved area. + * + * Grabbing from reserved area should always be performed with BA_CAN_COMMIT @@ -1242,9 +1189,9 @@ + + assert("nikita-3175", flags & BA_CAN_COMMIT); + -+ /* Check the delete semaphore already taken by us, we assume that ++ /* Check the delete mutex already taken by us, we assume that + * reading of machine word is atomic. */ -+ if (sbinfo->delete_sema_owner == current) { ++ if (sbinfo->delete_mutex_owner == current) { + if (reiser4_grab_space + (count, (flags | BA_RESERVED) & ~BA_CAN_COMMIT)) { + warning("zam-1003", @@ -1257,9 +1204,9 @@ + } + + if (reiser4_grab_space(count, flags)) { -+ down(&sbinfo->delete_sema); -+ assert("nikita-2929", sbinfo->delete_sema_owner == NULL); -+ sbinfo->delete_sema_owner = current; ++ mutex_lock(&sbinfo->delete_mutex); ++ assert("nikita-2929", sbinfo->delete_mutex_owner == NULL); ++ sbinfo->delete_mutex_owner = current; + + if (reiser4_grab_space(count, flags | BA_RESERVED)) { + warning("zam-833", @@ -1277,9 +1224,9 @@ + reiser4_super_info_data *info; + + info = get_super_private(super); -+ if (info->delete_sema_owner == current) { -+ info->delete_sema_owner = NULL; -+ up(&info->delete_sema); ++ if (info->delete_mutex_owner == current) { ++ info->delete_mutex_owner = NULL; ++ mutex_unlock(&info->delete_mutex); + } +} + @@ -1308,7 +1255,7 @@ + sbinfo = grabbed2fake_allocated_head(1); + sbinfo->blocks_fake_allocated++; + -+ assert("vs-922", check_block_counters(reiser4_get_current_sb())); ++ assert("vs-922", reiser4_check_block_counters(reiser4_get_current_sb())); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1325,7 +1272,7 @@ + sbinfo = grabbed2fake_allocated_head(count); + sbinfo->blocks_fake_allocated_unformatted += count; + -+ assert("vs-9221", check_block_counters(reiser4_get_current_sb())); ++ assert("vs-9221", reiser4_check_block_counters(reiser4_get_current_sb())); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1344,7 +1291,7 @@ + sub_from_sb_grabbed(sbinfo, count); + sbinfo->blocks_clustered += count; + -+ assert("edward-504", check_block_counters(ctx->super)); ++ assert("edward-504", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1362,7 +1309,7 @@ + sub_from_cluster_reserved(sbinfo, count); + sbinfo->blocks_grabbed += count; + -+ assert("edward-505", check_block_counters(ctx->super)); ++ assert("edward-505", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); + add_to_ctx_grabbed(ctx, count); @@ -1382,7 +1329,7 @@ + sub_from_cluster_reserved(sbinfo, count); + sbinfo->blocks_free += count; + -+ assert("edward-502", check_block_counters(ctx->super)); ++ assert("edward-502", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1436,8 +1383,8 @@ + +/* adjust sb block counters, if real (on-disk) block allocation immediately + follows grabbing of free disk space. */ -+void grabbed2used(reiser4_context *ctx, reiser4_super_info_data *sbinfo, -+ __u64 count) ++static void grabbed2used(reiser4_context *ctx, reiser4_super_info_data *sbinfo, ++ __u64 count) +{ + sub_from_ctx_grabbed(ctx, count); + @@ -1446,26 +1393,27 @@ + sub_from_sb_grabbed(sbinfo, count); + sbinfo->blocks_used += count; + -+ assert("nikita-2679", check_block_counters(ctx->super)); ++ assert("nikita-2679", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} + +/* adjust sb block counters when @count unallocated blocks get mapped to disk */ -+void fake_allocated2used(reiser4_super_info_data *sbinfo, __u64 count, -+ reiser4_ba_flags_t flags) ++static void fake_allocated2used(reiser4_super_info_data *sbinfo, __u64 count, ++ reiser4_ba_flags_t flags) +{ + spin_lock_reiser4_super(sbinfo); + + sub_from_sb_fake_allocated(sbinfo, count, flags); + sbinfo->blocks_used += count; + -+ assert("nikita-2680", check_block_counters(reiser4_get_current_sb())); ++ assert("nikita-2680", ++ reiser4_check_block_counters(reiser4_get_current_sb())); + + spin_unlock_reiser4_super(sbinfo); +} + -+void flush_reserved2used(txn_atom * atom, __u64 count) ++static void flush_reserved2used(txn_atom * atom, __u64 count) +{ + reiser4_super_info_data *sbinfo; + @@ -1480,7 +1428,8 @@ + sub_from_sb_flush_reserved(sbinfo, count); + sbinfo->blocks_used += count; + -+ assert("zam-789", check_block_counters(reiser4_get_current_sb())); ++ assert("zam-789", ++ reiser4_check_block_counters(reiser4_get_current_sb())); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1492,7 +1441,7 @@ +{ + reiser4_super_info_data *sbinfo = get_super_private(s); + -+ assert("nikita-3342", !blocknr_is_fake(block)); ++ assert("nikita-3342", !reiser4_blocknr_is_fake(block)); + + spin_lock_reiser4_super(sbinfo); + if (*block < sbinfo->block_count) { @@ -1564,8 +1513,8 @@ + } + + ret = -+ sa_alloc_blocks(get_space_allocator(ctx->super), hint, (int)needed, -+ blk, len); ++ sa_alloc_blocks(reiser4_get_space_allocator(ctx->super), ++ hint, (int)needed, blk, len); + + if (!ret) { + assert("zam-680", *blk < reiser4_block_count(ctx->super)); @@ -1625,7 +1574,8 @@ + + sub_from_sb_used(sbinfo, count); + -+ assert("nikita-2681", check_block_counters(reiser4_get_current_sb())); ++ assert("nikita-2681", ++ reiser4_check_block_counters(reiser4_get_current_sb())); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1645,7 +1595,8 @@ + /*add_to_sb_flush_reserved(sbinfo, count); */ + sub_from_sb_used(sbinfo, count); + -+ assert("nikita-2681", check_block_counters(reiser4_get_current_sb())); ++ assert("nikita-2681", ++ reiser4_check_block_counters(reiser4_get_current_sb())); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1659,12 +1610,12 @@ + + spin_lock_reiser4_super(sbinfo); + -+ assert("nikita-2682", check_block_counters(ctx->super)); ++ assert("nikita-2682", reiser4_check_block_counters(ctx->super)); + + sbinfo->blocks_grabbed += count; + sub_from_sb_fake_allocated(sbinfo, count, flags & BA_FORMATTED); + -+ assert("nikita-2683", check_block_counters(ctx->super)); ++ assert("nikita-2683", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1712,7 +1663,7 @@ + + sub_from_sb_grabbed(sbinfo, count); + sbinfo->blocks_free += count; -+ assert("nikita-2684", check_block_counters(ctx->super)); ++ assert("nikita-2684", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1736,7 +1687,7 @@ + sbinfo->blocks_flush_reserved += count; + sub_from_sb_grabbed(sbinfo, count); + -+ assert("vpf-292", check_block_counters(ctx->super)); ++ assert("vpf-292", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1770,7 +1721,7 @@ + sbinfo->blocks_grabbed += count; + sub_from_sb_flush_reserved(sbinfo, count); + -+ assert("vpf-292", check_block_counters(ctx->super)); ++ assert("vpf-292", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1802,7 +1753,7 @@ + sbinfo->blocks_grabbed += count; + sub_from_sb_used(sbinfo, count); + -+ assert("nikita-2685", check_block_counters(ctx->super)); ++ assert("nikita-2685", reiser4_check_block_counters(ctx->super)); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1815,7 +1766,8 @@ + sbinfo->blocks_free += count; + sub_from_sb_used(sbinfo, count); + -+ assert("nikita-2685", check_block_counters(reiser4_get_current_sb())); ++ assert("nikita-2685", ++ reiser4_check_block_counters(reiser4_get_current_sb())); + + spin_unlock_reiser4_super(sbinfo); +} @@ -1868,7 +1820,7 @@ + if (REISER4_DEBUG) { + assert("zam-431", *len != 0); + assert("zam-432", *start != 0); -+ assert("zam-558", !blocknr_is_fake(start)); ++ assert("zam-558", !reiser4_blocknr_is_fake(start)); + + spin_lock_reiser4_super(sbinfo); + assert("zam-562", *start < sbinfo->block_count); @@ -1901,8 +1853,8 @@ + + } else { + assert("zam-425", get_current_super_private() != NULL); -+ sa_dealloc_blocks(get_space_allocator(ctx->super), *start, -+ *len); ++ sa_dealloc_blocks(reiser4_get_space_allocator(ctx->super), ++ *start, *len); + + if (flags & BA_PERMANENT) { + /* These blocks were counted as allocated, we have to revert it @@ -1945,7 +1897,7 @@ +} + +/* wrappers for block allocator plugin methods */ -+int pre_commit_hook(void) ++int reiser4_pre_commit_hook(void) +{ + assert("zam-502", get_current_super_private() != NULL); + sa_pre_commit_hook(); @@ -1986,7 +1938,7 @@ + return 0; +} + -+void post_commit_hook(void) ++void reiser4_post_commit_hook(void) +{ + txn_atom *atom; + @@ -2002,7 +1954,7 @@ + sa_post_commit_hook(); +} + -+void post_write_back_hook(void) ++void reiser4_post_write_back_hook(void) +{ + assert("zam-504", get_current_super_private() != NULL); + @@ -2106,8 +2058,8 @@ + +typedef enum reiser4_ba_flags reiser4_ba_flags_t; + -+extern void blocknr_hint_init(reiser4_blocknr_hint * hint); -+extern void blocknr_hint_done(reiser4_blocknr_hint * hint); ++extern void reiser4_blocknr_hint_init(reiser4_blocknr_hint * hint); ++extern void reiser4_blocknr_hint_done(reiser4_blocknr_hint * hint); +extern void update_blocknr_hint_default(const struct super_block *, + const reiser4_block_nr *); +extern void get_blocknr_hint_default(reiser4_block_nr *); @@ -2164,13 +2116,13 @@ + +extern void flush_reserved2grabbed(txn_atom * atom, __u64 count); + -+extern int blocknr_is_fake(const reiser4_block_nr * da); ++extern int reiser4_blocknr_is_fake(const reiser4_block_nr * da); + +extern void grabbed2cluster_reserved(int count); +extern void cluster_reserved2grabbed(int count); +extern void cluster_reserved2free(int count); + -+extern int check_block_counters(const struct super_block *); ++extern int reiser4_check_block_counters(const struct super_block *); + +#if REISER4_DEBUG + @@ -2182,9 +2134,9 @@ + +#endif + -+extern int pre_commit_hook(void); -+extern void post_commit_hook(void); -+extern void post_write_back_hook(void); ++extern int reiser4_pre_commit_hook(void); ++extern void reiser4_post_commit_hook(void); ++extern void reiser4_post_write_back_hook(void); + +#endif /* __FS_REISER4_BLOCK_ALLOC_H__ */ <<Diff was trimmed, longer than 597 lines>> ---- CVS-web: http://cvs.pld-linux.org/SOURCES/kernel-desktop-reiser4.patch?r1=1.6&r2=1.7&f=u _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit