1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
diff -Nur linux-2.4.18-2.27/fs/hpfs/buffer.c linux-2.4.6/fs/hpfs/buffer.c
--- linux-2.4.18-2.27/fs/hpfs/buffer.c Mon Feb 25 20:38:08 2002
+++ linux-2.4.6/fs/hpfs/buffer.c Sat Dec 9 20:43:03 2000
@@ -122,9 +122,12 @@
void *hpfs_map_sector(struct super_block *s, unsigned secno, struct buffer_head **bhp,
int ahead)
{
+ kdev_t dev = s->s_dev;
struct buffer_head *bh;
- *bhp = bh = sb_bread(s, secno);
+ if (!ahead || secno + ahead >= s->s_hpfs_fs_size)
+ *bhp = bh = bread(dev, secno, 512);
+ else *bhp = bh = bread(dev, secno, 512);
if (bh != NULL)
return bh->b_data;
else {
@@ -140,7 +143,7 @@
struct buffer_head *bh;
/*return hpfs_map_sector(s, secno, bhp, 0);*/
- if ((*bhp = bh = sb_getblk(s, secno)) != NULL) {
+ if ((*bhp = bh = getblk(s->s_dev, secno, 512)) != NULL) {
if (!buffer_uptodate(bh)) wait_on_buffer(bh);
mark_buffer_uptodate(bh, 1);
return bh->b_data;
@@ -155,6 +158,7 @@
void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffer_head *qbh,
int ahead)
{
+ kdev_t dev = s->s_dev;
struct buffer_head *bh;
char *data;
@@ -169,22 +173,24 @@
goto bail;
}
- qbh->bh[0] = bh = sb_bread(s, secno);
+ if (!ahead || secno + 4 + ahead > s->s_hpfs_fs_size)
+ qbh->bh[0] = bh = bread(dev, secno, 512);
+ else qbh->bh[0] = bh = bread(dev, secno, 512);
if (!bh)
goto bail0;
memcpy(data, bh->b_data, 512);
- qbh->bh[1] = bh = sb_bread(s, secno + 1);
+ qbh->bh[1] = bh = bread(dev, secno + 1, 512);
if (!bh)
goto bail1;
memcpy(data + 512, bh->b_data, 512);
- qbh->bh[2] = bh = sb_bread(s, secno + 2);
+ qbh->bh[2] = bh = bread(dev, secno + 2, 512);
if (!bh)
goto bail2;
memcpy(data + 2 * 512, bh->b_data, 512);
- qbh->bh[3] = bh = sb_bread(s, secno + 3);
+ qbh->bh[3] = bh = bread(dev, secno + 3, 512);
if (!bh)
goto bail3;
memcpy(data + 3 * 512, bh->b_data, 512);
diff -Nur linux-2.4.18-2.27/fs/hpfs/file.c linux-2.4.6/fs/hpfs/file.c
--- linux-2.4.18-2.27/fs/hpfs/file.c Mon Aug 13 02:37:53 2001
+++ linux-2.4.6/fs/hpfs/file.c Fri Dec 29 23:07:57 2000
@@ -11,8 +11,6 @@
#include <linux/smp_lock.h>
#include "hpfs_fn.h"
-#define BLOCKS(size) (((size) + 511) >> 9)
-
/* HUH? */
int hpfs_open(struct inode *i, struct file *f)
{
@@ -48,7 +46,7 @@
unsigned n, disk_secno;
struct fnode *fnode;
struct buffer_head *bh;
- if (BLOCKS(inode->u.hpfs_i.mmu_private) <= file_secno) return 0;
+ if (((inode->i_size + 511) >> 9) <= file_secno) return 0;
n = file_secno - inode->i_hpfs_file_sec;
if (n < inode->i_hpfs_n_secs) return inode->i_hpfs_disk_sec + n;
if (!(fnode = hpfs_map_fnode(inode->i_sb, inode->i_ino, &bh))) return 0;
diff -Nur linux-2.4.18-2.27/fs/hpfs/inode.c linux-2.4.6/fs/hpfs/inode.c
--- linux-2.4.18-2.27/fs/hpfs/inode.c Mon Sep 10 16:31:25 2001
+++ linux-2.4.6/fs/hpfs/inode.c Mon Jan 22 19:40:47 2001
@@ -12,7 +12,6 @@
static struct file_operations hpfs_file_ops =
{
- llseek: generic_file_llseek,
read: generic_file_read,
write: hpfs_file_write,
mmap: generic_file_mmap,
@@ -300,12 +299,10 @@
{
struct inode *inode = dentry->d_inode;
int error;
- if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size)
- return -EINVAL;
+ if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) return -EINVAL;
if (inode->i_sb->s_hpfs_root == inode->i_ino) return -EINVAL;
if ((error = inode_change_ok(inode, attr))) return error;
- error = inode_setattr(inode, attr);
- if (error) return error;
+ inode_setattr(inode, attr);
hpfs_write_inode(inode);
return 0;
}
diff -Nur linux-2.4.18-2.27/fs/hpfs/super.c linux-2.4.6/fs/hpfs/super.c
--- linux-2.4.18-2.27/fs/hpfs/super.c Mon Feb 25 20:38:08 2002
+++ linux-2.4.6/fs/hpfs/super.c Tue Jun 12 04:15:27 2001
@@ -3,7 +3,7 @@
*
* Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz), 1998-1999
*
- * mounting, unmounting, error handling
+ * mouning, unmounting, error handling
*/
#include <linux/string.h>
|