public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] namei: use QSTR() instead of QSTR_INIT() in path_pts
@ 2026-04-22 12:30 Thorsten Blum
  2026-04-22 12:51 ` Jan Kara
  2026-04-22 14:37 ` Al Viro
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-04-22 12:30 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara
  Cc: Thorsten Blum, linux-fsdevel, linux-kernel

Drop the hard-coded length argument and use the simpler QSTR().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index c7fac83c9a85..817bba800d7b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3617,7 +3617,7 @@ int path_pts(struct path *path)
 	 */
 	struct dentry *parent = dget_parent(path->dentry);
 	struct dentry *child;
-	struct qstr this = QSTR_INIT("pts", 3);
+	struct qstr this = QSTR("pts");
 
 	if (unlikely(!path_connected(path->mnt, parent))) {
 		dput(parent);

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

* Re: [PATCH] namei: use QSTR() instead of QSTR_INIT() in path_pts
  2026-04-22 12:30 [PATCH] namei: use QSTR() instead of QSTR_INIT() in path_pts Thorsten Blum
@ 2026-04-22 12:51 ` Jan Kara
  2026-04-22 14:37 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2026-04-22 12:51 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Alexander Viro, Christian Brauner, Jan Kara, linux-fsdevel,
	linux-kernel

On Wed 22-04-26 14:30:03, Thorsten Blum wrote:
> Drop the hard-coded length argument and use the simpler QSTR().
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/namei.c b/fs/namei.c
> index c7fac83c9a85..817bba800d7b 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -3617,7 +3617,7 @@ int path_pts(struct path *path)
>  	 */
>  	struct dentry *parent = dget_parent(path->dentry);
>  	struct dentry *child;
> -	struct qstr this = QSTR_INIT("pts", 3);
> +	struct qstr this = QSTR("pts");
>  
>  	if (unlikely(!path_connected(path->mnt, parent))) {
>  		dput(parent);
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH] namei: use QSTR() instead of QSTR_INIT() in path_pts
  2026-04-22 12:30 [PATCH] namei: use QSTR() instead of QSTR_INIT() in path_pts Thorsten Blum
  2026-04-22 12:51 ` Jan Kara
@ 2026-04-22 14:37 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2026-04-22 14:37 UTC (permalink / raw)
  To: Thorsten Blum; +Cc: Christian Brauner, Jan Kara, linux-fsdevel, linux-kernel

On Wed, Apr 22, 2026 at 02:30:03PM +0200, Thorsten Blum wrote:
> Drop the hard-coded length argument and use the simpler QSTR().
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  fs/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/namei.c b/fs/namei.c
> index c7fac83c9a85..817bba800d7b 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -3617,7 +3617,7 @@ int path_pts(struct path *path)
>  	 */
>  	struct dentry *parent = dget_parent(path->dentry);
>  	struct dentry *child;
> -	struct qstr this = QSTR_INIT("pts", 3);
> +	struct qstr this = QSTR("pts");
>  
>  	if (unlikely(!path_connected(path->mnt, parent))) {
>  		dput(parent);

NAK.  Compound literal is an l-value, so let's just use it:
	child = d_hash_and_lookup(parent, &QSTR("pts"));
and to hell with the local variable.

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

end of thread, other threads:[~2026-04-22 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 12:30 [PATCH] namei: use QSTR() instead of QSTR_INIT() in path_pts Thorsten Blum
2026-04-22 12:51 ` Jan Kara
2026-04-22 14:37 ` Al Viro

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