All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/2] libswap: add two methods to create swapfile
Date: Thu, 21 Mar 2024 13:41:41 +0100	[thread overview]
Message-ID: <20240321124141.GA551159@pevik> (raw)
In-Reply-To: <CAEemH2ebMOLj+uco1JCr-bhqk-OF87YXG1rH0VjdPLe_PUpwfg@mail.gmail.com>

...
> > > -int make_swapfile(const char *swapfile, int blocks, int safe);
> > > +int make_swapfile(const char *swapfile, unsigned int num,
> > > +                     int safe, enum swapfile_method method);
> > I wonder if it would help to add const char *file, const int lineno here.

> > > +
> > > +#define MAKE_SWAPFILE_SIZE(swapfile, size, safe) \
> > > +    make_swapfile(swapfile, size, safe, SWAPFILE_BY_SIZE)
> > nit: I like the name but one have to search which units (kB vs. MB vs. GB)
> > are used.


> Maybe we can add code comments like:

> +/**
> + * Macro to create swapfile size in megabytes (MB)
> + */
>  #define MAKE_SWAPFILE_SIZE(swapfile, size, safe) \
>     ...

> +/**
> + * Macro to create swapfile size in block numbers
> + */
>  #define MAKE_SWAPFILE_BLKS(swapfile, blocks, safe) \
>       ...

Sure, that's enough.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-03-21 12:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 10:08 [LTP] [PATCH v2 0/2] add method to create swapfile by MB size Li Wang
2024-03-19 10:08 ` [LTP] [PATCH v2 1/2] libswap: add two methods to create swapfile Li Wang
2024-03-20  7:31   ` Petr Vorel
2024-03-21  9:49     ` Li Wang
2024-03-21 12:41       ` Petr Vorel [this message]
2024-03-19 10:08 ` [LTP] [PATCH v2 2/2] swapon01: create 128MB swapfile Li Wang
2024-03-20  7:32   ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240321124141.GA551159@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.