+++ /dev/null
---- linux/fs/ext3/ialloc.c.orig Sat Oct 19 11:42:23 2002
-+++ linux/fs/ext3/ialloc.c Sat Jan 4 12:14:18 2003
-@@ -64,8 +64,8 @@ static int read_inode_bitmap (struct sup
- if (!bh) {
- ext3_error (sb, "read_inode_bitmap",
- "Cannot read inode bitmap - "
-- "block_group = %lu, inode_bitmap = %lu",
-- block_group, (unsigned long) gdp->bg_inode_bitmap);
-+ "block_group = %lu, inode_bitmap = %u",
-+ block_group, gdp->bg_inode_bitmap);
- retval = -EIO;
- }
- /*
-@@ -531,19 +532,19 @@ out:
- }
-
- /* Verify that we are loading a valid orphan from disk */
--struct inode *ext3_orphan_get (struct super_block * sb, ino_t ino)
-+struct inode *ext3_orphan_get(struct super_block *sb, unsigned long ino)
- {
-- ino_t max_ino = le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count);
-+ unsigned long max_ino = le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count);
- unsigned long block_group;
- int bit;
- int bitmap_nr;
- struct buffer_head *bh;
- struct inode *inode = NULL;
--
-+
- /* Error cases - e2fsck has already cleaned up for us */
- if (ino > max_ino) {
- ext3_warning(sb, __FUNCTION__,
-- "bad orphan ino %ld! e2fsck was run?\n", ino);
-+ "bad orphan ino %lu! e2fsck was run?\n", ino);
- return NULL;
- }
-
-@@ -552,7 +553,7 @@ struct inode *ext3_orphan_get (struct su
- if ((bitmap_nr = load_inode_bitmap(sb, block_group)) < 0 ||
- !(bh = EXT3_SB(sb)->s_inode_bitmap[bitmap_nr])) {
- ext3_warning(sb, __FUNCTION__,
-- "inode bitmap error for orphan %ld\n", ino);
-+ "inode bitmap error for orphan %lu\n", ino);
- return NULL;
- }
-
-@@ -563,7 +564,7 @@ struct inode *ext3_orphan_get (struct su
- if (!ext3_test_bit(bit, bh->b_data) || !(inode = iget(sb, ino)) ||
- is_bad_inode(inode) || NEXT_ORPHAN(inode) > max_ino) {
- ext3_warning(sb, __FUNCTION__,
-- "bad orphan inode %ld! e2fsck was run?\n", ino);
-+ "bad orphan inode %lu! e2fsck was run?\n", ino);
- printk(KERN_NOTICE "ext3_test_bit(bit=%d, block=%ld) = %d\n",
- bit, bh->b_blocknr, ext3_test_bit(bit, bh->b_data));
- printk(KERN_NOTICE "inode=%p\n", inode);
-@@ -570,9 +571,9 @@ struct inode *ext3_orphan_get (struct su
- if (inode) {
- printk(KERN_NOTICE "is_bad_inode(inode)=%d\n",
- is_bad_inode(inode));
-- printk(KERN_NOTICE "NEXT_ORPHAN(inode)=%d\n",
-+ printk(KERN_NOTICE "NEXT_ORPHAN(inode)=%u\n",
- NEXT_ORPHAN(inode));
-- printk(KERN_NOTICE "max_ino=%ld\n", max_ino);
-+ printk(KERN_NOTICE "max_ino=%lu\n", max_ino);
- }
- /* Avoid freeing blocks if we got a bad deleted inode */
- if (inode && inode->i_nlink == 0)
---- linux/fs/ext3/namei.c.orig Sat Oct 19 11:42:45 2002
-+++ linux/fs/ext3/namei.c Sat Jan 4 12:13:27 2003
-@@ -716,10 +716,10 @@ int ext3_orphan_del(handle_t *handle, st
- {
- struct list_head *prev;
- struct ext3_sb_info *sbi;
-- ino_t ino_next;
-+ unsigned long ino_next;
- struct ext3_iloc iloc;
- int err = 0;
--
-+
- lock_super(inode->i_sb);
- if (list_empty(&inode->u.ext3_i.i_orphan)) {
- unlock_super(inode->i_sb);
-@@ -730,7 +730,7 @@ int ext3_orphan_del(handle_t *handle, st
- prev = inode->u.ext3_i.i_orphan.prev;
- sbi = EXT3_SB(inode->i_sb);
-
-- jbd_debug(4, "remove inode %ld from orphan list\n", inode->i_ino);
-+ jbd_debug(4, "remove inode %lu from orphan list\n", inode->i_ino);
-
- list_del(&inode->u.ext3_i.i_orphan);
- INIT_LIST_HEAD(&inode->u.ext3_i.i_orphan);
-@@ -741,13 +741,13 @@ int ext3_orphan_del(handle_t *handle, st
- * list in memory. */
- if (!handle)
- goto out;
--
-+
- err = ext3_reserve_inode_write(handle, inode, &iloc);
- if (err)
- goto out_err;
-
- if (prev == &sbi->s_orphan) {
-- jbd_debug(4, "superblock will point to %ld\n", ino_next);
-+ jbd_debug(4, "superblock will point to %lu\n", ino_next);
- BUFFER_TRACE(sbi->s_sbh, "get_write_access");
- err = ext3_journal_get_write_access(handle, sbi->s_sbh);
- if (err)
-@@ -758,8 +758,8 @@ int ext3_orphan_del(handle_t *handle, st
- struct ext3_iloc iloc2;
- struct inode *i_prev =
- list_entry(prev, struct inode, u.ext3_i.i_orphan);
--
-- jbd_debug(4, "orphan inode %ld will point to %ld\n",
-+
-+ jbd_debug(4, "orphan inode %lu will point to %lu\n",
- i_prev->i_ino, ino_next);
- err = ext3_reserve_inode_write(handle, i_prev, &iloc2);
- if (err)
-@@ -774,7 +774,7 @@ int ext3_orphan_del(handle_t *handle, st
- if (err)
- goto out_brelse;
-
--out_err:
-+out_err:
- ext3_std_error(inode->i_sb, err);
- out:
- unlock_super(inode->i_sb);
---- linux/include/linux/ext3_fs.h.orig Thu Jan 2 16:10:24 2003
-+++ linux/include/linux/ext3_fs.h Sat Jan 4 12:25:41 2003
-@@ -622,7 +622,7 @@ extern int ext3_sync_file (struct file *
- /* ialloc.c */
- extern struct inode * ext3_new_inode (handle_t *, const struct inode *, int);
- extern void ext3_free_inode (handle_t *, struct inode *);
--extern struct inode * ext3_orphan_get (struct super_block *, ino_t);
-+extern struct inode * ext3_orphan_get (struct super_block *, unsigned long);
- extern unsigned long ext3_count_free_inodes (struct super_block *);
- extern void ext3_check_inodes_bitmap (struct super_block *);
- extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
+++ /dev/null
---- lustre/extN/inode.orig.c 2002-12-29 18:48:56.000000000 +0800
-+++ lustre/extN/inode.c 2002-12-29 19:17:24.000000000 +0800
-@@ -2728,3 +2728,85 @@
- * here, in extN_aops_journal_start() to ensure that the forthcoming "see if we
- * need to extend" test in extN_prepare_write() succeeds.
- */
-+
-+/* for each block: 1 ind + 1 dind + 1 tind
-+ * for each block: 3 bitmap blocks
-+ * for each block: 3 group descriptor blocks
-+ * i inode block
-+ * 1 superblock
-+ * 2 * EXTN_SINGLEDATA_TRANS_BLOCKS for the quote files
-+ * ((1+1+1) * 3 * nblocks) + 1 + 1 + 2 * EXTN_SINGLEDATA_TRANS_BLOCKS
-+ *
-+ * XXX assuming:
-+ * (1) fs logic block size == page size
-+ * (2) extN in writeback mode
-+ */
-+static inline int extN_san_write_trans_blocks(int nblocks)
-+{
-+ int ret;
-+
-+ ret = (1 + 1 + 1) * 3 * nblocks + 1 + 1;
-+
-+#ifdef CONFIG_QUOTA
-+ ret += 2 * EXTN_SINGLEDATA_TRANS_BLOCKS;
-+#endif
-+
-+ return ret;
-+}
-+
-+/* Alloc blocks for an inode, while don't create any buffer/page
-+ * for data I/O; set the inode size if file is extended.
-+ *
-+ * @inode: target inode
-+ * @blocks: array of logic block number
-+ * @nblocks: how many blocks need be alloced
-+ * @newsize: new filesize we should set
-+ *
-+ * return: 0 success, otherwise failed
-+ * (*blocks) contains physical block number alloced
-+ *
-+ * XXX this assume the fs block size == page size
-+ */
-+int extN_prep_san_write(struct inode *inode, long *blocks,
-+ int nblocks, loff_t newsize)
-+{
-+ handle_t *handle;
-+ struct buffer_head bh_tmp;
-+ int needed_blocks;
-+ int i, ret = 0, ret2;
-+
-+ needed_blocks = extN_san_write_trans_blocks(nblocks);
-+
-+ lock_kernel();
-+ handle = extN_journal_start(inode, needed_blocks);
-+ if (IS_ERR(handle)) {
-+ unlock_kernel();
-+ return PTR_ERR(handle);
-+ }
-+ unlock_kernel();
-+
-+ /* alloc blocks one by one */
-+ for (i = 0; i < nblocks; i++) {
-+ ret = extN_get_block_handle(handle, inode, blocks[i],
-+ &bh_tmp, 1);
-+ if (ret)
-+ break;
-+
-+ blocks[i] = bh_tmp.b_blocknr;
-+ }
-+
-+ /* set inode size if needed */
-+ if (!ret && (newsize > inode->i_size)) {
-+ inode->i_size = newsize;
-+ extN_mark_inode_dirty(handle, inode);
-+ }
-+
-+ lock_kernel();
-+ ret2 = extN_journal_stop(handle, inode);
-+ unlock_kernel();
-+
-+ if (!ret)
-+ ret = ret2;
-+ return ret;
-+}
-+EXPORT_SYMBOL(extN_prep_san_write);