From 2feb8cdf89ef1a808594b4190abe04d22e7f500c Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 10 Feb 2004 04:42:54 +0000 Subject: [PATCH] Update b_eq from HEAD (20040209_2123) (1.0.4 landing) --- .../kernel_configs/config-linux-2.4.20-uml | 1 + .../patches/ext3-noread-2.4.21-suse2.patch | 138 ++++++++++----------- .../patches/vfs_intent-2.4.20-vanilla.patch | 4 +- lustre/kernel_patches/series/chaos-2.4.20 | 27 ---- lustre/kernel_patches/series/vanilla-2.4.20 | 2 + 5 files changed, 74 insertions(+), 98 deletions(-) delete mode 100644 lustre/kernel_patches/series/chaos-2.4.20 diff --git a/lustre/kernel_patches/kernel_configs/config-linux-2.4.20-uml b/lustre/kernel_patches/kernel_configs/config-linux-2.4.20-uml index 4a63c18..9934753 100644 --- a/lustre/kernel_patches/kernel_configs/config-linux-2.4.20-uml +++ b/lustre/kernel_patches/kernel_configs/config-linux-2.4.20-uml @@ -195,6 +195,7 @@ CONFIG_JBD=y # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set CONFIG_TMPFS=y +CONFIG_TMPFS_XATTR=y CONFIG_RAMFS=y # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set diff --git a/lustre/kernel_patches/patches/ext3-noread-2.4.21-suse2.patch b/lustre/kernel_patches/patches/ext3-noread-2.4.21-suse2.patch index b4b5048..66274d8 100644 --- a/lustre/kernel_patches/patches/ext3-noread-2.4.21-suse2.patch +++ b/lustre/kernel_patches/patches/ext3-noread-2.4.21-suse2.patch @@ -57,17 +57,17 @@ inode->u.ext3_i.i_state = EXT3_STATE_NEW; - err = ext3_mark_inode_dirty(handle, inode); - if (err) goto fail; -+ err = ext3_get_inode_loc_new(inode, &iloc, 1); -+ if (err) goto fail; -+ BUFFER_TRACE(iloc->bh, "get_write_access"); -+ err = ext3_journal_get_write_access(handle, iloc.bh); -+ if (err) { -+ brelse(iloc.bh); -+ iloc.bh = NULL; -+ goto fail; -+ } -+ err = ext3_mark_iloc_dirty(handle, inode, &iloc); -+ if (err) goto fail; ++ err = ext3_get_inode_loc_new(inode, &iloc, 1); ++ if (err) goto fail; ++ BUFFER_TRACE(iloc->bh, "get_write_access"); ++ err = ext3_journal_get_write_access(handle, iloc.bh); ++ if (err) { ++ brelse(iloc.bh); ++ iloc.bh = NULL; ++ goto fail; ++ } ++ err = ext3_mark_iloc_dirty(handle, inode, &iloc); ++ if (err) goto fail; + + @@ -86,19 +86,19 @@ - -int ext3_get_inode_loc (struct inode *inode, struct ext3_iloc *iloc) +#define NUM_INODE_PREREAD 16 -+ ++ +/* -+ * ext3_get_inode_loc returns with an extra refcount against the inode's -+ * underlying buffer_head on success. If this is for a new inode allocation -+ * (new is non-zero) then we may be able to optimize away the read if there -+ * are no other in-use inodes in this inode table block. If we need to do -+ * a read, then read in a whole chunk of blocks to avoid blocking again soon -+ * if we are doing lots of creates/updates. -+ */ ++ * ext3_get_inode_loc returns with an extra refcount against the inode's ++ * underlying buffer_head on success. If this is for a new inode allocation ++ * (new is non-zero) then we may be able to optimize away the read if there ++ * are no other in-use inodes in this inode table block. If we need to do ++ * a read, then read in a whole chunk of blocks to avoid blocking again soon ++ * if we are doing lots of creates/updates. ++ */ +int ext3_get_inode_loc_new(struct inode *inode, struct ext3_iloc *iloc, int new) { - struct buffer_head *bh = 0; -+ struct buffer_head *bh[NUM_INODE_PREREAD]; ++ struct buffer_head *bh[NUM_INODE_PREREAD]; unsigned long block; unsigned long block_group; unsigned long group_desc; @@ -115,7 +115,7 @@ } - gdp = (struct ext3_group_desc *) bh->b_data; -+ gdp = (struct ext3_group_desc *)(inode->i_sb->u.ext3_sb.s_group_desc[group_desc]->b_data); ++ gdp = (struct ext3_group_desc *)(inode->i_sb->u.ext3_sb.s_group_desc[group_desc]->b_data); /* * Figure out the offset within the block group inode table */ @@ -132,62 +132,62 @@ - goto bad_inode; - } - offset &= (EXT3_BLOCK_SIZE(inode->i_sb) - 1); -+ (offset * EXT3_INODE_SIZE(inode->i_sb) >> EXT3_BLOCK_SIZE_BITS(inode->i_sb)); ++ (offset * EXT3_INODE_SIZE(inode->i_sb) >> EXT3_BLOCK_SIZE_BITS(inode->i_sb)); - iloc->bh = bh; - iloc->raw_inode = (struct ext3_inode *) (bh->b_data + offset); -+ bh[0] = sb_getblk(inode->i_sb, block); -+ if (buffer_uptodate(bh[0])) -+ goto done; ++ bh[0] = sb_getblk(inode->i_sb, block); ++ if (buffer_uptodate(bh[0])) ++ goto done; + -+ /* If we don't really need to read this block, and it isn't already -+ * in memory, then we just zero it out. Otherwise, we keep the -+ * current block contents (deleted inode data) for posterity. -+ */ -+ if (new && !ext3_itable_block_used(inode->i_sb, block_group, offset)) { -+ lock_buffer(bh[0]); -+ memset(bh[0]->b_data, 0, bh[0]->b_size); -+ mark_buffer_uptodate(bh[0], 1); -+ unlock_buffer(bh[0]); -+ } else { -+ unsigned long block_end, itable_end; -+ int count = 1; ++ /* If we don't really need to read this block, and it isn't already ++ * in memory, then we just zero it out. Otherwise, we keep the ++ * current block contents (deleted inode data) for posterity. ++ */ ++ if (new && !ext3_itable_block_used(inode->i_sb, block_group, offset)) { ++ lock_buffer(bh[0]); ++ memset(bh[0]->b_data, 0, bh[0]->b_size); ++ mark_buffer_uptodate(bh[0], 1); ++ unlock_buffer(bh[0]); ++ } else { ++ unsigned long block_end, itable_end; ++ int count = 1; + -+ itable_end = le32_to_cpu(gdp[desc].bg_inode_table) + -+ inode->i_sb->u.ext3_sb.s_itb_per_group; -+ block_end = block + NUM_INODE_PREREAD; -+ if (block_end > itable_end) -+ block_end = itable_end; ++ itable_end = le32_to_cpu(gdp[desc].bg_inode_table) + ++ inode->i_sb->u.ext3_sb.s_itb_per_group; ++ block_end = block + NUM_INODE_PREREAD; ++ if (block_end > itable_end) ++ block_end = itable_end; + -+ for (++block; block < block_end; block++) { -+ bh[count] = sb_getblk(inode->i_sb, block); -+ if (count && (buffer_uptodate(bh[count]) || -+ buffer_locked(bh[count]))) { -+ __brelse(bh[count]); -+ } else -+ count++; -+ } ++ for (++block; block < block_end; block++) { ++ bh[count] = sb_getblk(inode->i_sb, block); ++ if (count && (buffer_uptodate(bh[count]) || ++ buffer_locked(bh[count]))) { ++ __brelse(bh[count]); ++ } else ++ count++; ++ } + -+ ll_rw_block(READ, count, bh); ++ ll_rw_block(READ, count, bh); + -+ /* Release all but the block we actually need (bh[0]) */ -+ while (--count > 0) -+ __brelse(bh[count]); ++ /* Release all but the block we actually need (bh[0]) */ ++ while (--count > 0) ++ __brelse(bh[count]); + -+ wait_on_buffer(bh[0]); -+ if (!buffer_uptodate(bh[0])) { -+ ext3_error(inode->i_sb, __FUNCTION__, -+ "unable to read inode block - " -+ "inode=%lu, block=%lu", inode->i_ino, -+ bh[0]->b_blocknr); -+ goto bad_inode; -+ } -+ } -+ done: -+ offset = (offset * EXT3_INODE_SIZE(inode->i_sb)) & (EXT3_BLOCK_SIZE(inode->i_sb) - 1); -+ -+ iloc->bh = bh[0]; -+ iloc->raw_inode = (struct ext3_inode *)(bh[0]->b_data + offset); ++ wait_on_buffer(bh[0]); ++ if (!buffer_uptodate(bh[0])) { ++ ext3_error(inode->i_sb, __FUNCTION__, ++ "unable to read inode block - " ++ "inode=%lu, block=%lu", inode->i_ino, ++ bh[0]->b_blocknr); ++ goto bad_inode; ++ } ++ } ++ done: ++ offset = (offset * EXT3_INODE_SIZE(inode->i_sb)) & (EXT3_BLOCK_SIZE(inode->i_sb) - 1); ++ ++ iloc->bh = bh[0]; ++ iloc->raw_inode = (struct ext3_inode *)(bh[0]->b_data + offset); iloc->block_group = block_group; return 0; @@ -197,7 +197,7 @@ +int ext3_get_inode_loc(struct inode *inode, struct ext3_iloc *iloc) +{ -+ return ext3_get_inode_loc_new(inode, iloc, 0); ++ return ext3_get_inode_loc_new(inode, iloc, 0); +} + void ext3_read_inode(struct inode * inode) diff --git a/lustre/kernel_patches/patches/vfs_intent-2.4.20-vanilla.patch b/lustre/kernel_patches/patches/vfs_intent-2.4.20-vanilla.patch index c4c79b1..7d83b5e 100644 --- a/lustre/kernel_patches/patches/vfs_intent-2.4.20-vanilla.patch +++ b/lustre/kernel_patches/patches/vfs_intent-2.4.20-vanilla.patch @@ -1370,8 +1370,8 @@ { struct inode * inode = dentry->d_inode; - if (inode->i_op && inode->i_op->revalidate) -+ if (!inode) -+ return -ENOENT; ++ if (!inode) ++ return -ENOENT; + if (inode->i_op && inode->i_op->revalidate_it) + return inode->i_op->revalidate_it(dentry, it); + else if (inode->i_op && inode->i_op->revalidate) diff --git a/lustre/kernel_patches/series/chaos-2.4.20 b/lustre/kernel_patches/series/chaos-2.4.20 deleted file mode 100644 index f7a209f..0000000 --- a/lustre/kernel_patches/series/chaos-2.4.20 +++ /dev/null @@ -1,27 +0,0 @@ -dev_read_only_2.4.20-rh.patch -exports_2.4.20-rh-hp.patch -kmem_cache_validate_2.4.20-rh.patch -lustre_version.patch -vfs_intent_2.4.20_chaos.patch -invalidate_show_2.4.20_chaos.patch -iod-rmap-exports-2.4.20.patch -export-truncate.patch -ext-2.4-patch-1-chaos.patch -ext-2.4-patch-2.patch -ext-2.4-patch-3.patch -ext-2.4-patch-4.patch -linux-2.4.20-xattr-0.8.54-chaos.patch -ext3-2.4.20-fixes.patch -ext3_orphan_lock-2.4.20-rh.patch -ext3_delete_thread_2.4.20_chaos.patch -ext3-noread-2.4.20.patch -extN-wantedi.patch -ext3-san-2.4.20.patch -ext3-map_inode_page.patch -ext3-error-export.patch -iopen-2.4.20.patch -tcp_zero_copy_2.4.20_chaos.patch -gpl_header-chaos-2.4.20.patch -add_page_private.patch -jbd-flushtime.patch -jbd-get_write_access.patch diff --git a/lustre/kernel_patches/series/vanilla-2.4.20 b/lustre/kernel_patches/series/vanilla-2.4.20 index 667ebf4..abb6bbe 100644 --- a/lustre/kernel_patches/series/vanilla-2.4.20 +++ b/lustre/kernel_patches/series/vanilla-2.4.20 @@ -50,3 +50,5 @@ kernel_text_address-2.4.20-vanilla.patch ext3-xattr-ptr-arith-fix.patch gfp_memalloc-2.4.22.patch procfs-ndynamic-2.4.patch +linux-2.4.20-tmpfs-xattr.patch +ext3-truncate-buffer-head.patch -- 1.8.3.1