Re: [PATCH v10 1/5] fscrypt: add functions for direct I/O support

Christoph Hellwig
2022-01-20T08:27:49Z

> +/**
> + * fscrypt_dio_unsupported() - check whether a DIO (direct I/O) request is
> + * unsupported due to encryption constraints
> + * @iocb: the file and position the I/O is targeting
> + * @iter: the I/O data segment(s)
> + *
> + * Return: true if DIO is unsupported
> + */
> +bool fscrypt_dio_unsupported(struct kiocb *iocb, struct iov_iter *iter)

I always find non-negated functions easier to follow, i.e. turn this
into fscrypt_dio_supported().

> + /*
> + * Since the granularity of encryption is filesystem blocks, the file
> + * position and total I/O length must be aligned to the filesystem block
> + * size -- not just to the block device's logical block size as is
> + * traditionally the case for DIO on many filesystems (not including
> + * f2fs, which only allows filesystem block aligned DIO anyway).

I would not really mention a specific file system here.