[v1,3/3] fuse: __kuid_val/__kgid_val helpers in fuse_fill_attr_from_inode()

Message ID 20240105152129.196824-4-aleksandr.mikhalitsyn@canonical.com
State New
Headers
Series fuse: a few small fixes |

Commit Message

Aleksandr Mikhalitsyn Jan. 5, 2024, 3:21 p.m. UTC
  For the sake of consistency, let's use these helpers to extract
{u,g}id_t values from k{u,g}id_t ones.

There are no functional changes, just to make code cleaner.

Cc: Christian Brauner <brauner@kernel.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
---
 fs/fuse/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Christian Brauner Jan. 8, 2024, 11:37 a.m. UTC | #1
On Fri, Jan 05, 2024 at 04:21:29PM +0100, Alexander Mikhalitsyn wrote:
> For the sake of consistency, let's use these helpers to extract
> {u,g}id_t values from k{u,g}id_t ones.
> 
> There are no functional changes, just to make code cleaner.
> 
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Miklos Szeredi <miklos@szeredi.hu>
> Cc: <linux-fsdevel@vger.kernel.org>
> Cc: <linux-kernel@vger.kernel.org>
> Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
> ---

Looks good to me,
Reviewed-by: Christian Brauner <brauner@kernel.org>
  
Aleksandr Mikhalitsyn Jan. 29, 2024, 12:15 p.m. UTC | #2
On Mon, 8 Jan 2024 12:37:07 +0100
Christian Brauner <brauner@kernel.org> wrote:

> On Fri, Jan 05, 2024 at 04:21:29PM +0100, Alexander Mikhalitsyn wrote:
> > For the sake of consistency, let's use these helpers to extract
> > {u,g}id_t values from k{u,g}id_t ones.
> > 
> > There are no functional changes, just to make code cleaner.
> > 
> > Cc: Christian Brauner <brauner@kernel.org>
> > Cc: Miklos Szeredi <miklos@szeredi.hu>
> > Cc: <linux-fsdevel@vger.kernel.org>
> > Cc: <linux-kernel@vger.kernel.org>
> > Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
> > ---
> 
> Looks good to me,
> Reviewed-by: Christian Brauner <brauner@kernel.org>

Thanks!

Kind regards,
Alex
  

Patch

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index b8636b5e79dc..ab824a8908b7 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1489,8 +1489,8 @@  static void fuse_fill_attr_from_inode(struct fuse_attr *attr,
 		.ctimensec	= ctime.tv_nsec,
 		.mode		= fi->inode.i_mode,
 		.nlink		= fi->inode.i_nlink,
-		.uid		= fi->inode.i_uid.val,
-		.gid		= fi->inode.i_gid.val,
+		.uid		= __kuid_val(fi->inode.i_uid),
+		.gid		= __kgid_val(fi->inode.i_gid),
 		.rdev		= fi->inode.i_rdev,
 		.blksize	= 1u << fi->inode.i_blkbits,
 	};