1 diff -Nur linux-2.4.18-2.27/fs/hpfs/buffer.c linux-2.4.6/fs/hpfs/buffer.c
2 --- linux-2.4.18-2.27/fs/hpfs/buffer.c Mon Feb 25 20:38:08 2002
3 +++ linux-2.4.6/fs/hpfs/buffer.c Sat Dec 9 20:43:03 2000
5 void *hpfs_map_sector(struct super_block *s, unsigned secno, struct buffer_head **bhp,
8 + kdev_t dev = s->s_dev;
9 struct buffer_head *bh;
11 - *bhp = bh = sb_bread(s, secno);
12 + if (!ahead || secno + ahead >= s->s_hpfs_fs_size)
13 + *bhp = bh = bread(dev, secno, 512);
14 + else *bhp = bh = bread(dev, secno, 512);
19 struct buffer_head *bh;
20 /*return hpfs_map_sector(s, secno, bhp, 0);*/
22 - if ((*bhp = bh = sb_getblk(s, secno)) != NULL) {
23 + if ((*bhp = bh = getblk(s->s_dev, secno, 512)) != NULL) {
24 if (!buffer_uptodate(bh)) wait_on_buffer(bh);
25 mark_buffer_uptodate(bh, 1);
28 void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffer_head *qbh,
31 + kdev_t dev = s->s_dev;
32 struct buffer_head *bh;
39 - qbh->bh[0] = bh = sb_bread(s, secno);
40 + if (!ahead || secno + 4 + ahead > s->s_hpfs_fs_size)
41 + qbh->bh[0] = bh = bread(dev, secno, 512);
42 + else qbh->bh[0] = bh = bread(dev, secno, 512);
45 memcpy(data, bh->b_data, 512);
47 - qbh->bh[1] = bh = sb_bread(s, secno + 1);
48 + qbh->bh[1] = bh = bread(dev, secno + 1, 512);
51 memcpy(data + 512, bh->b_data, 512);
53 - qbh->bh[2] = bh = sb_bread(s, secno + 2);
54 + qbh->bh[2] = bh = bread(dev, secno + 2, 512);
57 memcpy(data + 2 * 512, bh->b_data, 512);
59 - qbh->bh[3] = bh = sb_bread(s, secno + 3);
60 + qbh->bh[3] = bh = bread(dev, secno + 3, 512);
63 memcpy(data + 3 * 512, bh->b_data, 512);
64 diff -Nur linux-2.4.18-2.27/fs/hpfs/file.c linux-2.4.6/fs/hpfs/file.c
65 --- linux-2.4.18-2.27/fs/hpfs/file.c Mon Aug 13 02:37:53 2001
66 +++ linux-2.4.6/fs/hpfs/file.c Fri Dec 29 23:07:57 2000
68 #include <linux/smp_lock.h>
71 -#define BLOCKS(size) (((size) + 511) >> 9)
74 int hpfs_open(struct inode *i, struct file *f)
77 unsigned n, disk_secno;
79 struct buffer_head *bh;
80 - if (BLOCKS(inode->u.hpfs_i.mmu_private) <= file_secno) return 0;
81 + if (((inode->i_size + 511) >> 9) <= file_secno) return 0;
82 n = file_secno - inode->i_hpfs_file_sec;
83 if (n < inode->i_hpfs_n_secs) return inode->i_hpfs_disk_sec + n;
84 if (!(fnode = hpfs_map_fnode(inode->i_sb, inode->i_ino, &bh))) return 0;
85 diff -Nur linux-2.4.18-2.27/fs/hpfs/inode.c linux-2.4.6/fs/hpfs/inode.c
86 --- linux-2.4.18-2.27/fs/hpfs/inode.c Mon Sep 10 16:31:25 2001
87 +++ linux-2.4.6/fs/hpfs/inode.c Mon Jan 22 19:40:47 2001
90 static struct file_operations hpfs_file_ops =
92 - llseek: generic_file_llseek,
93 read: generic_file_read,
94 write: hpfs_file_write,
95 mmap: generic_file_mmap,
98 struct inode *inode = dentry->d_inode;
100 - if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size)
102 + if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) return -EINVAL;
103 if (inode->i_sb->s_hpfs_root == inode->i_ino) return -EINVAL;
104 if ((error = inode_change_ok(inode, attr))) return error;
105 - error = inode_setattr(inode, attr);
106 - if (error) return error;
107 + inode_setattr(inode, attr);
108 hpfs_write_inode(inode);
111 diff -Nur linux-2.4.18-2.27/fs/hpfs/super.c linux-2.4.6/fs/hpfs/super.c
112 --- linux-2.4.18-2.27/fs/hpfs/super.c Mon Feb 25 20:38:08 2002
113 +++ linux-2.4.6/fs/hpfs/super.c Tue Jun 12 04:15:27 2001
116 * Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz), 1998-1999
118 - * mounting, unmounting, error handling
119 + * mouning, unmounting, error handling
122 #include <linux/string.h>