floppy driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I'm stuck on an issue related to buffer.c in kernel/fs.  My goal is to
create synchronous reads and writes on the floppy (for a specialized
kernel).  I thought some changes to bread() would be enough, but it didn't
fix my problems (and instead created more).  The problem is that if I cat
something on a disk, take it out change it and then put it back (no
umounts) it prints out the old file.  Is this because of something lower
level than the buffers?  Maybe something related to DMA transfers?

These are the changes I made to bread in buffer.c:

struct buffer_head * bread(kdev_t dev, int block, int size)
{
        struct buffer_head * bh;
        bh = getblk(dev, block, size);

        /* DiagOS */
        if (MAJOR(dev) == 2) {
                mark_buffer_uptodate(bh, 0);
                printk("buffer was marked as not up to date\n");
        }
        /* end DiagOS */

        if (buffer_uptodate(bh)) {
                printk(" *** buffer was read as up to date *** \n");
                return bh;
        }

        ll_rw_block(READ, 1, &bh);
        wait_on_buffer(bh);
        if (buffer_uptodate(bh)) {
                printk(" *** buffer was re-read *** \n");
                return bh;
        }
        brelse(bh);
        return NULL;
}


Am I missing something here?  Do I need to take the buffer head out of the
list that it's in also?

Any help would be greatly appreciated.

David

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux