Commit Graph

16882 Commits

Author SHA1 Message Date
Brian Behlendorf 066296b078 Merge branch 'linux-have-uio-rw' into refs/top-bases/linux-zfs-branch 2009-10-15 16:44:28 -07:00
Brian Behlendorf 1fd6e4326e Merge commit 'refs/top-bases/linux-have-uio-rw' into linux-have-uio-rw 2009-10-15 16:44:26 -07:00
Brian Behlendorf 89d78d3a0e Merge commit 'refs/top-bases/linux-debug-zerocopy' into linux-debug-zerocopy 2009-10-15 16:44:25 -07:00
Brian Behlendorf 79f002a4a3 Merge branch 'linux-have-sysevent' into refs/top-bases/linux-zfs-branch 2009-10-15 16:44:15 -07:00
Brian Behlendorf 0ebe5a0462 Merge commit 'refs/top-bases/linux-have-sysevent' into linux-have-sysevent 2009-10-15 16:44:14 -07:00
Brian Behlendorf 05a70f9b9c Merge commit 'refs/top-bases/linux-kernel-module' into linux-kernel-module 2009-10-15 16:44:13 -07:00
Brian Behlendorf e21206239f Merge branch 'linux-have-spl-debug' into refs/top-bases/linux-zfs-branch 2009-10-15 16:44:03 -07:00
Brian Behlendorf 6d82040da7 Merge commit 'refs/top-bases/linux-have-spl-debug' into linux-have-spl-debug 2009-10-15 16:44:01 -07:00
Brian Behlendorf 46f26aa8e1 Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2009-10-15 16:43:55 -07:00
Brian Behlendorf 4353a3cbf9 Merge commit 'refs/top-bases/linux-have-mntent' into linux-have-mntent 2009-10-15 16:43:53 -07:00
Brian Behlendorf 0826192db7 Merge branch 'linux-have-fm' into refs/top-bases/linux-zfs-branch 2009-10-15 16:43:48 -07:00
Brian Behlendorf b93807aae8 Merge commit 'refs/top-bases/linux-have-fm' into linux-have-fm 2009-10-15 16:43:46 -07:00
Brian Behlendorf c1b4a1ef92 Merge branch 'linux-docs' into refs/top-bases/linux-zfs-branch 2009-10-15 16:43:40 -07:00
Brian Behlendorf 199a5fa8e5 Merge commit 'refs/top-bases/linux-docs' into linux-docs 2009-10-15 16:43:38 -07:00
Brian Behlendorf 48d1b0c5ab Cleanly integrate ZFS tools with libblkid.
The majority of this this patch concerns itself with doing a direct
replacement of Solaris's libdiskmgt library with libblkid+libefi.
You'll notice that this patch removes all libdiskmgt code instead of
ifdef'ing it out.  This was done to minimize any confusion when reading
the code because it seems unlikely we will ever port libdiskmgt to Linux.

Despite the replacement the behavior of the tools should have remained
the same with one exception.  For the moment, we are unable to check
the partitions of devices which have an MBR style partition table when
creating a filesystem.  If a non-efi partition sceme is detected on a
whole disk device we prompt the user to explicity use the force option.
It would not be a ton of work to make the tool aware of MBR style
partitions if this becomes a problem.

I've done basic sanity checking for various configurations and all
the issues I'm aware of have been addressed.  Even things like blkid
misidentifing a disk as ext3 when it is added to a zfs pool.  I'm
careful to always zero out the first 4k of any new zfs partition.  That
all said this is all new code and while it looks like it's working right
for me we should keep an eye on it for any strange behavior.
2009-10-15 16:28:47 -07:00
Brian Behlendorf a09d33e929 Update build system for libblkid integration 2009-10-15 16:25:18 -07:00
Brian Behlendorf 00aa119139 Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch 2009-10-15 09:43:17 -07:00
Brian Behlendorf 733c119cef Remove linux-have-libdiskmgt from dependency list. 2009-10-15 09:39:27 -07:00
Brian Behlendorf d5c9d50ffd Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch 2009-10-15 09:38:54 -07:00
Brian Behlendorf ec3ebaf978 Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch 2009-10-15 09:38:52 -07:00
Brian Behlendorf 702a78ed33 Merge branch 'linux-have-libdiskmgt' into refs/top-bases/linux-zfs-branch 2009-10-15 09:38:51 -07:00
Brian Behlendorf 172ca0a7f1 Remove topic branch linux-have-libdiskmgt 2009-10-15 09:34:17 -07:00
Brian Behlendorf ee1de79aa3 Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch 2009-10-14 16:54:45 -07:00
Brian Behlendorf 41f3beca71 Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch 2009-10-14 16:54:43 -07:00
Brian Behlendorf 553e366ce5 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2009-10-14 16:54:42 -07:00
Brian Behlendorf 22925be29c Add in missing header required by libefi. 2009-10-14 16:50:26 -07:00
Brian Behlendorf 4a704a81ac Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch 2009-10-14 16:32:19 -07:00
Brian Behlendorf 274717b31e Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch 2009-10-14 16:32:17 -07:00
Brian Behlendorf c4726e7ad2 Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch 2009-10-14 16:32:16 -07:00
Brian Behlendorf ef2618aff8 Merge branch 'linux-kernel-disk' into refs/top-bases/linux-zfs-branch 2009-10-14 16:32:15 -07:00
Brian Behlendorf 992be351d5 Changes required to integrate libefi in to Linux.
The major change here is to fix up libefi to be linux aware.  For
the most part this wasn't too hard but there were a few major issues.

First off I needed to handle the DKIOCGMEDIAINFO and DKIOCINFO ioctls.
There is no direct equivilant for these ioctls under linux.  To handle
this I added wrapper functions which under Solaris simple call the ioctls.
But under Linux dig around the system a little bit getting the needed
info to fill in the requested structures.

Secondly the efi_ioctl() call was adapted such that under linux it directly
read or writes out the partition table.  Under Solaris this work was
handed off to the kernel via an ioctl.  In the efi_write() case we also
ensure we prompt the kernel via BLKRRPART to re-scan the new partition
table.  The libefi generated partition tables are correct but older
versions of ~parted-1.8.1 can not read them without a small patch.
The kernel and fdisk are able to read them just fine.

Thirdly efi_alloc_and_init() which is used by zpool to determine if a
device is a 'wholedisk' was updated to be linux aware.  This check is
performed by using the partition number for the device, which the
partition number is 0 on linux it is a 'wholedisk'.  However, certain
device type such as the loopback and ram disks needed to be excluded
because they do not support partitioning.

Forthly the zpool command was made symlink aware so it can correctly
resolve udev entries such as /dev/disk/by-*/*.  This symlinks are
fully expanded ensuring all block devices are recognized.  When a
when a 'wholedisk' block device is detected we now properly write
out an efi label and place zfs in the first partition (0th slice).
This partition is created 1MiB in to the disk to ensure it is aligned
nicely with all high end block devices I'm aware of.

This all works for me now but it did take quite a bit of work to get
it all sorted out.  It would not surprise me if certain special cases
were missed so we should keep any eye of for any odd behavior.
2009-10-14 16:07:48 -07:00
Brian Behlendorf 18eee5d03f Fix sector size and capacity calculation.
Remove the hard coded 512 byte SECTOR_SIZE and replace it with
bdev_hardsect_size() to get the correct hardware sector size.

Usage of get_capacity() was incorrect.  We the block_device
references a partition we need to return bdev->part->nr_sects.
If get_capacity() is used the entire device size will be returned
ignoring partition information.  This is however the correct thing
to do when the block device in question has not partition table.
2009-10-14 16:02:51 -07:00
Brian Behlendorf d1e18d0e3b Refresh autogen products 2009-10-14 16:00:33 -07:00
Brian Behlendorf 81609e1773 Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch 2009-10-14 15:59:46 -07:00
Brian Behlendorf 4ba7c7846f Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch 2009-10-14 15:59:44 -07:00
Brian Behlendorf a09b94a91b Merge branch 'linux-have-idmap' into refs/top-bases/linux-zfs-branch 2009-10-14 15:59:43 -07:00
Brian Behlendorf a5761f04b8 Merge commit 'refs/top-bases/linux-have-idmap' into linux-have-idmap 2009-10-14 15:59:42 -07:00
Brian Behlendorf bb33ac4da0 Merge branch 'linux-ztest' into refs/top-bases/linux-zfs-branch 2009-10-14 15:59:36 -07:00
Brian Behlendorf 2bd515bc2d Merge commit 'refs/top-bases/linux-ztest' into linux-ztest 2009-10-14 15:59:34 -07:00
Brian Behlendorf d8fbc78d5c Merge branch 'linux-have-zpl' into refs/top-bases/linux-zfs-branch 2009-10-14 15:59:28 -07:00
Brian Behlendorf c56b485f66 Merge commit 'refs/top-bases/linux-have-zpl' into linux-have-zpl 2009-10-14 15:59:26 -07:00
Brian Behlendorf 3c721bdb5c Merge branch 'linux-unused' into refs/top-bases/linux-zfs-branch 2009-10-14 15:59:20 -07:00
Brian Behlendorf 9e729be801 Merge commit 'refs/top-bases/linux-unused' into linux-unused 2009-10-14 15:59:18 -07:00
Brian Behlendorf f4f805a70e Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2009-10-14 15:59:13 -07:00
Brian Behlendorf 84ed1fee34 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2009-10-14 15:59:11 -07:00
Brian Behlendorf 94a5685acf Merge branch 'linux-zpios' into refs/top-bases/linux-zfs-branch 2009-10-14 15:59:05 -07:00
Brian Behlendorf 1e5d0220d0 Merge commit 'refs/top-bases/linux-zpios' into linux-zpios 2009-10-14 15:59:03 -07:00
Brian Behlendorf 3123078236 Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch 2009-10-14 15:58:57 -07:00
Brian Behlendorf 245e7692f7 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2009-10-14 15:58:55 -07:00
Brian Behlendorf b180dca0dd Merge branch 'linux-symbol-collisions' into refs/top-bases/linux-zfs-branch 2009-10-14 15:58:49 -07:00