diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-02-26 22:07:56 +0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2014-02-27 16:21:22 +0400 |
commit | fcf10d38afd2d39d08bf76c48ff9c12345770678 (patch) | |
tree | 8fa7801ad4144551ad1ad7369dbd61686a198ade /fs/gfs2 | |
parent | b1ab1e44b4fa3df97a25cc9bcc3c99244ad6945b (diff) | |
download | linux-fcf10d38afd2d39d08bf76c48ff9c12345770678.tar.xz |
GFS2: replace kmalloc - __vmalloc / memset 0
Use kzalloc and __vmalloc __GFP_ZERO for clean sd_quota_bitmap allocation.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/quota.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 8bec0e3192dd..a5cccf694e3f 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -1242,14 +1242,13 @@ int gfs2_quota_init(struct gfs2_sbd *sdp) bm_size = DIV_ROUND_UP(sdp->sd_quota_slots, 8 * sizeof(unsigned long)); bm_size *= sizeof(unsigned long); error = -ENOMEM; - sdp->sd_quota_bitmap = kmalloc(bm_size, GFP_NOFS|__GFP_NOWARN); + sdp->sd_quota_bitmap = kzalloc(bm_size, GFP_NOFS | __GFP_NOWARN); if (sdp->sd_quota_bitmap == NULL) - sdp->sd_quota_bitmap = __vmalloc(bm_size, GFP_NOFS, PAGE_KERNEL); + sdp->sd_quota_bitmap = __vmalloc(bm_size, GFP_NOFS | + __GFP_ZERO, PAGE_KERNEL); if (!sdp->sd_quota_bitmap) return error; - memset(sdp->sd_quota_bitmap, 0, bm_size); - for (x = 0; x < blocks; x++) { struct buffer_head *bh; const struct gfs2_quota_change *qc; |