aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-02-01 01:08:10 -0500
committerEric W. Biederman <ebiederm@xmission.com>2013-02-13 09:15:11 -0500
commitd0546426426ca96f0b815581c0a9ed0db28319b6 (patch)
treed803aeaf24cde90e11727ee5bf55c3e0be298c5b /fs/gfs2
parent6b24c0d279eacfb499854d09ea7f2b69d1721a29 (diff)
gfs2: Convert uids and gids between dinodes and vfs inodes.
When reading dinodes from the disk convert uids and gids into kuids and kgids to store in vfs data structures. When writing to dinodes to the disk convert kuids and kgids in the in memory structures into plain uids and gids. For now all on disk data structures are assumed to be stored in the initial user namespace. Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/glops.c4
-rw-r--r--fs/gfs2/inode.c4
-rw-r--r--fs/gfs2/super.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 78d4184ffc7d..444b6503ebc4 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -322,8 +322,8 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
322 break; 322 break;
323 }; 323 };
324 324
325 ip->i_inode.i_uid = be32_to_cpu(str->di_uid); 325 i_uid_write(&ip->i_inode, be32_to_cpu(str->di_uid));
326 ip->i_inode.i_gid = be32_to_cpu(str->di_gid); 326 i_gid_write(&ip->i_inode, be32_to_cpu(str->di_gid));
327 gfs2_set_nlink(&ip->i_inode, be32_to_cpu(str->di_nlink)); 327 gfs2_set_nlink(&ip->i_inode, be32_to_cpu(str->di_nlink));
328 i_size_write(&ip->i_inode, be64_to_cpu(str->di_size)); 328 i_size_write(&ip->i_inode, be64_to_cpu(str->di_size));
329 gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); 329 gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks));
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index bb7c754f46a2..b862d114e155 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -456,8 +456,8 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_inode *ip,
456 di->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino); 456 di->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino);
457 di->di_num.no_addr = cpu_to_be64(ip->i_no_addr); 457 di->di_num.no_addr = cpu_to_be64(ip->i_no_addr);
458 di->di_mode = cpu_to_be32(ip->i_inode.i_mode); 458 di->di_mode = cpu_to_be32(ip->i_inode.i_mode);
459 di->di_uid = cpu_to_be32(ip->i_inode.i_uid); 459 di->di_uid = cpu_to_be32(i_uid_read(&ip->i_inode));
460 di->di_gid = cpu_to_be32(ip->i_inode.i_gid); 460 di->di_gid = cpu_to_be32(i_gid_read(&ip->i_inode));
461 di->di_nlink = 0; 461 di->di_nlink = 0;
462 di->di_size = cpu_to_be64(ip->i_inode.i_size); 462 di->di_size = cpu_to_be64(ip->i_inode.i_size);
463 di->di_blocks = cpu_to_be64(1); 463 di->di_blocks = cpu_to_be64(1);
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 7cc5a6054547..a03425376500 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -721,8 +721,8 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
721 str->di_num.no_addr = cpu_to_be64(ip->i_no_addr); 721 str->di_num.no_addr = cpu_to_be64(ip->i_no_addr);
722 str->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino); 722 str->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino);
723 str->di_mode = cpu_to_be32(ip->i_inode.i_mode); 723 str->di_mode = cpu_to_be32(ip->i_inode.i_mode);
724 str->di_uid = cpu_to_be32(ip->i_inode.i_uid); 724 str->di_uid = cpu_to_be32(i_uid_read(&ip->i_inode));
725 str->di_gid = cpu_to_be32(ip->i_inode.i_gid); 725 str->di_gid = cpu_to_be32(i_gid_read(&ip->i_inode));
726 str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink); 726 str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink);
727 str->di_size = cpu_to_be64(i_size_read(&ip->i_inode)); 727 str->di_size = cpu_to_be64(i_size_read(&ip->i_inode));
728 str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); 728 str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode));