vfs: support STATX_DIOALIGN on block devices
Add support for STATX_DIOALIGN to block devices, so that direct I/O alignment restrictions are exposed to userspace in a generic way. Note that this breaks the tradition of stat operating only on the block device node, not the block device itself. However, it was felt that doing this is preferable, in order to make the interface useful and avoid needing separate interfaces for regular files and block devices. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org> Link: https://lore.kernel.org/r/20220827065851.135710-3-ebiggers@kernel.org
This commit is contained in:
@@ -1498,6 +1498,7 @@ int sync_blockdev(struct block_device *bdev);
|
||||
int sync_blockdev_range(struct block_device *bdev, loff_t lstart, loff_t lend);
|
||||
int sync_blockdev_nowait(struct block_device *bdev);
|
||||
void sync_bdevs(bool wait);
|
||||
void bdev_statx_dioalign(struct inode *inode, struct kstat *stat);
|
||||
void printk_all_partitions(void);
|
||||
#else
|
||||
static inline void invalidate_bdev(struct block_device *bdev)
|
||||
@@ -1514,6 +1515,9 @@ static inline int sync_blockdev_nowait(struct block_device *bdev)
|
||||
static inline void sync_bdevs(bool wait)
|
||||
{
|
||||
}
|
||||
static inline void bdev_statx_dioalign(struct inode *inode, struct kstat *stat)
|
||||
{
|
||||
}
|
||||
static inline void printk_all_partitions(void)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user