static int bh_get(struct gfs2_quota_data *qd)
{
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
- struct gfs2_inode *ip = sdp->sd_qc_inode->u.generic_ip;
+ struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
unsigned int block, offset;
uint64_t dblock;
int new = 0;
block = qd->qd_slot / sdp->sd_qc_per_block;
offset = qd->qd_slot % sdp->sd_qc_per_block;;
- error = gfs2_block_map(ip->i_vnode, block, &new, &dblock, &boundary);
+ error = gfs2_block_map(&ip->i_inode, block, &new, &dblock, &boundary);
if (error)
goto fail;
error = gfs2_meta_read(ip->i_gl, dblock, DIO_START | DIO_WAIT, &bh);
int gfs2_quota_hold(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
struct gfs2_quota_data **qd = al->al_qd;
int error;
void gfs2_quota_unhold(struct gfs2_inode *ip)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
unsigned int x;
static void do_qc(struct gfs2_quota_data *qd, int64_t change)
{
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
- struct gfs2_inode *ip = sdp->sd_qc_inode->u.generic_ip;
+ struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
struct gfs2_quota_change *qc = qd->qd_bh_qc;
int64_t x;
static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
int64_t change, struct gfs2_quota_data *qd)
{
- struct inode *inode = ip->i_vnode;
+ struct inode *inode = &ip->i_inode;
struct address_space *mapping = inode->i_mapping;
unsigned long index = loc >> PAGE_CACHE_SHIFT;
unsigned offset = loc & (PAGE_CACHE_SHIFT - 1);
static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
{
struct gfs2_sbd *sdp = (*qda)->qd_gl->gl_sbd;
- struct gfs2_inode *ip = sdp->sd_quota_inode->u.generic_ip;
+ struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
unsigned int data_blocks, ind_blocks;
struct file_ra_state ra_state;
struct gfs2_holder *ghs, i_gh;
goto out_gunlock;
}
- file_ra_state_init(&ra_state, ip->i_vnode->i_mapping);
+ file_ra_state_init(&ra_state, ip->i_inode.i_mapping);
for (x = 0; x < num_qd; x++) {
qd = qda[x];
offset = qd2offset(qd);
struct gfs2_holder *q_gh)
{
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
- struct gfs2_inode *ip = sdp->sd_quota_inode->u.generic_ip;
+ struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
struct gfs2_holder i_gh;
struct gfs2_quota q;
char buf[sizeof(struct gfs2_quota)];
int gfs2_quota_lock(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
unsigned int x;
int error = 0;
int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_alloc *al = &ip->i_alloc;
struct gfs2_quota_data *qd;
int64_t value;
unsigned int x;
unsigned int found = 0;
- if (gfs2_assert_warn(ip->i_sbd, change))
+ if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), change))
return;
if (ip->i_di.di_flags & GFS2_DIF_SYSTEM)
return;
int gfs2_quota_init(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = sdp->sd_qc_inode->u.generic_ip;
+ struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
unsigned int blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift;
unsigned int x, slot = 0;
unsigned int found = 0;
if (!extlen) {
int new = 0;
- error = gfs2_extent_map(ip->i_vnode, x, &new, &dblock, &extlen);
+ error = gfs2_extent_map(&ip->i_inode, x, &new, &dblock, &extlen);
if (error)
goto fail;
}