Skip to content

Commit f7e4c61

Browse files
author
Andreas Gruenbacher
committed
gfs2: Clean up gfs2_alloc_parms initializers
When intializing a struct, all fields that are not explicitly mentioned are zeroed out already. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 703df11 commit f7e4c61

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

fs/gfs2/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static vm_fault_t gfs2_page_mkwrite(struct vm_fault *vmf)
418418
struct inode *inode = file_inode(vmf->vma->vm_file);
419419
struct gfs2_inode *ip = GFS2_I(inode);
420420
struct gfs2_sbd *sdp = GFS2_SB(inode);
421-
struct gfs2_alloc_parms ap = { .aflags = 0, };
421+
struct gfs2_alloc_parms ap = {};
422422
u64 offset = page_offset(page);
423423
unsigned int data_blocks, ind_blocks, rblocks;
424424
vm_fault_t ret = VM_FAULT_LOCKED;
@@ -1251,7 +1251,7 @@ static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t
12511251
struct inode *inode = file_inode(file);
12521252
struct gfs2_sbd *sdp = GFS2_SB(inode);
12531253
struct gfs2_inode *ip = GFS2_I(inode);
1254-
struct gfs2_alloc_parms ap = { .aflags = 0, };
1254+
struct gfs2_alloc_parms ap = {};
12551255
unsigned int data_blocks = 0, ind_blocks = 0, rblocks;
12561256
loff_t bytes, max_bytes, max_blks;
12571257
int error;

fs/gfs2/quota.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
909909
{
910910
struct gfs2_sbd *sdp = (*qda)->qd_sbd;
911911
struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
912-
struct gfs2_alloc_parms ap = { .aflags = 0, };
912+
struct gfs2_alloc_parms ap = {};
913913
unsigned int data_blocks, ind_blocks;
914914
struct gfs2_holder *ghs, i_gh;
915915
unsigned int qx, x;
@@ -1741,7 +1741,7 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid,
17411741
if (gfs2_is_stuffed(ip))
17421742
alloc_required = 1;
17431743
if (alloc_required) {
1744-
struct gfs2_alloc_parms ap = { .aflags = 0, };
1744+
struct gfs2_alloc_parms ap = {};
17451745
gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota),
17461746
&data_blocks, &ind_blocks);
17471747
blocks = 1 + data_blocks + ind_blocks;

0 commit comments

Comments
 (0)