linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Ming Lei <ming.lei@redhat.com>, Ewan Milne <emilne@redhat.com>
Subject: [PATCH V2 1/4] block: define parsed_partitions.flags as 'unsigned char'
Date: Wed, 24 Feb 2021 11:58:27 +0800	[thread overview]
Message-ID: <20210224035830.990123-2-ming.lei@redhat.com> (raw)
In-Reply-To: <20210224035830.990123-1-ming.lei@redhat.com>

So far, only 3 partition flags are used, it is enough to hold it in
'unsigned char'.

Cc: Ewan Milne <emilne@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/partitions/check.h | 2 +-
 block/partitions/core.c  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/partitions/check.h b/block/partitions/check.h
index c577e9ee67f0..8f0ceed06c7b 100644
--- a/block/partitions/check.h
+++ b/block/partitions/check.h
@@ -14,7 +14,7 @@ struct parsed_partitions {
 	struct {
 		sector_t from;
 		sector_t size;
-		int flags;
+		unsigned char flags;
 		bool has_info;
 		struct partition_meta_info info;
 	} *parts;
diff --git a/block/partitions/core.c b/block/partitions/core.c
index f3d9ff2cafb6..430ff7863556 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -314,7 +314,8 @@ static DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL);
  * after all disk users are gone.
  */
 static struct block_device *add_partition(struct gendisk *disk, int partno,
-				sector_t start, sector_t len, int flags,
+				sector_t start, sector_t len,
+				unsigned char flags,
 				struct partition_meta_info *info)
 {
 	dev_t devt = MKDEV(0, 0);
-- 
2.29.2


  reply	other threads:[~2021-02-24  4:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  3:58 [PATCH V2 0/3] block: avoid to drop & re-add partitions if partitions aren't changed Ming Lei
2021-02-24  3:58 ` Ming Lei [this message]
2021-02-24  4:32   ` [PATCH V2 1/4] block: define parsed_partitions.flags as 'unsigned char' Chaitanya Kulkarni
2021-02-24  3:58 ` [PATCH V2 2/4] block: store partition flags into block_device Ming Lei
2021-02-24  3:58 ` [PATCH V2 3/4] block: re-organize blk_add_partitions Ming Lei
2021-02-24  3:58 ` [PATCH V2 4/4] block: avoid to drop & re-add partitions if partitions aren't changed Ming Lei
2021-02-24  8:18 ` [PATCH V2 0/3] " Christoph Hellwig
2021-02-24 11:23   ` Ming Lei
2021-02-24 16:14     ` Christoph Hellwig

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=20210224035830.990123-2-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=emilne@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).