if (error)
goto out_rindex_relse;
- error = gfs2_trans_begin(sdp, RES_RG_BIT +
- RES_STATFS + RES_QUOTA, 1);
+ error = gfs2_trans_begin(sdp, RES_RG_BIT + RES_STATFS + RES_QUOTA, 1);
if (error)
goto out_rg_gunlock;
gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_inum_range_out(&ir, bh->b_data + sizeof(struct gfs2_dinode));
- out_brelse:
+out_brelse:
brelse(bh);
-
- out_end_trans:
+out_end_trans:
mutex_unlock(&sdp->sd_inum_mutex);
gfs2_trans_end(sdp);
-
- out:
+out:
gfs2_glock_dq_uninit(&gh);
-
return error;
}
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_di.di_mode & S_ISUID) && dip->i_di.di_uid) {
if (S_ISDIR(*mode))
*mode |= S_ISUID;
else if (dip->i_di.di_uid != current->fsuid)
out_ipreserv:
gfs2_inplace_release(dip);
-
out:
gfs2_alloc_put(dip);
-
return error;
}
}
kfree(p);
-
return error;
}
return error;
error = __gfs2_setattr_simple(ip, attr);
-
gfs2_trans_end(GFS2_SB(&ip->i_inode));
-
return error;
}
static inline void gfs2_buffer_clear_tail(struct buffer_head *bh, int head)
{
+ BUG_ON(head > bh->b_size);
memset(bh->b_data + head, 0, bh->b_size - head);
}
-static inline void gfs2_buffer_clear_ends(struct buffer_head *bh, int offset,
- int amount, int journaled)
-{
- int z_off1 = (journaled) ? sizeof(struct gfs2_meta_header) : 0;
- int z_len1 = offset - z_off1;
- int z_off2 = offset + amount;
- int z_len2 = (bh)->b_size - z_off2;
-
- if (z_len1)
- memset(bh->b_data + z_off1, 0, z_len1);
-
- if (z_len2)
- memset(bh->b_data + z_off2, 0, z_len2);
-}
-
static inline void gfs2_buffer_copy_tail(struct buffer_head *to_bh,
int to_head,
struct buffer_head *from_bh,
int from_head)
{
- memcpy(to_bh->b_data + to_head,
- from_bh->b_data + from_head,
+ BUG_ON(from_head < to_head);
+ memcpy(to_bh->b_data + to_head, from_bh->b_data + from_head,
from_bh->b_size - from_head);
memset(to_bh->b_data + to_bh->b_size + to_head - from_head,
- 0,
- from_head - to_head);
+ 0, from_head - to_head);
}
struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp);