X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fgfs2%2Fops_inode.c;h=ef6e5ed70e94fea379c5dd5005d90ee71ae64331;hb=abbdbd2065e74411dc2c401501c2c85a82f60e06;hp=5d5ebbcba534bae903ac5f4890a577cb23cef586;hpb=faf450ef4a8567e4c75a905aadae01cf401d893a;p=powerpc.git diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 5d5ebbcba5..ef6e5ed70e 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c @@ -4,7 +4,7 @@ * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU General Public License v.2. + * of the GNU General Public License version 2. */ #include @@ -19,10 +19,10 @@ #include #include #include +#include #include #include "gfs2.h" -#include "lm_interface.h" #include "incore.h" #include "acl.h" #include "bmap.h" @@ -34,7 +34,6 @@ #include "meta_io.h" #include "ops_dentry.h" #include "ops_inode.h" -#include "page.h" #include "quota.h" #include "rgrp.h" #include "trans.h" @@ -173,7 +172,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, if (!dip->i_di.di_nlink) goto out_gunlock; error = -EFBIG; - if (dip->i_di.di_entries == (uint32_t)-1) + if (dip->i_di.di_entries == (u32)-1) goto out_gunlock; error = -EPERM; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) @@ -182,7 +181,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, if (!ip->i_di.di_nlink) goto out_gunlock; error = -EMLINK; - if (ip->i_di.di_nlink == (uint32_t)-1) + if (ip->i_di.di_nlink == (u32)-1) goto out_gunlock; alloc_required = error = gfs2_diradd_alloc_required(dir, &dentry->d_name); @@ -229,31 +228,25 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, out_end_trans: gfs2_trans_end(sdp); - out_ipres: if (alloc_required) gfs2_inplace_release(dip); - out_gunlock_q: if (alloc_required) gfs2_quota_unlock(dip); - out_alloc: if (alloc_required) gfs2_alloc_put(dip); - out_gunlock: gfs2_glock_dq_m(2, ghs); - out: gfs2_holder_uninit(ghs); gfs2_holder_uninit(ghs + 1); - if (!error) { + atomic_inc(&inode->i_count); d_instantiate(dentry, inode); mark_inode_dirty(inode); } - return error; } @@ -411,17 +404,17 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode) gfs2_trans_add_bh(ip->i_gl, dibh, 1); gfs2_qstr2dirent(&str, GFS2_DIRENT_SIZE(str.len), dent); dent->de_inum = di->di_num; /* already GFS2 endian */ - dent->de_type = DT_DIR; + dent->de_type = cpu_to_be16(DT_DIR); di->di_entries = cpu_to_be32(1); gfs2_str2qstr(&str, ".."); dent = (struct gfs2_dirent *)((char*)dent + GFS2_DIRENT_SIZE(1)); gfs2_qstr2dirent(&str, dibh->b_size - GFS2_DIRENT_SIZE(1) - sizeof(struct gfs2_dinode), dent); - gfs2_inum_out(&dip->i_num, (char *) &dent->de_inum); - dent->de_type = DT_DIR; + gfs2_inum_out(&dip->i_num, &dent->de_inum); + dent->de_type = cpu_to_be16(DT_DIR); - gfs2_dinode_out(&ip->i_di, (char *)di); + gfs2_dinode_out(&ip->i_di, di); brelse(dibh); } @@ -491,13 +484,11 @@ static int gfs2_rmdir(struct inode *dir, struct dentry *dentry) gfs2_trans_end(sdp); - out_gunlock: +out_gunlock: gfs2_glock_dq_m(2, ghs); - - out: +out: gfs2_holder_uninit(ghs); gfs2_holder_uninit(ghs + 1); - return error; } @@ -518,7 +509,7 @@ static int gfs2_mknod(struct inode *dir, struct dentry *dentry, int mode, struct gfs2_holder ghs[2]; struct inode *inode; struct buffer_head *dibh; - uint32_t major = 0, minor = 0; + u32 major = 0, minor = 0; int error; switch (mode & S_IFMT) { @@ -531,7 +522,7 @@ static int gfs2_mknod(struct inode *dir, struct dentry *dentry, int mode, case S_IFSOCK: break; default: - return -EOPNOTSUPP; + return -EOPNOTSUPP; }; gfs2_holder_init(dip->i_gl, 0, 0, ghs); @@ -679,12 +670,12 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, error = -EINVAL; goto out_gunlock; } - if (ndip->i_di.di_entries == (uint32_t)-1) { + if (ndip->i_di.di_entries == (u32)-1) { error = -EFBIG; goto out_gunlock; } if (S_ISDIR(ip->i_di.di_mode) && - ndip->i_di.di_nlink == (uint32_t)-1) { + ndip->i_di.di_nlink == (u32)-1) { error = -EMLINK; goto out_gunlock; } @@ -920,7 +911,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_sbd *sdp = GFS2_SB(inode); struct buffer_head *dibh; - uint32_t ouid, ogid, nuid, ngid; + u32 ouid, ogid, nuid, ngid; int error; ouid = ip->i_di.di_uid; @@ -962,21 +953,16 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) brelse(dibh); if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) { - gfs2_quota_change(ip, -ip->i_di.di_blocks, - ouid, ogid); - gfs2_quota_change(ip, ip->i_di.di_blocks, - nuid, ngid); + gfs2_quota_change(ip, -ip->i_di.di_blocks, ouid, ogid); + gfs2_quota_change(ip, ip->i_di.di_blocks, nuid, ngid); } - out_end_trans: +out_end_trans: gfs2_trans_end(sdp); - - out_gunlock_q: +out_gunlock_q: gfs2_quota_unlock(ip); - - out_alloc: +out_alloc: gfs2_alloc_put(ip); - return error; } @@ -1019,18 +1005,16 @@ static int gfs2_setattr(struct dentry *dentry, struct iattr *attr) else error = gfs2_setattr_simple(ip, attr); - out: +out: gfs2_glock_dq_uninit(&i_gh); - if (!error) mark_inode_dirty(inode); - return error; } /** * gfs2_getattr - Read out an inode's attributes - * @mnt: ? + * @mnt: The vfsmount the inode is being accessed from * @dentry: The dentry to stat * @stat: The inode's stats *