mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs: constify inode argument of inode_state_read_once()
@ 2026-11-11 10:01 Andrey Albershteyn
  2026-11-11 14:22 ` Jan Kara
  2026-11-11 15:20 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Albershteyn @ 2026-11-11 10:01 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, linux-fsdevel, linux-kernel
  Cc: ebiggers, hch, Andrey Albershteyn

Constify inode parameter so that callers can pass const inode. Callers
do not need a change.

Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---

Notes:
    I will have a user with const inode in fsverity
    https://lore.kernel.org/fsverity/20261105115532.613467-3-aalbersh@kernel.org/

 include/linux/fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 99caef43ff3c..c5ba625c8ae1 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -877,7 +877,7 @@ struct inode {
  *
  * We hide all of it behind helpers so that we can validate consumers.
  */
-static inline enum inode_state_flags_enum inode_state_read_once(struct inode *inode)
+static inline enum inode_state_flags_enum inode_state_read_once(const struct inode *inode)
 {
 	return READ_ONCE(inode->i_state.__state);
 }
-- 
2.54.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs: constify inode argument of inode_state_read_once()
  2026-11-11 10:01 [PATCH] fs: constify inode argument of inode_state_read_once() Andrey Albershteyn
@ 2026-11-11 14:22 ` Jan Kara
  2026-11-11 15:20 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2026-11-11 14:22 UTC (permalink / raw)
  To: Andrey Albershteyn
  Cc: Alexander Viro, Christian Brauner, Jan Kara, linux-fsdevel,
	linux-kernel, ebiggers, hch

On Wed 11-11-26 11:01:49, Andrey Albershteyn wrote:
> Constify inode parameter so that callers can pass const inode. Callers
> do not need a change.
> 
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>

Fine by me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
> 
> Notes:
>     I will have a user with const inode in fsverity
>     https://lore.kernel.org/fsverity/20261105115532.613467-3-aalbersh@kernel.org/
> 
>  include/linux/fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 99caef43ff3c..c5ba625c8ae1 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -877,7 +877,7 @@ struct inode {
>   *
>   * We hide all of it behind helpers so that we can validate consumers.
>   */
> -static inline enum inode_state_flags_enum inode_state_read_once(struct inode *inode)
> +static inline enum inode_state_flags_enum inode_state_read_once(const struct inode *inode)
>  {
>  	return READ_ONCE(inode->i_state.__state);
>  }
> -- 
> 2.54.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs: constify inode argument of inode_state_read_once()
  2026-11-11 10:01 [PATCH] fs: constify inode argument of inode_state_read_once() Andrey Albershteyn
  2026-11-11 14:22 ` Jan Kara
@ 2026-11-11 15:20 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-11-11 15:20 UTC (permalink / raw)
  To: Andrey Albershteyn
  Cc: Alexander Viro, Christian Brauner, Jan Kara, linux-fsdevel,
	linux-kernel, ebiggers, hch

On Wed, Nov 11, 2026 at 11:01:49AM +0100, Andrey Albershteyn wrote:
> Constify inode parameter so that callers can pass const inode. Callers
> do not need a change.
> 
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
> ---

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

> Notes:
>     I will have a user with const inode in fsverity
>     https://lore.kernel.org/fsverity/20261105115532.613467-3-aalbersh@kernel.org/

You probably want to include this patch in that series to reduce
the amount of dependency tracking you have to do..


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-11 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 10:01 [PATCH] fs: constify inode argument of inode_state_read_once() Andrey Albershteyn
2026-11-11 14:22 ` Jan Kara
2026-11-11 15:20 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®