Re: [PATCH 06/12] jbd2: cleanup load_superblock()

Jan Kara
2023-08-03T14:29:01Z

On Tue 04-07-23 21:42:27, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@huawei.com>
>
> Rename load_superblock() to journal_load_superblock(), move getting and
> reading superblock from journal_init_common() and
> journal_get_superblock() to this function, and also rename
> journal_get_superblock() to journal_check_superblock(), make it a pure
> check helper to check superblock validity from disk.
>
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>

Two comments below:

> -/*
> - * Read the superblock for a given journal, performing initial
> +/**
> + * journal_check_superblock()
> + * @journal: journal to act on.
> + *
> + * Check the superblock for a given journal, performing initial
> * validation of the format.
> */

We rarely use kerneldoc style comments for local functions. In particular
in this place where there's only one user, it seems a bit superfluous. But
if you want to keep it, I'm not against it but then the proper kerneldoc
format should be used. In particular, it should be like:

/**
* journal_check_superblock - check validity of journal superblock
* @journal: journal to act on.
*
* ... description ... and include here also description of return values
*/

The same comment applies to journal_load_superblock() below.

Honza

> -/*
> +/**
> + * journal_load_superblock()
> + * @journal: journal to act on.
> + *
> * Load the on-disk journal superblock and read the key fields into the
> * journal_t.
> */
> -static int load_superblock(journal_t *journal)
> +static int journal_load_superblock(journal_t *journal)
--
Jan Kara <jack@suse.com>
SUSE Labs, CR