sanlock: add flags to specify sector size
Add flags for specifying lease alignment and sector size
to sanlock_write_lockspace() and sanlock_write_resource():
ALIGN1M - create 1MB lockspace/resource which uses
512 byte sector size i/o.
ALIGN8M - create 8MB lockspace/resource which uses
4096 byte sector size i/o.
When neither flag is set, sanlock uses the existing method
for determining alignment and sector size:
. On block devices, the sector size reported by libblkid.
. On files, always choose 512 byte sector size.
The new flags are returned by read_lockspace/read_resource,
regardless of whether they were used with write. The
sanlock_align() call continues to report the same values
as before, which is the size that will be used when no
ALIGN flag is given. sanlock_align() can no longer be used
to determine the alignment of an existing lockspace/resource.
If a lockspace/resource is created with ALIGN8M on a file,
it will not be usable by previous versions of sanlock.
The sector size is included in the ondisk structures for
lockspaces/resources as before. sanlock now reads this
value to determine the sector size to use with a
lockspace/resource. (In some cases, this requires an
extra disk read.)