Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43268
b: refs/heads/master
c: 2933f92
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Nov 30, 2006
1 parent afed20f commit f138103
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 42 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: b60623c238b6a819bd04090139704e2cb57a751f
refs/heads/master: 2933f9254a6af33db25270778c998a42029da668
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access)
{
if (!GFS2_SB(&ip->i_inode)->sd_args.ar_posix_acl)
return -EOPNOTSUPP;
if (current->fsuid != ip->i_di.di_uid && !capable(CAP_FOWNER))
if (current->fsuid != ip->i_inode.i_uid && !capable(CAP_FOWNER))
return -EPERM;
if (S_ISLNK(ip->i_inode.i_mode))
return -EOPNOTSUPP;
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 @@ -819,7 +819,7 @@ static int do_grow(struct gfs2_inode *ip, u64 size)
if (error)
goto out;

error = gfs2_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
error = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid);
if (error)
goto out_gunlock_q;

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/eattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
if (error)
goto out;

error = gfs2_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
error = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid);
if (error)
goto out_gunlock_q;

Expand Down
23 changes: 9 additions & 14 deletions trunk/fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ void gfs2_inode_attr_in(struct gfs2_inode *ip)

inode->i_ino = ip->i_num.no_addr;
inode->i_nlink = di->di_nlink;
inode->i_uid = di->di_uid;
inode->i_gid = di->di_gid;
i_size_write(inode, di->di_size);
inode->i_atime.tv_sec = di->di_atime;
inode->i_mtime.tv_sec = di->di_mtime;
Expand Down Expand Up @@ -87,8 +85,6 @@ void gfs2_inode_attr_out(struct gfs2_inode *ip)
{
struct inode *inode = &ip->i_inode;
struct gfs2_dinode_host *di = &ip->i_di;
di->di_uid = inode->i_uid;
di->di_gid = inode->i_gid;
di->di_atime = inode->i_atime.tv_sec;
di->di_mtime = inode->i_mtime.tv_sec;
di->di_ctime = inode->i_ctime.tv_sec;
Expand Down Expand Up @@ -216,8 +212,8 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
break;
};

di->di_uid = be32_to_cpu(str->di_uid);
di->di_gid = be32_to_cpu(str->di_gid);
ip->i_inode.i_uid = be32_to_cpu(str->di_uid);
ip->i_inode.i_gid = be32_to_cpu(str->di_gid);
di->di_nlink = be32_to_cpu(str->di_nlink);
di->di_size = be64_to_cpu(str->di_size);
di->di_blocks = be64_to_cpu(str->di_blocks);
Expand Down Expand Up @@ -616,19 +612,19 @@ 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_inode.i_mode & S_ISUID) && dip->i_di.di_uid) {
(dip->i_inode.i_mode & S_ISUID) && dip->i_inode.i_uid) {
if (S_ISDIR(*mode))
*mode |= S_ISUID;
else if (dip->i_di.di_uid != current->fsuid)
else if (dip->i_inode.i_uid != current->fsuid)
*mode &= ~07111;
*uid = dip->i_di.di_uid;
*uid = dip->i_inode.i_uid;
} else
*uid = current->fsuid;

if (dip->i_inode.i_mode & S_ISGID) {
if (S_ISDIR(*mode))
*mode |= S_ISGID;
*gid = dip->i_di.di_gid;
*gid = dip->i_inode.i_gid;
} else
*gid = current->fsgid;
}
Expand Down Expand Up @@ -783,8 +779,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
if (alloc_required < 0)
goto fail;
if (alloc_required) {
error = gfs2_quota_check(dip, dip->i_di.di_uid,
dip->i_di.di_gid);
error = gfs2_quota_check(dip, dip->i_inode.i_uid, dip->i_inode.i_gid);
if (error)
goto fail_quota_locks;

Expand Down Expand Up @@ -1050,8 +1045,8 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
return -EPERM;

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))
dip->i_inode.i_uid != current->fsuid &&
ip->i_inode.i_uid != current->fsuid && !capable(CAP_FOWNER))
return -EPERM;

if (IS_APPEND(&dip->i_inode))
Expand Down
6 changes: 2 additions & 4 deletions trunk/fs/gfs2/ondisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ 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(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_uid = cpu_to_be32(ip->i_inode.i_uid);
str->di_gid = cpu_to_be32(ip->i_inode.i_gid);
str->di_nlink = cpu_to_be32(di->di_nlink);
str->di_size = cpu_to_be64(di->di_size);
str->di_blocks = cpu_to_be64(di->di_blocks);
Expand Down Expand Up @@ -191,8 +191,6 @@ void gfs2_dinode_print(const struct gfs2_inode *ip)

gfs2_inum_print(&ip->i_num);

pv(di, di_uid, "%u");
pv(di, di_gid, "%u");
pv(di, di_nlink, "%u");
printk(KERN_INFO " di_size = %llu\n", (unsigned long long)di->di_size);
printk(KERN_INFO " di_blocks = %llu\n", (unsigned long long)di->di_blocks);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/ops_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
if (error)
goto out_alloc_put;

error = gfs2_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
error = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid);
if (error)
goto out_qunlock;

Expand Down
10 changes: 4 additions & 6 deletions trunk/fs/gfs2/ops_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
if (error)
goto out_alloc;

error = gfs2_quota_check(dip, dip->i_di.di_uid,
dip->i_di.di_gid);
error = gfs2_quota_check(dip, dip->i_inode.i_uid, dip->i_inode.i_gid);
if (error)
goto out_gunlock_q;

Expand Down Expand Up @@ -673,8 +672,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
if (error)
goto out_alloc;

error = gfs2_quota_check(ndip, ndip->i_di.di_uid,
ndip->i_di.di_gid);
error = gfs2_quota_check(ndip, ndip->i_inode.i_uid, ndip->i_inode.i_gid);
if (error)
goto out_gunlock_q;

Expand Down Expand Up @@ -885,8 +883,8 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
u32 ouid, ogid, nuid, ngid;
int error;

ouid = ip->i_di.di_uid;
ogid = ip->i_di.di_gid;
ouid = inode->i_uid;
ogid = inode->i_gid;
nuid = attr->ia_uid;
ngid = attr->ia_gid;

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/ops_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
if (error)
goto out;

error = gfs2_quota_check(ip, ip->i_di.di_uid, ip->i_di.di_gid);
error = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid);
if (error)
goto out_gunlock_q;

Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,27 +452,27 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
return 0;

error = qdsb_get(sdp, QUOTA_USER, ip->i_di.di_uid, CREATE, qd);
error = qdsb_get(sdp, QUOTA_USER, ip->i_inode.i_uid, CREATE, qd);
if (error)
goto out;
al->al_qd_num++;
qd++;

error = qdsb_get(sdp, QUOTA_GROUP, ip->i_di.di_gid, CREATE, qd);
error = qdsb_get(sdp, QUOTA_GROUP, ip->i_inode.i_gid, CREATE, qd);
if (error)
goto out;
al->al_qd_num++;
qd++;

if (uid != NO_QUOTA_CHANGE && uid != ip->i_di.di_uid) {
if (uid != NO_QUOTA_CHANGE && uid != ip->i_inode.i_uid) {
error = qdsb_get(sdp, QUOTA_USER, uid, CREATE, qd);
if (error)
goto out;
al->al_qd_num++;
qd++;
}

if (gid != NO_QUOTA_CHANGE && gid != ip->i_di.di_gid) {
if (gid != NO_QUOTA_CHANGE && gid != ip->i_inode.i_gid) {
error = qdsb_get(sdp, QUOTA_GROUP, gid, CREATE, qd);
if (error)
goto out;
Expand Down
11 changes: 5 additions & 6 deletions trunk/fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ u64 gfs2_alloc_data(struct gfs2_inode *ip)
al->al_alloced++;

gfs2_statfs_change(sdp, 0, -1, 0);
gfs2_quota_change(ip, +1, ip->i_di.di_uid, ip->i_di.di_gid);
gfs2_quota_change(ip, +1, ip->i_inode.i_uid, ip->i_inode.i_gid);

spin_lock(&sdp->sd_rindex_spin);
rgd->rd_free_clone--;
Expand Down Expand Up @@ -1261,7 +1261,7 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip)
al->al_alloced++;

gfs2_statfs_change(sdp, 0, -1, 0);
gfs2_quota_change(ip, +1, ip->i_di.di_uid, ip->i_di.di_gid);
gfs2_quota_change(ip, +1, ip->i_inode.i_uid, ip->i_inode.i_gid);
gfs2_trans_add_unrevoke(sdp, block);

spin_lock(&sdp->sd_rindex_spin);
Expand Down Expand Up @@ -1337,8 +1337,7 @@ void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen)
gfs2_trans_add_rg(rgd);

gfs2_statfs_change(sdp, 0, +blen, 0);
gfs2_quota_change(ip, -(s64)blen,
ip->i_di.di_uid, ip->i_di.di_gid);
gfs2_quota_change(ip, -(s64)blen, ip->i_inode.i_uid, ip->i_inode.i_gid);
}

/**
Expand Down Expand Up @@ -1366,7 +1365,7 @@ void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen)
gfs2_trans_add_rg(rgd);

gfs2_statfs_change(sdp, 0, +blen, 0);
gfs2_quota_change(ip, -(s64)blen, ip->i_di.di_uid, ip->i_di.di_gid);
gfs2_quota_change(ip, -(s64)blen, ip->i_inode.i_uid, ip->i_inode.i_gid);
gfs2_meta_wipe(ip, bstart, blen);
}

Expand Down Expand Up @@ -1411,7 +1410,7 @@ static void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, u64 blkno)
void gfs2_free_di(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip)
{
gfs2_free_uninit_di(rgd, ip->i_num.no_addr);
gfs2_quota_change(ip, -1, ip->i_di.di_uid, ip->i_di.di_gid);
gfs2_quota_change(ip, -1, ip->i_inode.i_uid, ip->i_inode.i_gid);
gfs2_meta_wipe(ip, ip->i_num.no_addr, 1);
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/gfs2_ondisk.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ struct gfs2_dinode {
};

struct gfs2_dinode_host {
__u32 di_uid; /* owner's user id */
__u32 di_gid; /* owner's group id */
__u32 di_nlink; /* number of links to this file */
__u64 di_size; /* number of bytes in file */
__u64 di_blocks; /* number of blocks in file */
Expand Down

0 comments on commit f138103

Please sign in to comment.