Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43267
b: refs/heads/master
c: b60623c
h: refs/heads/master
i:
  43265: 12ebc8a
  43263: 1dbcf74
v: v3
  • Loading branch information
Steven Whitehouse committed Nov 30, 2006
1 parent b806304 commit afed20f
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 50 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7f14f4d094ea1a9ce1953375f5bc1500c760c79
refs/heads/master: b60623c238b6a819bd04090139704e2cb57a751f
16 changes: 8 additions & 8 deletions trunk/fs/gfs2/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access)
return -EOPNOTSUPP;
if (current->fsuid != ip->i_di.di_uid && !capable(CAP_FOWNER))
return -EPERM;
if (S_ISLNK(ip->i_di.di_mode))
if (S_ISLNK(ip->i_inode.i_mode))
return -EOPNOTSUPP;
if (!access && !S_ISDIR(ip->i_di.di_mode))
if (!access && !S_ISDIR(ip->i_inode.i_mode))
return -EACCES;

return 0;
Expand Down Expand Up @@ -198,8 +198,8 @@ static int munge_mode(struct gfs2_inode *ip, mode_t mode)
error = gfs2_meta_inode_buffer(ip, &dibh);
if (!error) {
gfs2_assert_withdraw(sdp,
(ip->i_di.di_mode & S_IFMT) == (mode & S_IFMT));
ip->i_di.di_mode = mode;
(ip->i_inode.i_mode & S_IFMT) == (mode & S_IFMT));
ip->i_inode.i_mode = mode;
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(ip, dibh->b_data);
brelse(dibh);
Expand All @@ -215,12 +215,12 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
struct posix_acl *acl = NULL, *clone;
struct gfs2_ea_request er;
mode_t mode = ip->i_di.di_mode;
mode_t mode = ip->i_inode.i_mode;
int error;

if (!sdp->sd_args.ar_posix_acl)
return 0;
if (S_ISLNK(ip->i_di.di_mode))
if (S_ISLNK(ip->i_inode.i_mode))
return 0;

memset(&er, 0, sizeof(struct gfs2_ea_request));
Expand All @@ -232,7 +232,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
return error;
if (!acl) {
mode &= ~current->fs->umask;
if (mode != ip->i_di.di_mode)
if (mode != ip->i_inode.i_mode)
error = munge_mode(ip, mode);
return error;
}
Expand All @@ -244,7 +244,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
posix_acl_release(acl);
acl = clone;

if (S_ISDIR(ip->i_di.di_mode)) {
if (S_ISDIR(ip->i_inode.i_mode)) {
er.er_name = GFS2_POSIX_ACL_DEFAULT;
er.er_name_len = GFS2_POSIX_ACL_DEFAULT_LEN;
error = gfs2_system_eaops.eo_set(ip, &er);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ int gfs2_truncatei(struct gfs2_inode *ip, u64 size)
{
int error;

if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), S_ISREG(ip->i_di.di_mode)))
if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), S_ISREG(ip->i_inode.i_mode)))
return -EINVAL;

if (size > ip->i_di.di_size)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/eaops.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int system_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er)

if (GFS2_ACL_IS_ACCESS(er->er_name, er->er_name_len)) {
if (!(er->er_flags & GFS2_ERF_MODE)) {
er->er_mode = ip->i_di.di_mode;
er->er_mode = ip->i_inode.i_mode;
er->er_flags |= GFS2_ERF_MODE;
}
error = gfs2_acl_validate_set(ip, 1, er,
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/gfs2/eattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,9 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
if (!error) {
if (er->er_flags & GFS2_ERF_MODE) {
gfs2_assert_withdraw(GFS2_SB(&ip->i_inode),
(ip->i_di.di_mode & S_IFMT) ==
(ip->i_inode.i_mode & S_IFMT) ==
(er->er_mode & S_IFMT));
ip->i_di.di_mode = er->er_mode;
ip->i_inode.i_mode = er->er_mode;
}
ip->i_di.di_ctime = get_seconds();
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
Expand Down Expand Up @@ -847,8 +847,8 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh,

if (er->er_flags & GFS2_ERF_MODE) {
gfs2_assert_withdraw(GFS2_SB(&ip->i_inode),
(ip->i_di.di_mode & S_IFMT) == (er->er_mode & S_IFMT));
ip->i_di.di_mode = er->er_mode;
(ip->i_inode.i_mode & S_IFMT) == (er->er_mode & S_IFMT));
ip->i_inode.i_mode = er->er_mode;
}
ip->i_di.di_ctime = get_seconds();
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ static int dump_inode(struct gfs2_inode *ip)
printk(KERN_INFO " num = %llu %llu\n",
(unsigned long long)ip->i_num.no_formal_ino,
(unsigned long long)ip->i_num.no_addr);
printk(KERN_INFO " type = %u\n", IF2DT(ip->i_di.di_mode));
printk(KERN_INFO " type = %u\n", IF2DT(ip->i_inode.i_mode));
printk(KERN_INFO " i_flags =");
for (x = 0; x < 32; x++)
if (test_bit(x, &ip->i_flags))
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/gfs2/glops.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void gfs2_pte_inval(struct gfs2_glock *gl)

ip = gl->gl_object;
inode = &ip->i_inode;
if (!ip || !S_ISREG(ip->i_di.di_mode))
if (!ip || !S_ISREG(inode->i_mode))
return;

if (!test_bit(GIF_PAGED, &ip->i_flags))
Expand All @@ -119,7 +119,7 @@ static void gfs2_page_inval(struct gfs2_glock *gl)

ip = gl->gl_object;
inode = &ip->i_inode;
if (!ip || !S_ISREG(ip->i_di.di_mode))
if (!ip || !S_ISREG(inode->i_mode))
return;

truncate_inode_pages(inode->i_mapping, 0);
Expand All @@ -142,7 +142,7 @@ static void gfs2_page_wait(struct gfs2_glock *gl)
struct address_space *mapping = inode->i_mapping;
int error;

if (!S_ISREG(ip->i_di.di_mode))
if (!S_ISREG(inode->i_mode))
return;

error = filemap_fdatawait(mapping);
Expand All @@ -164,7 +164,7 @@ static void gfs2_page_writeback(struct gfs2_glock *gl)
struct inode *inode = &ip->i_inode;
struct address_space *mapping = inode->i_mapping;

if (!S_ISREG(ip->i_di.di_mode))
if (!S_ISREG(inode->i_mode))
return;

filemap_fdatawrite(mapping);
Expand Down
18 changes: 7 additions & 11 deletions trunk/fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ void gfs2_inode_attr_in(struct gfs2_inode *ip)
struct gfs2_dinode_host *di = &ip->i_di;

inode->i_ino = ip->i_num.no_addr;
inode->i_mode = di->di_mode;
inode->i_nlink = di->di_nlink;
inode->i_uid = di->di_uid;
inode->i_gid = di->di_gid;
Expand Down Expand Up @@ -88,9 +87,6 @@ void gfs2_inode_attr_out(struct gfs2_inode *ip)
{
struct inode *inode = &ip->i_inode;
struct gfs2_dinode_host *di = &ip->i_di;
gfs2_assert_withdraw(GFS2_SB(inode),
(di->di_mode & S_IFMT) == (inode->i_mode & S_IFMT));
di->di_mode = inode->i_mode;
di->di_uid = inode->i_uid;
di->di_gid = inode->i_gid;
di->di_atime = inode->i_atime.tv_sec;
Expand Down Expand Up @@ -210,9 +206,9 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
if (ip->i_num.no_formal_ino != be64_to_cpu(str->di_num.no_formal_ino))
return -ESTALE;

di->di_mode = be32_to_cpu(str->di_mode);
ip->i_inode.i_mode = be32_to_cpu(str->di_mode);
ip->i_inode.i_rdev = 0;
switch (di->di_mode & S_IFMT) {
switch (ip->i_inode.i_mode & S_IFMT) {
case S_IFBLK:
case S_IFCHR:
ip->i_inode.i_rdev = MKDEV(be32_to_cpu(str->di_major),
Expand Down Expand Up @@ -620,7 +616,7 @@ static void munge_mode_uid_gid(struct gfs2_inode *dip, unsigned int *mode,
unsigned int *uid, unsigned int *gid)
{
if (GFS2_SB(&dip->i_inode)->sd_args.ar_suiddir &&
(dip->i_di.di_mode & S_ISUID) && dip->i_di.di_uid) {
(dip->i_inode.i_mode & S_ISUID) && dip->i_di.di_uid) {
if (S_ISDIR(*mode))
*mode |= S_ISUID;
else if (dip->i_di.di_uid != current->fsuid)
Expand All @@ -629,7 +625,7 @@ static void munge_mode_uid_gid(struct gfs2_inode *dip, unsigned int *mode,
} else
*uid = current->fsuid;

if (dip->i_di.di_mode & S_ISGID) {
if (dip->i_inode.i_mode & S_ISGID) {
if (S_ISDIR(*mode))
*mode |= S_ISGID;
*gid = dip->i_di.di_gid;
Expand Down Expand Up @@ -810,7 +806,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
goto fail_quota_locks;
}

error = gfs2_dir_add(&dip->i_inode, name, &ip->i_num, IF2DT(ip->i_di.di_mode));
error = gfs2_dir_add(&dip->i_inode, name, &ip->i_num, IF2DT(ip->i_inode.i_mode));
if (error)
goto fail_end_trans;

Expand Down Expand Up @@ -1053,7 +1049,7 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
if (IS_IMMUTABLE(&ip->i_inode) || IS_APPEND(&ip->i_inode))
return -EPERM;

if ((dip->i_di.di_mode & S_ISVTX) &&
if ((dip->i_inode.i_mode & S_ISVTX) &&
dip->i_di.di_uid != current->fsuid &&
ip->i_di.di_uid != current->fsuid && !capable(CAP_FOWNER))
return -EPERM;
Expand All @@ -1072,7 +1068,7 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
if (!gfs2_inum_equal(&inum, &ip->i_num))
return -ENOENT;

if (IF2DT(ip->i_di.di_mode) != type) {
if (IF2DT(ip->i_inode.i_mode) != type) {
gfs2_consist_inode(dip);
return -EIO;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static inline int gfs2_is_jdata(struct gfs2_inode *ip)

static inline int gfs2_is_dir(struct gfs2_inode *ip)
{
return S_ISDIR(ip->i_di.di_mode);
return S_ISDIR(ip->i_inode.i_mode);
}

void gfs2_inode_attr_in(struct gfs2_inode *ip);
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/gfs2/ondisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)

gfs2_inum_out(&ip->i_num, &str->di_num);

str->di_mode = cpu_to_be32(di->di_mode);
str->di_mode = cpu_to_be32(ip->i_inode.i_mode);
str->di_uid = cpu_to_be32(di->di_uid);
str->di_gid = cpu_to_be32(di->di_gid);
str->di_nlink = cpu_to_be32(di->di_nlink);
Expand Down Expand Up @@ -191,7 +191,6 @@ void gfs2_dinode_print(const struct gfs2_inode *ip)

gfs2_inum_print(&ip->i_num);

pv(di, di_mode, "0%o");
pv(di, di_uid, "%u");
pv(di, di_gid, "%u");
pv(di, di_nlink, "%u");
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/gfs2/ops_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ static int gfs2_commit_write(struct file *file, struct page *page,
di->di_size = cpu_to_be64(inode->i_size);
}

di->di_mode = cpu_to_be32(inode->i_mode);
di->di_atime = cpu_to_be64(inode->i_atime.tv_sec);
di->di_mtime = cpu_to_be64(inode->i_mtime.tv_sec);
di->di_ctime = cpu_to_be64(inode->i_ctime.tv_sec);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/ops_dentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static int gfs2_drevalidate(struct dentry *dentry, struct nameidata *nd)
if (!gfs2_inum_equal(&ip->i_num, &inum))
goto invalid_gunlock;

if (IF2DT(ip->i_di.di_mode) != type) {
if (IF2DT(ip->i_inode.i_mode) != type) {
gfs2_consist_inode(dip);
goto fail_gunlock;
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static int gfs2_open(struct inode *inode, struct file *file)
gfs2_assert_warn(GFS2_SB(inode), !file->private_data);
file->private_data = fp;

if (S_ISREG(ip->i_di.di_mode)) {
if (S_ISREG(ip->i_inode.i_mode)) {
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
&i_gh);
if (error)
Expand Down Expand Up @@ -515,7 +515,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)

if (!(fl->fl_flags & FL_POSIX))
return -ENOLCK;
if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
if ((ip->i_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
return -ENOLCK;

if (sdp->sd_args.ar_localflocks) {
Expand Down Expand Up @@ -617,7 +617,7 @@ static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl)

if (!(fl->fl_flags & FL_FLOCK))
return -ENOLCK;
if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
if ((ip->i_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
return -ENOLCK;

if (sdp->sd_args.ar_localflocks)
Expand Down
17 changes: 8 additions & 9 deletions trunk/fs/gfs2/ops_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
int alloc_required;
int error;

if (S_ISDIR(ip->i_di.di_mode))
if (S_ISDIR(inode->i_mode))
return -EPERM;

gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
Expand Down Expand Up @@ -220,7 +220,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
}

error = gfs2_dir_add(dir, &dentry->d_name, &ip->i_num,
IF2DT(ip->i_di.di_mode));
IF2DT(inode->i_mode));
if (error)
goto out_end_trans;

Expand Down Expand Up @@ -564,11 +564,10 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,

/* Make sure we aren't trying to move a dirctory into it's subdir */

if (S_ISDIR(ip->i_di.di_mode) && odip != ndip) {
if (S_ISDIR(ip->i_inode.i_mode) && odip != ndip) {
dir_rename = 1;

error = gfs2_glock_nq_init(sdp->sd_rename_gl,
LM_ST_EXCLUSIVE, 0,
error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, 0,
&r_gh);
if (error)
goto out;
Expand Down Expand Up @@ -609,7 +608,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
if (error)
goto out_gunlock;

if (S_ISDIR(nip->i_di.di_mode)) {
if (S_ISDIR(nip->i_inode.i_mode)) {
if (nip->i_di.di_entries < 2) {
if (gfs2_consist_inode(nip))
gfs2_dinode_print(nip);
Expand Down Expand Up @@ -646,7 +645,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
error = -EFBIG;
goto out_gunlock;
}
if (S_ISDIR(ip->i_di.di_mode) &&
if (S_ISDIR(ip->i_inode.i_mode) &&
ndip->i_di.di_nlink == (u32)-1) {
error = -EMLINK;
goto out_gunlock;
Expand Down Expand Up @@ -701,7 +700,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
/* Remove the target file, if it exists */

if (nip) {
if (S_ISDIR(nip->i_di.di_mode))
if (S_ISDIR(nip->i_inode.i_mode))
error = gfs2_rmdiri(ndip, &ndentry->d_name, nip);
else {
error = gfs2_dir_del(ndip, &ndentry->d_name);
Expand Down Expand Up @@ -743,7 +742,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
goto out_end_trans;

error = gfs2_dir_add(ndir, &ndentry->d_name, &ip->i_num,
IF2DT(ip->i_di.di_mode));
IF2DT(ip->i_inode.i_mode));
if (error)
goto out_end_trans;

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/ops_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static void gfs2_delete_inode(struct inode *inode)
if (error)
goto out_uninit;

if (S_ISDIR(ip->i_di.di_mode) &&
if (S_ISDIR(inode->i_mode) &&
(ip->i_di.di_flags & GFS2_DIF_EXHASH)) {
error = gfs2_dir_exhash_dealloc(ip);
if (error)
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/gfs2_ondisk.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ struct gfs2_dinode {
};

struct gfs2_dinode_host {
__u32 di_mode; /* mode of file */
__u32 di_uid; /* owner's user id */
__u32 di_gid; /* owner's group id */
__u32 di_nlink; /* number of links to this file */
Expand Down

0 comments on commit afed20f

Please sign in to comment.