summaryrefslogtreecommitdiffstats
path: root/drivers/block/rd.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-07-20 14:56:40 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-07-20 14:56:40 +0000
commite308faf24f68e262d92d294a01ddca7a17e76762 (patch)
tree22c47cb315811834861f013067878ff664e95abd /drivers/block/rd.c
parent30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff)
Sync with Linux 2.1.46.
Diffstat (limited to 'drivers/block/rd.c')
-rw-r--r--drivers/block/rd.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 4ac6c0c41..7d7a3931c 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -360,10 +360,10 @@ identify_ramdisk_image(kdev_t device, struct file *fp, int start_block))
* Read block 0 to test for gzipped kernel
*/
if (fp->f_op->llseek)
- fp->f_op->llseek(fp->f_inode, fp, start_block * BLOCK_SIZE, 0);
+ fp->f_op->llseek(fp->f_dentry->d_inode, fp, start_block * BLOCK_SIZE, 0);
fp->f_pos = start_block * BLOCK_SIZE;
- fp->f_op->read(fp->f_inode, fp, buf, size);
+ fp->f_op->read(fp->f_dentry->d_inode, fp, buf, size);
/*
* If it matches the gzip magic numbers, return -1
@@ -390,11 +390,11 @@ identify_ramdisk_image(kdev_t device, struct file *fp, int start_block))
* Read block 1 to test for minix and ext2 superblock
*/
if (fp->f_op->llseek)
- fp->f_op->llseek(fp->f_inode, fp,
+ fp->f_op->llseek(fp->f_dentry->d_inode, fp,
(start_block+1) * BLOCK_SIZE, 0);
fp->f_pos = (start_block+1) * BLOCK_SIZE;
- fp->f_op->read(fp->f_inode, fp, buf, size);
+ fp->f_op->read(fp->f_dentry->d_inode, fp, buf, size);
/* Try minix */
if (minixsb->s_magic == MINIX_SUPER_MAGIC ||
@@ -421,7 +421,7 @@ identify_ramdisk_image(kdev_t device, struct file *fp, int start_block))
done:
if (fp->f_op->llseek)
- fp->f_op->llseek(fp->f_inode, fp, start_block * BLOCK_SIZE, 0);
+ fp->f_op->llseek(fp->f_dentry->d_inode, fp, start_block * BLOCK_SIZE, 0);
fp->f_pos = start_block * BLOCK_SIZE;
if ((nblocks > 0) && blk_size[MAJOR(device)]) {
@@ -444,8 +444,9 @@ done:
*/
__initfunc(static void rd_load_image(kdev_t device,int offset))
{
- struct inode inode, out_inode;
+ struct inode inode, out_inode;
struct file infile, outfile;
+ struct dentry in_dentry, out_dentry;
unsigned short fs;
kdev_t ram_device;
int nblocks, i;
@@ -457,15 +458,19 @@ __initfunc(static void rd_load_image(kdev_t device,int offset))
memset(&infile, 0, sizeof(infile));
memset(&inode, 0, sizeof(inode));
+ memset(&in_dentry, 0, sizeof(in_dentry));
inode.i_rdev = device;
infile.f_mode = 1; /* read only */
- infile.f_inode = &inode;
+ infile.f_dentry = &in_dentry;
+ in_dentry.d_inode = &inode;
memset(&outfile, 0, sizeof(outfile));
memset(&out_inode, 0, sizeof(out_inode));
+ memset(&out_dentry, 0, sizeof(out_dentry));
out_inode.i_rdev = ram_device;
outfile.f_mode = 3; /* read/write */
- outfile.f_inode = &out_inode;
+ outfile.f_dentry = &out_dentry;
+ out_dentry.d_inode = &out_inode;
if (blkdev_open(&inode, &infile) != 0) return;
if (blkdev_open(&out_inode, &outfile) != 0) return;
@@ -506,9 +511,9 @@ __initfunc(static void rd_load_image(kdev_t device,int offset))
printk(KERN_NOTICE "RAMDISK: Loading %d blocks into ram disk... ", nblocks);
for (i=0; i < nblocks; i++) {
- infile.f_op->read(infile.f_inode, &infile, buf,
+ infile.f_op->read(infile.f_dentry->d_inode, &infile, buf,
BLOCK_SIZE);
- outfile.f_op->write(outfile.f_inode, &outfile, buf,
+ outfile.f_op->write(outfile.f_dentry->d_inode, &outfile, buf,
BLOCK_SIZE);
if (!(i % 16)) {
printk("%c\b", rotator[rotate & 0x3]);
@@ -637,7 +642,7 @@ __initfunc(static int fill_inbuf(void))
{
if (exit_code) return -1;
- insize = crd_infp->f_op->read(crd_infp->f_inode, crd_infp,
+ insize = crd_infp->f_op->read(crd_infp->f_dentry->d_inode, crd_infp,
inbuf, INBUFSIZ);
if (insize == 0) return -1;
@@ -656,7 +661,7 @@ __initfunc(static void flush_window(void))
unsigned n;
uch *in, ch;
- crd_outfp->f_op->write(crd_outfp->f_inode, crd_outfp, window,
+ crd_outfp->f_op->write(crd_outfp->f_dentry->d_inode, crd_outfp, window,
outcnt);
in = window;
for (n = 0; n < outcnt; n++) {