Re: [PATCH 2 of 8] block: Export I/O topology for block devices and partitions

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

 



Konrad Rzeszutek wrote:
+ * blk_queue_alignment - set alignment for the queue
+ * @q:  the request queue for the device
+ * @alignment:  alignment offset in bytes
+ *
+ * Description:
+ *   Some devices are naturally misaligned to compensate for things like
+ *   the legacy DOS partition table 63-sector offset.  Low-level drivers
+ *   should call this function for devices whose first sector is not
+ *   naturally aligned.
+ */
+void blk_queue_alignment(struct request_queue *q, unsigned int alignment)
+{
+	q->alignment = alignment & (q->granularity - 1);
+	clear_bit(QUEUE_FLAG_MISALIGNED, &q->queue_flags);
+}
+EXPORT_SYMBOL(blk_queue_alignment);
How would low-level drivers know?

Should there be a comment/Documentation blurb on how to remediate a
misaligment? Such as how to modify the partition tables and what to look
for in the BIOS (if anything) to take advantage of 4K sectors?

Is there a corresponding patch for fdisk that understands 4K sectors? Or
is that already covered by it doing ioctl calls on the block device?

We need to update the various tools to deal with this data and prevent misalignment, some of which is going on already.

I am afraid that if you are misaligned, the only remedy would be to tar up your data, recreate an aligned device and then restore :-)

ric

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux