Re: [PATCH v2 29/34] bdev: make struct bdev_handle private to the block layer

Christoph Hellwig
2024-01-29T16:22:06Z

> + ret = devcgroup_check_permission(
> + DEVCG_DEV_BLOCK, MAJOR(dev), MINOR(dev),
> + ((mode & BLK_OPEN_READ) ? DEVCG_ACC_READ : 0) |
> + ((mode & BLK_OPEN_WRITE) ? DEVCG_ACC_WRITE : 0));

Somewhat weird formatting here with DEVCG_DEV_BLOCK not on the
same line as the opening brace and the extra indentation after
the |. I would have expected something like:

ret = devcgroup_check_permission(DEVCG_DEV_BLOCK,
MAJOR(dev), MINOR(dev),
((mode & BLK_OPEN_READ) ? DEVCG_ACC_READ : 0) |
((mode & BLK_OPEN_WRITE) ? DEVCG_ACC_WRITE : 0));

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>