Whamcloud - gitweb
- ext3-map_inode_page patch ported onto 2.6.0-test3
authoralex <alex>
Mon, 8 Sep 2003 13:50:54 +0000 (13:50 +0000)
committeralex <alex>
Mon, 8 Sep 2003 13:50:54 +0000 (13:50 +0000)
- uml-2.6.0-fix patch added. it allows userspace to build with UML kernel

lustre/kernel_patches/patches/ext3-map_inode_page-2.6.0.patch [new file with mode: 0644]
lustre/kernel_patches/patches/uml-2.6.0-fix.patch [new file with mode: 0644]
lustre/kernel_patches/pc/ext3-map_inode_page-2.6.0.pc [new file with mode: 0644]
lustre/kernel_patches/pc/uml-2.6.0-fix.pc [new file with mode: 0644]
lustre/kernel_patches/series/uml_2.6.0_test3

diff --git a/lustre/kernel_patches/patches/ext3-map_inode_page-2.6.0.patch b/lustre/kernel_patches/patches/ext3-map_inode_page-2.6.0.patch
new file mode 100644 (file)
index 0000000..4695c4f
--- /dev/null
@@ -0,0 +1,76 @@
+ fs/ext3/inode.c |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ fs/ext3/super.c |    3 +++
+ 2 files changed, 55 insertions(+)
+
+--- linux-2.6.0-test3/fs/ext3/inode.c~ext3-map_inode_page-2.6.0        2003-09-02 14:48:43.000000000 +0400
++++ linux-2.6.0-test3-alexey/fs/ext3/inode.c   2003-09-08 17:50:16.000000000 +0400
+@@ -3129,3 +3129,55 @@ int ext3_prep_san_write(struct inode *in
+               ret = ret2;
+       return ret;
+ }
++
++int ext3_map_inode_page(struct inode *inode, struct page *page,
++                        unsigned long *blocks, int *created, int create)
++{
++        unsigned int blocksize, blocks_per_page;
++        unsigned long iblock;
++        struct buffer_head dummy;
++        void *handle;
++        int i, rc = 0, failed = 0, needed_blocks;
++
++        blocksize = inode->i_sb->s_blocksize;
++        blocks_per_page = PAGE_SIZE >> inode->i_sb->s_blocksize_bits;
++        iblock = page->index >> (PAGE_SHIFT - inode->i_sb->s_blocksize_bits);
++
++        for (i = 0; i < blocks_per_page; i++, iblock++) {
++                blocks[i] = ext3_bmap(inode->i_mapping, iblock);
++                if (blocks[i] == 0) {
++                        failed++;
++                        created[i] = -1;
++                } else {
++                        created[i] = 0;
++                }
++        }
++
++        if (failed == 0 || create == 0)
++                return 0;
++
++        needed_blocks = ext3_writepage_trans_blocks(inode) * failed;
++        handle = ext3_journal_start(inode, needed_blocks);
++        if (IS_ERR(handle))
++                return PTR_ERR(handle);
++
++        iblock = page->index >> (PAGE_SHIFT - inode->i_sb->s_blocksize_bits);
++        for (i = 0; i < blocks_per_page; i++, iblock++) {
++                if (blocks[i] != 0)
++                        continue;
++
++                rc = ext3_get_block_handle(handle, inode, iblock, &dummy, 1, 1);
++                if (rc) {
++                        printk(KERN_INFO "ext3_map_inode_page: error reading "
++                               "block %ld\n", iblock);
++                        goto out;
++                }
++                blocks[i] = dummy.b_blocknr;
++                created[i] = 1;
++        }
++
++ out:
++      ext3_journal_stop(handle);
++        return rc;
++}
++
+--- linux-2.6.0-test3/fs/ext3/super.c~ext3-map_inode_page-2.6.0        2003-09-02 14:48:43.000000000 +0400
++++ linux-2.6.0-test3-alexey/fs/ext3/super.c   2003-09-08 17:48:33.000000000 +0400
+@@ -2094,6 +2094,9 @@ static void __exit exit_ext3_fs(void)
+ int ext3_prep_san_write(struct inode *inode, long *blocks,
+                         int nblocks, loff_t newsize);
+ EXPORT_SYMBOL(ext3_prep_san_write);
++int ext3_map_inode_page(struct inode *inode, struct page *page,
++                        unsigned long *blocks, int *created, int create)
++EXPORT_SYMBOL(ext3_map_inode_page);
+ MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
+ MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
+
+_
diff --git a/lustre/kernel_patches/patches/uml-2.6.0-fix.patch b/lustre/kernel_patches/patches/uml-2.6.0-fix.patch
new file mode 100644 (file)
index 0000000..2910f97
--- /dev/null
@@ -0,0 +1,19 @@
+ include/asm-um/unistd.h |    2 ++
+ 1 files changed, 2 insertions(+)
+
+diff -puN include/asm-um/unistd.h~uml-2.6.0-fix include/asm-um/unistd.h
+--- linux-2.6.0-test3/include/asm-um/unistd.h~uml-2.6.0-fix    2003-09-04 18:39:45.000000000 +0400
++++ linux-2.6.0-test3-alexey/include/asm-um/unistd.h   2003-09-04 18:39:59.000000000 +0400
+@@ -6,8 +6,10 @@
+ #ifndef _UM_UNISTD_H_
+ #define _UM_UNISTD_H_
++#ifdef __KERNEL__
+ #include "linux/resource.h"
+ #include "asm/uaccess.h"
++#endif
+ extern long sys_open(const char *filename, int flags, int mode);
+ extern long sys_dup(unsigned int fildes);
+
+_
diff --git a/lustre/kernel_patches/pc/ext3-map_inode_page-2.6.0.pc b/lustre/kernel_patches/pc/ext3-map_inode_page-2.6.0.pc
new file mode 100644 (file)
index 0000000..231df0e
--- /dev/null
@@ -0,0 +1,2 @@
+fs/ext3/inode.c
+fs/ext3/super.c
diff --git a/lustre/kernel_patches/pc/uml-2.6.0-fix.pc b/lustre/kernel_patches/pc/uml-2.6.0-fix.pc
new file mode 100644 (file)
index 0000000..980e3ee
--- /dev/null
@@ -0,0 +1 @@
+include/asm-um/unistd.h
index 1441216..7d59f3a 100644 (file)
@@ -9,3 +9,5 @@ ext3-san-jdike-2.5.73.patch
 iopen-2.6.0.patch
 export-truncate-2.5.63.patch
 qla2xxx-v8.00.00b1-2.5.73.patch
+uml-2.6.0-fix.patch
+ext3-map_inode_page-2.6.0.patch