*
* 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 <linux/sched.h>
#include <linux/posix_acl.h>
#include <linux/gfs2_ondisk.h>
#include <linux/crc32.h>
+#include <linux/lm_interface.h>
#include <asm/uaccess.h>
#include "gfs2.h"
-#include "lm_interface.h"
#include "incore.h"
#include "acl.h"
#include "bmap.h"
#include "meta_io.h"
#include "ops_dentry.h"
#include "ops_inode.h"
-#include "page.h"
#include "quota.h"
#include "rgrp.h"
#include "trans.h"
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))
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);
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;
}
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);
}
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;
}
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) {
case S_IFSOCK:
break;
default:
- return -EOPNOTSUPP;
+ return -EOPNOTSUPP;
};
gfs2_holder_init(dip->i_gl, 0, 0, ghs);
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;
}
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;
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;
}
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
*