On 2012-9-25 18:05, Eric W. Biederman wrote: > Zhao Hongjiang <zhaohongjiang37@xxxxxxxxx> writes: > >> On 2012-9-20 19:41, Eric W. Biederman wrote: >>> From: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> >>> >>> Acked-by: Serge Hallyn <serge.hallyn@xxxxxxxxxxxxx> >>> Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx> >>> --- >>> fs/minix/inode.c | 16 ++++++++-------- >>> init/Kconfig | 1 - >>> 2 files changed, 8 insertions(+), 9 deletions(-) >>> >>> diff --git a/fs/minix/inode.c b/fs/minix/inode.c >>> index 2a503ad..d0e42c6 100644 >>> --- a/fs/minix/inode.c >>> +++ b/fs/minix/inode.c >>> @@ -460,8 +460,8 @@ static struct inode *V1_minix_iget(struct inode *inode) >>> return ERR_PTR(-EIO); >>> } >>> inode->i_mode = raw_inode->i_mode; >>> - inode->i_uid = (uid_t)raw_inode->i_uid; >>> - inode->i_gid = (gid_t)raw_inode->i_gid; >>> + i_uid_write(inode, raw_inode->i_uid); >>> + i_gid_write(inode, raw_inode->i_gid); >> >> >> i_uid_write(inode, (uid_t)raw_inode->i_uid); >> i_gid_write(inode, (gid_t)raw_inode->i_gid); >> >> is more better? > > An extra cast to uid_t or gid_t is redundant. i_uid_write takes > a uid_t paramenter and i_gid_write takes a gid_t paramenter so > we already have the casts implicitly. > > Eric I see,this is mean that we should remove uid_t and gid_t casts in other patches which is in i_uid_write and i_gid_write? > > >>> set_nlink(inode, raw_inode->i_nlinks); >>> inode->i_size = raw_inode->i_size; >>> inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = raw_inode->i_time; >>> @@ -493,8 +493,8 @@ static struct inode *V2_minix_iget(struct inode *inode) >>> return ERR_PTR(-EIO); >>> } >>> inode->i_mode = raw_inode->i_mode; >>> - inode->i_uid = (uid_t)raw_inode->i_uid; >>> - inode->i_gid = (gid_t)raw_inode->i_gid; >>> + i_uid_write(inode, raw_inode->i_uid); >>> + i_gid_write(inode, raw_inode->i_gid); >>> set_nlink(inode, raw_inode->i_nlinks); >>> inode->i_size = raw_inode->i_size; >>> inode->i_mtime.tv_sec = raw_inode->i_mtime; >>> @@ -545,8 +545,8 @@ static struct buffer_head * V1_minix_update_inode(struct inode * inode) >>> if (!raw_inode) >>> return NULL; >>> raw_inode->i_mode = inode->i_mode; >>> - raw_inode->i_uid = fs_high2lowuid(inode->i_uid); >>> - raw_inode->i_gid = fs_high2lowgid(inode->i_gid); >>> + raw_inode->i_uid = fs_high2lowuid(i_uid_read(inode)); >>> + raw_inode->i_gid = fs_high2lowgid(i_gid_read(inode)); >>> raw_inode->i_nlinks = inode->i_nlink; >>> raw_inode->i_size = inode->i_size; >>> raw_inode->i_time = inode->i_mtime.tv_sec; >>> @@ -572,8 +572,8 @@ static struct buffer_head * V2_minix_update_inode(struct inode * inode) >>> if (!raw_inode) >>> return NULL; >>> raw_inode->i_mode = inode->i_mode; >>> - raw_inode->i_uid = fs_high2lowuid(inode->i_uid); >>> - raw_inode->i_gid = fs_high2lowgid(inode->i_gid); >>> + raw_inode->i_uid = fs_high2lowuid(i_uid_read(inode)); >>> + raw_inode->i_gid = fs_high2lowgid(i_gid_read(inode)); >>> raw_inode->i_nlinks = inode->i_nlink; >>> raw_inode->i_size = inode->i_size; >>> raw_inode->i_mtime = inode->i_mtime.tv_sec; >>> diff --git a/init/Kconfig b/init/Kconfig >>> index 80edba8..c69e085 100644 >>> --- a/init/Kconfig >>> +++ b/init/Kconfig >>> @@ -946,7 +946,6 @@ config UIDGID_CONVERTED >>> depends on HPFS_FS = n >>> depends on JFFS2_FS = n >>> depends on JFS_FS = n >>> - depends on MINIX_FS = n >>> depends on NCP_FS = n >>> depends on NFSD = n >>> depends on NFS_FS = n >>> > _______________________________________________ > Containers mailing list > Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx > https://lists.linuxfoundation.org/mailman/listinfo/containers > > _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/containers