linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: John Garry <john.g.garry@oracle.com>,
	brauner@kernel.org, djwong@kernel.org, hch@lst.de,
	linux-fsdevel@vger.kernel.org, dchinner@redhat.com,
	linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	ojaswin@linux.ibm.com, martin.petersen@oracle.com, tytso@mit.edu,
	linux-ext4@vger.kernel.org
Subject: Re: [PATCH 3/3] iomap: rework IOMAP atomic flags
Date: Sun, 23 Mar 2025 19:12:02 +0530	[thread overview]
Message-ID: <87bjtrsw2d.fsf@gmail.com> (raw)
In-Reply-To: <20250323063850.GA30703@lst.de>

Christoph Hellwig <hch@lst.de> writes:

> On Sun, Mar 23, 2025 at 01:17:08AM +0530, Ritesh Harjani wrote:
>
> [full quote deleted, can you please properly trim your replies?]
>

Sure.

>> So, I guess we can shift IOMAP_F_SIZE_CHANGED and IOMAP_F_STALE by
>> 1 bit. So it will all look like.. 
>
> Let's create some more space to avoid this for the next round, e.g.

Sure, that make sense. 

> count the core set flags from 31 down, and limit IOMAP_F_PRIVATE to a
> single flag, which is how it is used.

flags in struct iomap is of type u16. So will make core iomap flags
starting from bit 15, moving downwards. 

Here is a diff of what I think you meant - let me know if this diff
looks good to you? 



diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 02fe001feebb..68416b135151 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -78,6 +78,11 @@ struct vm_fault;
 #define IOMAP_F_ANON_WRITE     (1U << 7)
 #define IOMAP_F_ATOMIC_BIO     (1U << 8)

+/*
+ * Flag reserved for file system specific usage
+ */
+#define IOMAP_F_PRIVATE                (1U << 12)
+
 /*
  * Flags set by the core iomap code during operations:
  *
@@ -88,14 +93,8 @@ struct vm_fault;
  * range it covers needs to be remapped by the high level before the operation
  * can proceed.
  */
-#define IOMAP_F_SIZE_CHANGED   (1U << 8)
-#define IOMAP_F_STALE          (1U << 9)
-
-/*
- * Flags from 0x1000 up are for file system specific usage:
- */
-#define IOMAP_F_PRIVATE                (1U << 12)
-
+#define IOMAP_F_SIZE_CHANGED   (1U << 14)
+#define IOMAP_F_STALE          (1U << 15)

 /*
  * Magic value for addr:



(PS: I might be on transit / travel for some other work for a week. My reponses may be delayed.)
-ritesh


  parent reply	other threads:[~2025-03-23 14:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 12:02 [PATCH 0/3] further iomap large atomic writes changes John Garry
2025-03-20 12:02 ` [PATCH 1/3] iomap: inline iomap_dio_bio_opflags() John Garry
2025-03-20 12:02 ` [PATCH 2/3] iomap: comment on atomic write checks in iomap_dio_bio_iter() John Garry
2025-03-20 14:09   ` Christoph Hellwig
2025-03-20 19:32   ` Ritesh Harjani
2025-03-20 12:02 ` [PATCH 3/3] iomap: rework IOMAP atomic flags John Garry
2025-03-20 14:10   ` Christoph Hellwig
2025-03-20 19:29   ` Ritesh Harjani
2025-03-22 19:47   ` Ritesh Harjani
2025-03-23  6:38     ` Christoph Hellwig
2025-03-23 13:07       ` John Garry
2025-03-23 13:42       ` Ritesh Harjani [this message]
2025-03-26 15:50         ` John Garry
2025-03-27 10:46         ` Christoph Hellwig
2025-03-20 14:16 ` [PATCH 0/3] further iomap large atomic writes changes Christian Brauner

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=87bjtrsw2d.fsf@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=brauner@kernel.org \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=john.g.garry@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ojaswin@linux.ibm.com \
    --cc=tytso@mit.edu \
    /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).