linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [CFT][PATCH] cleanup of partition code
@ 2001-09-30 22:31 Alexander Viro
  2001-09-30 23:28 ` Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Alexander Viro @ 2001-09-30 22:31 UTC (permalink / raw)
  To: linux-kernel

	Folks, _please_ help to test this one.  It switches most of
the fs/partitions/* to use of pagecache, cleans it up and fixes quite
a few holes in that area.

	It should work in all cases when vanilla tree does.  Please,
try it on different partitioning schemes.

	Things to look for:

* Odd IDE disks - victims of EZ-Disk, OnCrack, etc.
* Minix, Solaris, Unixware partitions.  Changes were completely
  straightforward, but it needs testing.
* BSD disklabels.  Should work, but more testing is needed.
* non-x86 variants - Sun disklables, SGI, etc.  Need testing.

	One thing that doesn't work yet is support of Acorn partitions -
I'm switching it to pagecache right now.

	If there's no bug reports it will go into the tree, so _please_
test it now, not after it's in 2.4.11

	Patch is on ftp.math.psu.edu/pub/viro/partition-a-S11-pre1.  It's
against 2.4.11-pre1.  Again, any help with testing is very welcome.


^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [CFT][PATCH] cleanup of partition code
@ 2001-10-02 21:49 Matt_Domsch
  0 siblings, 0 replies; 21+ messages in thread
From: Matt_Domsch @ 2001-10-02 21:49 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel

Alexander:

In the IA-64 port lives the EFI GUID Partition Table (GPT) partitioning
code.  It's not yet merged into the mainline kernel tree.  I've made a
first-stab at a patch to make the GPT code use the page cache, and I'd
appreciate you taking a look.

Start with 2.4.10
apply 2.4.11-pre1
apply your latest partition patch (partition-d-S11-pre1 I think)
apply latest ia64 patch
 (there's one rejection in include/linux/genhd.h that's easy to fix)
apply http://domsch.com/linux/patches/linux-2.4.10-gpt-20011001.patch
apply
http://domsch.com/linux/patches/linux-2.4.10-gpt-pagecache-20011001.patch

The GPT code is in fs/partition/efi.[ch].  I'm concerned about reading a
page or partial page at the end of a disk, particularly an odd-sized disk.
In the pagecache patch I remove the set_blocksize() stuff, as it's not clear
if it's still needed, or if a disk with sectors % PAGE_CACHE_SIZE != 0 can
even read those last sectors.

Reading even the first few sectors fails with these patches, where if I
remove your partition patch and my pagecache patch, it works fine.  I'm
certain it's a bug in my read_lba() code, which could use to be optimized
also.

static size_t
read_lba(struct gendisk *hd, struct block_device *bdev, u64 lba, u8 *buffer,
size_t count)
{

        size_t totalreadcount = 0, bytesread;
        int i, blockstoread, blocksize;
        Sect sect;
        unsigned char *data=NULL;

        if (!hd || !buffer || !count) return 0;

        blocksize = get_hardsect_size(to_kdev_t(bdev->bd_dev));
        blockstoread = count / blocksize;
        if (count % blocksize) blockstoread += 1;
        for (i=0; i<blockstoread; i++) {
                data = read_dev_sector(bdev, lba, &sect);
                if (!data) {
                        put_dev_sector(sect);
                        return totalreadcount;
                }

                bytesread = (count > 512 ? 512 : count);
                memcpy(buffer, data, bytesread);
                put_dev_sector(sect);

                buffer += bytesread;         /* Advance the buffer pointer
*/
                totalreadcount += bytesread; /* Advance the total read count
*/
                count -= bytesread;         /* Subtract bytesread from count
*/
        }

        return totalreadcount;
}

I'd appreciate your pointers.

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Solutions
www.dell.com/linux
#2 Linux Server provider with 17% in the US and 14% Worldwide (IDC)!
#3 Unix provider with 18% in the US (Dataquest)!

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2001-11-07  0:23 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-30 22:31 [CFT][PATCH] cleanup of partition code Alexander Viro
2001-09-30 23:28 ` Tom Rini
2001-10-01  1:57 ` Alexander Viro
2001-10-01  6:54   ` Anton Altaparmakov
2001-11-06 20:25     ` Linux kernel 2.4 and TCP terminations per second Imran Badr
2001-11-06 23:22       ` Alan Cox
2001-11-06 23:34         ` Imran Badr
2001-11-06 23:43           ` Roland Dreier
2001-11-07  0:02             ` Imran Badr
2001-11-06 23:56         ` David Lang
2001-11-07  0:29           ` Alan Cox
2001-10-01 11:40   ` [CFT][PATCH] cleanup of partition code Alexander Viro
2001-10-01  4:22 ` Erik Andersen
2001-10-01  5:27   ` Alexander Viro
2001-10-01  6:04     ` Erik Andersen
2001-10-01  6:48       ` Alexander Viro
2001-10-01  8:03       ` Alexander Viro
2001-10-01  9:06         ` Nick Craig-Wood
2001-10-01 21:11           ` Alex Bligh - linux-kernel
2001-10-01 23:15         ` Erik Andersen
2001-10-02 21:49 Matt_Domsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).