diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-04 16:42:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-04 16:42:13 -0400 |
commit | 5fdf4939dc66307daf30a3d5355a2bfb9d207676 (patch) | |
tree | d446edd663f287dd869a228e1af43c67d0caab4e /fs/gfs2 | |
parent | c35bcfd8e4e11bdff2ffab823a13a59968426b15 (diff) | |
parent | 332f51d7db13ffb7fcbe2407ed5b3667bc3750a7 (diff) |
Merge tag 'gfs2-4.8.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull gfs2 updates from Bob Peterson:
"We've only got six GFS2 patches for this merge window. In patch
order:
- Fabian Frederick submitted a nice cleanup that uses the BIT macro
rather than bit shifting.
- Andreas Gruenbacher contributed a patch that fixes a long-standing
annoyance whereby GFS2 warned about dirty pages.
- Andreas also fixed a problem with the recent extended attribute
readahead feature.
- Chao Yu contributed a patch that checks the return code from
function register_shrinker and reacts accordingly. Previously, it
was not checked.
- Andreas Gruenbacher also fixed a problem whereby incore file
timestamps were forgotten if the file was invalidated. This merely
moves the assignment inside the inode glock where it belongs.
- Andreas also fixed a problem where incore timestamps were not
initialized"
* tag 'gfs2-4.8.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
gfs2: Initialize atime of I_NEW inodes
gfs2: Update file times after grabbing glock
gfs2: fix to detect failure of register_shrinker
gfs2: Fix extended attribute readahead optimization
gfs2: Remove dirty buffer warning from gfs2_releasepage
GFS2: use BIT() macro
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/aops.c | 19 | ||||
-rw-r--r-- | fs/gfs2/bmap.c | 6 | ||||
-rw-r--r-- | fs/gfs2/dir.c | 20 | ||||
-rw-r--r-- | fs/gfs2/file.c | 6 | ||||
-rw-r--r-- | fs/gfs2/glock.c | 10 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 4 | ||||
-rw-r--r-- | fs/gfs2/inode.h | 2 | ||||
-rw-r--r-- | fs/gfs2/main.c | 4 | ||||
-rw-r--r-- | fs/gfs2/meta_io.c | 35 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 8 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 4 | ||||
-rw-r--r-- | fs/gfs2/super.c | 2 |
12 files changed, 71 insertions, 49 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 82df36886938..5a6f52ea2722 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c | |||
@@ -187,7 +187,7 @@ static int __gfs2_jdata_writepage(struct page *page, struct writeback_control *w | |||
187 | ClearPageChecked(page); | 187 | ClearPageChecked(page); |
188 | if (!page_has_buffers(page)) { | 188 | if (!page_has_buffers(page)) { |
189 | create_empty_buffers(page, inode->i_sb->s_blocksize, | 189 | create_empty_buffers(page, inode->i_sb->s_blocksize, |
190 | (1 << BH_Dirty)|(1 << BH_Uptodate)); | 190 | BIT(BH_Dirty)|BIT(BH_Uptodate)); |
191 | } | 191 | } |
192 | gfs2_page_add_databufs(ip, page, 0, sdp->sd_vfs->s_blocksize-1); | 192 | gfs2_page_add_databufs(ip, page, 0, sdp->sd_vfs->s_blocksize-1); |
193 | } | 193 | } |
@@ -1147,6 +1147,16 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask) | |||
1147 | if (!page_has_buffers(page)) | 1147 | if (!page_has_buffers(page)) |
1148 | return 0; | 1148 | return 0; |
1149 | 1149 | ||
1150 | /* | ||
1151 | * From xfs_vm_releasepage: mm accommodates an old ext3 case where | ||
1152 | * clean pages might not have had the dirty bit cleared. Thus, it can | ||
1153 | * send actual dirty pages to ->releasepage() via shrink_active_list(). | ||
1154 | * | ||
1155 | * As a workaround, we skip pages that contain dirty buffers below. | ||
1156 | * Once ->releasepage isn't called on dirty pages anymore, we can warn | ||
1157 | * on dirty buffers like we used to here again. | ||
1158 | */ | ||
1159 | |||
1150 | gfs2_log_lock(sdp); | 1160 | gfs2_log_lock(sdp); |
1151 | spin_lock(&sdp->sd_ail_lock); | 1161 | spin_lock(&sdp->sd_ail_lock); |
1152 | head = bh = page_buffers(page); | 1162 | head = bh = page_buffers(page); |
@@ -1156,8 +1166,8 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask) | |||
1156 | bd = bh->b_private; | 1166 | bd = bh->b_private; |
1157 | if (bd && bd->bd_tr) | 1167 | if (bd && bd->bd_tr) |
1158 | goto cannot_release; | 1168 | goto cannot_release; |
1159 | if (buffer_pinned(bh) || buffer_dirty(bh)) | 1169 | if (buffer_dirty(bh) || WARN_ON(buffer_pinned(bh))) |
1160 | goto not_possible; | 1170 | goto cannot_release; |
1161 | bh = bh->b_this_page; | 1171 | bh = bh->b_this_page; |
1162 | } while(bh != head); | 1172 | } while(bh != head); |
1163 | spin_unlock(&sdp->sd_ail_lock); | 1173 | spin_unlock(&sdp->sd_ail_lock); |
@@ -1180,9 +1190,6 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask) | |||
1180 | 1190 | ||
1181 | return try_to_free_buffers(page); | 1191 | return try_to_free_buffers(page); |
1182 | 1192 | ||
1183 | not_possible: /* Should never happen */ | ||
1184 | WARN_ON(buffer_dirty(bh)); | ||
1185 | WARN_ON(buffer_pinned(bh)); | ||
1186 | cannot_release: | 1193 | cannot_release: |
1187 | spin_unlock(&sdp->sd_ail_lock); | 1194 | spin_unlock(&sdp->sd_ail_lock); |
1188 | gfs2_log_unlock(sdp); | 1195 | gfs2_log_unlock(sdp); |
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 6e2bec1cd289..645721f3ff00 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -82,8 +82,8 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
82 | } | 82 | } |
83 | 83 | ||
84 | if (!page_has_buffers(page)) | 84 | if (!page_has_buffers(page)) |
85 | create_empty_buffers(page, 1 << inode->i_blkbits, | 85 | create_empty_buffers(page, BIT(inode->i_blkbits), |
86 | (1 << BH_Uptodate)); | 86 | BIT(BH_Uptodate)); |
87 | 87 | ||
88 | bh = page_buffers(page); | 88 | bh = page_buffers(page); |
89 | 89 | ||
@@ -690,7 +690,7 @@ int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsi | |||
690 | BUG_ON(!dblock); | 690 | BUG_ON(!dblock); |
691 | BUG_ON(!new); | 691 | BUG_ON(!new); |
692 | 692 | ||
693 | bh.b_size = 1 << (inode->i_blkbits + (create ? 0 : 5)); | 693 | bh.b_size = BIT(inode->i_blkbits + (create ? 0 : 5)); |
694 | ret = gfs2_block_map(inode, lblock, &bh, create); | 694 | ret = gfs2_block_map(inode, lblock, &bh, create); |
695 | *extlen = bh.b_size >> inode->i_blkbits; | 695 | *extlen = bh.b_size >> inode->i_blkbits; |
696 | *dblock = bh.b_blocknr; | 696 | *dblock = bh.b_blocknr; |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index fcb59b23f1e3..db8fbeb62483 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -351,7 +351,7 @@ static __be64 *gfs2_dir_get_hash_table(struct gfs2_inode *ip) | |||
351 | if (hc) | 351 | if (hc) |
352 | return hc; | 352 | return hc; |
353 | 353 | ||
354 | hsize = 1 << ip->i_depth; | 354 | hsize = BIT(ip->i_depth); |
355 | hsize *= sizeof(__be64); | 355 | hsize *= sizeof(__be64); |
356 | if (hsize != i_size_read(&ip->i_inode)) { | 356 | if (hsize != i_size_read(&ip->i_inode)) { |
357 | gfs2_consist_inode(ip); | 357 | gfs2_consist_inode(ip); |
@@ -819,8 +819,8 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode, | |||
819 | 819 | ||
820 | if (ip->i_diskflags & GFS2_DIF_EXHASH) { | 820 | if (ip->i_diskflags & GFS2_DIF_EXHASH) { |
821 | struct gfs2_leaf *leaf; | 821 | struct gfs2_leaf *leaf; |
822 | unsigned hsize = 1 << ip->i_depth; | 822 | unsigned int hsize = BIT(ip->i_depth); |
823 | unsigned index; | 823 | unsigned int index; |
824 | u64 ln; | 824 | u64 ln; |
825 | if (hsize * sizeof(u64) != i_size_read(inode)) { | 825 | if (hsize * sizeof(u64) != i_size_read(inode)) { |
826 | gfs2_consist_inode(ip); | 826 | gfs2_consist_inode(ip); |
@@ -932,7 +932,7 @@ static int dir_make_exhash(struct inode *inode) | |||
932 | return -ENOSPC; | 932 | return -ENOSPC; |
933 | bn = bh->b_blocknr; | 933 | bn = bh->b_blocknr; |
934 | 934 | ||
935 | gfs2_assert(sdp, dip->i_entries < (1 << 16)); | 935 | gfs2_assert(sdp, dip->i_entries < BIT(16)); |
936 | leaf->lf_entries = cpu_to_be16(dip->i_entries); | 936 | leaf->lf_entries = cpu_to_be16(dip->i_entries); |
937 | 937 | ||
938 | /* Copy dirents */ | 938 | /* Copy dirents */ |
@@ -1041,7 +1041,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name) | |||
1041 | bn = nbh->b_blocknr; | 1041 | bn = nbh->b_blocknr; |
1042 | 1042 | ||
1043 | /* Compute the start and len of leaf pointers in the hash table. */ | 1043 | /* Compute the start and len of leaf pointers in the hash table. */ |
1044 | len = 1 << (dip->i_depth - be16_to_cpu(oleaf->lf_depth)); | 1044 | len = BIT(dip->i_depth - be16_to_cpu(oleaf->lf_depth)); |
1045 | half_len = len >> 1; | 1045 | half_len = len >> 1; |
1046 | if (!half_len) { | 1046 | if (!half_len) { |
1047 | pr_warn("i_depth %u lf_depth %u index %u\n", | 1047 | pr_warn("i_depth %u lf_depth %u index %u\n", |
@@ -1163,7 +1163,7 @@ static int dir_double_exhash(struct gfs2_inode *dip) | |||
1163 | int x; | 1163 | int x; |
1164 | int error = 0; | 1164 | int error = 0; |
1165 | 1165 | ||
1166 | hsize = 1 << dip->i_depth; | 1166 | hsize = BIT(dip->i_depth); |
1167 | hsize_bytes = hsize * sizeof(__be64); | 1167 | hsize_bytes = hsize * sizeof(__be64); |
1168 | 1168 | ||
1169 | hc = gfs2_dir_get_hash_table(dip); | 1169 | hc = gfs2_dir_get_hash_table(dip); |
@@ -1539,7 +1539,7 @@ static int dir_e_read(struct inode *inode, struct dir_context *ctx, | |||
1539 | int error = 0; | 1539 | int error = 0; |
1540 | unsigned depth = 0; | 1540 | unsigned depth = 0; |
1541 | 1541 | ||
1542 | hsize = 1 << dip->i_depth; | 1542 | hsize = BIT(dip->i_depth); |
1543 | hash = gfs2_dir_offset2hash(ctx->pos); | 1543 | hash = gfs2_dir_offset2hash(ctx->pos); |
1544 | index = hash >> (32 - dip->i_depth); | 1544 | index = hash >> (32 - dip->i_depth); |
1545 | 1545 | ||
@@ -1558,7 +1558,7 @@ static int dir_e_read(struct inode *inode, struct dir_context *ctx, | |||
1558 | if (error) | 1558 | if (error) |
1559 | break; | 1559 | break; |
1560 | 1560 | ||
1561 | len = 1 << (dip->i_depth - depth); | 1561 | len = BIT(dip->i_depth - depth); |
1562 | index = (index & ~(len - 1)) + len; | 1562 | index = (index & ~(len - 1)) + len; |
1563 | } | 1563 | } |
1564 | 1564 | ||
@@ -2113,7 +2113,7 @@ int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip) | |||
2113 | u64 leaf_no; | 2113 | u64 leaf_no; |
2114 | int error = 0, last; | 2114 | int error = 0, last; |
2115 | 2115 | ||
2116 | hsize = 1 << dip->i_depth; | 2116 | hsize = BIT(dip->i_depth); |
2117 | 2117 | ||
2118 | lp = gfs2_dir_get_hash_table(dip); | 2118 | lp = gfs2_dir_get_hash_table(dip); |
2119 | if (IS_ERR(lp)) | 2119 | if (IS_ERR(lp)) |
@@ -2126,7 +2126,7 @@ int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip) | |||
2126 | if (error) | 2126 | if (error) |
2127 | goto out; | 2127 | goto out; |
2128 | leaf = (struct gfs2_leaf *)bh->b_data; | 2128 | leaf = (struct gfs2_leaf *)bh->b_data; |
2129 | len = 1 << (dip->i_depth - be16_to_cpu(leaf->lf_depth)); | 2129 | len = BIT(dip->i_depth - be16_to_cpu(leaf->lf_depth)); |
2130 | 2130 | ||
2131 | next_index = (index & ~(len - 1)) + len; | 2131 | next_index = (index & ~(len - 1)) + len; |
2132 | last = ((next_index >= hsize) ? 1 : 0); | 2132 | last = ((next_index >= hsize) ? 1 : 0); |
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 320e65e61938..360188f162bd 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -395,9 +395,6 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
395 | 395 | ||
396 | sb_start_pagefault(inode->i_sb); | 396 | sb_start_pagefault(inode->i_sb); |
397 | 397 | ||
398 | /* Update file times before taking page lock */ | ||
399 | file_update_time(vma->vm_file); | ||
400 | |||
401 | ret = gfs2_rsqa_alloc(ip); | 398 | ret = gfs2_rsqa_alloc(ip); |
402 | if (ret) | 399 | if (ret) |
403 | goto out; | 400 | goto out; |
@@ -409,6 +406,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
409 | if (ret) | 406 | if (ret) |
410 | goto out_uninit; | 407 | goto out_uninit; |
411 | 408 | ||
409 | /* Update file times before taking page lock */ | ||
410 | file_update_time(vma->vm_file); | ||
411 | |||
412 | set_bit(GLF_DIRTY, &ip->i_gl->gl_flags); | 412 | set_bit(GLF_DIRTY, &ip->i_gl->gl_flags); |
413 | set_bit(GIF_SW_PAGED, &ip->i_flags); | 413 | set_bit(GIF_SW_PAGED, &ip->i_flags); |
414 | 414 | ||
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 3a90b2b5b9bb..14cbf60167a7 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -69,7 +69,7 @@ static atomic_t lru_count = ATOMIC_INIT(0); | |||
69 | static DEFINE_SPINLOCK(lru_lock); | 69 | static DEFINE_SPINLOCK(lru_lock); |
70 | 70 | ||
71 | #define GFS2_GL_HASH_SHIFT 15 | 71 | #define GFS2_GL_HASH_SHIFT 15 |
72 | #define GFS2_GL_HASH_SIZE (1 << GFS2_GL_HASH_SHIFT) | 72 | #define GFS2_GL_HASH_SIZE BIT(GFS2_GL_HASH_SHIFT) |
73 | 73 | ||
74 | static struct rhashtable_params ht_parms = { | 74 | static struct rhashtable_params ht_parms = { |
75 | .nelem_hint = GFS2_GL_HASH_SIZE * 3 / 4, | 75 | .nelem_hint = GFS2_GL_HASH_SIZE * 3 / 4, |
@@ -1781,7 +1781,13 @@ int __init gfs2_glock_init(void) | |||
1781 | return -ENOMEM; | 1781 | return -ENOMEM; |
1782 | } | 1782 | } |
1783 | 1783 | ||
1784 | register_shrinker(&glock_shrinker); | 1784 | ret = register_shrinker(&glock_shrinker); |
1785 | if (ret) { | ||
1786 | destroy_workqueue(gfs2_delete_workqueue); | ||
1787 | destroy_workqueue(glock_workqueue); | ||
1788 | rhashtable_destroy(&gl_hash_table); | ||
1789 | return ret; | ||
1790 | } | ||
1785 | 1791 | ||
1786 | return 0; | 1792 | return 0; |
1787 | } | 1793 | } |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e4da0ecd3285..fb3a810b506f 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -187,6 +187,10 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type, | |||
187 | } | 187 | } |
188 | 188 | ||
189 | gfs2_set_iop(inode); | 189 | gfs2_set_iop(inode); |
190 | |||
191 | inode->i_atime.tv_sec = 0; | ||
192 | inode->i_atime.tv_nsec = 0; | ||
193 | |||
190 | unlock_new_inode(inode); | 194 | unlock_new_inode(inode); |
191 | } | 195 | } |
192 | 196 | ||
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 7710dfd3af35..aace8ce34a18 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
@@ -85,7 +85,7 @@ static inline int gfs2_check_internal_file_size(struct inode *inode, | |||
85 | u64 size = i_size_read(inode); | 85 | u64 size = i_size_read(inode); |
86 | if (size < minsize || size > maxsize) | 86 | if (size < minsize || size > maxsize) |
87 | goto err; | 87 | goto err; |
88 | if (size & ((1 << inode->i_blkbits) - 1)) | 88 | if (size & (BIT(inode->i_blkbits) - 1)) |
89 | goto err; | 89 | goto err; |
90 | return 0; | 90 | return 0; |
91 | err: | 91 | err: |
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 74fd0139e6c2..67d1fc4668f7 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c | |||
@@ -145,7 +145,9 @@ static int __init init_gfs2_fs(void) | |||
145 | if (!gfs2_qadata_cachep) | 145 | if (!gfs2_qadata_cachep) |
146 | goto fail; | 146 | goto fail; |
147 | 147 | ||
148 | register_shrinker(&gfs2_qd_shrinker); | 148 | error = register_shrinker(&gfs2_qd_shrinker); |
149 | if (error) | ||
150 | goto fail; | ||
149 | 151 | ||
150 | error = register_filesystem(&gfs2_fs_type); | 152 | error = register_filesystem(&gfs2_fs_type); |
151 | if (error) | 153 | if (error) |
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 950b8be68e41..373639a59782 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -216,23 +216,26 @@ static void gfs2_meta_read_endio(struct bio *bio) | |||
216 | static void gfs2_submit_bhs(int op, int op_flags, struct buffer_head *bhs[], | 216 | static void gfs2_submit_bhs(int op, int op_flags, struct buffer_head *bhs[], |
217 | int num) | 217 | int num) |
218 | { | 218 | { |
219 | struct buffer_head *bh = bhs[0]; | 219 | while (num > 0) { |
220 | struct bio *bio; | 220 | struct buffer_head *bh = *bhs; |
221 | int i; | 221 | struct bio *bio; |
222 | 222 | ||
223 | if (!num) | 223 | bio = bio_alloc(GFP_NOIO, num); |
224 | return; | 224 | bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); |
225 | 225 | bio->bi_bdev = bh->b_bdev; | |
226 | bio = bio_alloc(GFP_NOIO, num); | 226 | while (num > 0) { |
227 | bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); | 227 | bh = *bhs; |
228 | bio->bi_bdev = bh->b_bdev; | 228 | if (!bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh))) { |
229 | for (i = 0; i < num; i++) { | 229 | BUG_ON(bio->bi_iter.bi_size == 0); |
230 | bh = bhs[i]; | 230 | break; |
231 | bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); | 231 | } |
232 | bhs++; | ||
233 | num--; | ||
234 | } | ||
235 | bio->bi_end_io = gfs2_meta_read_endio; | ||
236 | bio_set_op_attrs(bio, op, op_flags); | ||
237 | submit_bio(bio); | ||
232 | } | 238 | } |
233 | bio->bi_end_io = gfs2_meta_read_endio; | ||
234 | bio_set_op_attrs(bio, op, op_flags); | ||
235 | submit_bio(bio); | ||
236 | } | 239 | } |
237 | 240 | ||
238 | /** | 241 | /** |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index ef1e1822977f..ff72ac6439c8 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -58,7 +58,7 @@ static void gfs2_tune_init(struct gfs2_tune *gt) | |||
58 | gt->gt_quota_scale_num = 1; | 58 | gt->gt_quota_scale_num = 1; |
59 | gt->gt_quota_scale_den = 1; | 59 | gt->gt_quota_scale_den = 1; |
60 | gt->gt_new_files_jdata = 0; | 60 | gt->gt_new_files_jdata = 0; |
61 | gt->gt_max_readahead = 1 << 18; | 61 | gt->gt_max_readahead = BIT(18); |
62 | gt->gt_complain_secs = 10; | 62 | gt->gt_complain_secs = 10; |
63 | } | 63 | } |
64 | 64 | ||
@@ -284,7 +284,7 @@ static int gfs2_read_sb(struct gfs2_sbd *sdp, int silent) | |||
284 | 284 | ||
285 | sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - | 285 | sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - |
286 | GFS2_BASIC_BLOCK_SHIFT; | 286 | GFS2_BASIC_BLOCK_SHIFT; |
287 | sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift; | 287 | sdp->sd_fsb2bb = BIT(sdp->sd_fsb2bb_shift); |
288 | sdp->sd_diptrs = (sdp->sd_sb.sb_bsize - | 288 | sdp->sd_diptrs = (sdp->sd_sb.sb_bsize - |
289 | sizeof(struct gfs2_dinode)) / sizeof(u64); | 289 | sizeof(struct gfs2_dinode)) / sizeof(u64); |
290 | sdp->sd_inptrs = (sdp->sd_sb.sb_bsize - | 290 | sdp->sd_inptrs = (sdp->sd_sb.sb_bsize - |
@@ -302,7 +302,7 @@ static int gfs2_read_sb(struct gfs2_sbd *sdp, int silent) | |||
302 | 302 | ||
303 | /* Compute maximum reservation required to add a entry to a directory */ | 303 | /* Compute maximum reservation required to add a entry to a directory */ |
304 | 304 | ||
305 | hash_blocks = DIV_ROUND_UP(sizeof(u64) * (1 << GFS2_DIR_MAX_DEPTH), | 305 | hash_blocks = DIV_ROUND_UP(sizeof(u64) * BIT(GFS2_DIR_MAX_DEPTH), |
306 | sdp->sd_jbsize); | 306 | sdp->sd_jbsize); |
307 | 307 | ||
308 | ind_blocks = 0; | 308 | ind_blocks = 0; |
@@ -1089,7 +1089,7 @@ static int fill_super(struct super_block *sb, struct gfs2_args *args, int silent | |||
1089 | sdp->sd_sb.sb_bsize_shift = sb->s_blocksize_bits; | 1089 | sdp->sd_sb.sb_bsize_shift = sb->s_blocksize_bits; |
1090 | sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - | 1090 | sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - |
1091 | GFS2_BASIC_BLOCK_SHIFT; | 1091 | GFS2_BASIC_BLOCK_SHIFT; |
1092 | sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift; | 1092 | sdp->sd_fsb2bb = BIT(sdp->sd_fsb2bb_shift); |
1093 | 1093 | ||
1094 | sdp->sd_tune.gt_logd_secs = sdp->sd_args.ar_commit; | 1094 | sdp->sd_tune.gt_logd_secs = sdp->sd_args.ar_commit; |
1095 | sdp->sd_tune.gt_quota_quantum = sdp->sd_args.ar_quota_quantum; | 1095 | sdp->sd_tune.gt_quota_quantum = sdp->sd_args.ar_quota_quantum; |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 77930ca25303..8af2dfa09236 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -75,7 +75,7 @@ | |||
75 | #include "util.h" | 75 | #include "util.h" |
76 | 76 | ||
77 | #define GFS2_QD_HASH_SHIFT 12 | 77 | #define GFS2_QD_HASH_SHIFT 12 |
78 | #define GFS2_QD_HASH_SIZE (1 << GFS2_QD_HASH_SHIFT) | 78 | #define GFS2_QD_HASH_SIZE BIT(GFS2_QD_HASH_SHIFT) |
79 | #define GFS2_QD_HASH_MASK (GFS2_QD_HASH_SIZE - 1) | 79 | #define GFS2_QD_HASH_MASK (GFS2_QD_HASH_SIZE - 1) |
80 | 80 | ||
81 | /* Lock order: qd_lock -> bucket lock -> qd->lockref.lock -> lru lock */ | 81 | /* Lock order: qd_lock -> bucket lock -> qd->lockref.lock -> lru lock */ |
@@ -384,7 +384,7 @@ static int bh_get(struct gfs2_quota_data *qd) | |||
384 | block = qd->qd_slot / sdp->sd_qc_per_block; | 384 | block = qd->qd_slot / sdp->sd_qc_per_block; |
385 | offset = qd->qd_slot % sdp->sd_qc_per_block; | 385 | offset = qd->qd_slot % sdp->sd_qc_per_block; |
386 | 386 | ||
387 | bh_map.b_size = 1 << ip->i_inode.i_blkbits; | 387 | bh_map.b_size = BIT(ip->i_inode.i_blkbits); |
388 | error = gfs2_block_map(&ip->i_inode, block, &bh_map, 0); | 388 | error = gfs2_block_map(&ip->i_inode, block, &bh_map, 0); |
389 | if (error) | 389 | if (error) |
390 | goto fail; | 390 | goto fail; |
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 3a7e60bb39f8..e3ee387a6dfe 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -359,7 +359,7 @@ int gfs2_jdesc_check(struct gfs2_jdesc *jd) | |||
359 | struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); | 359 | struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); |
360 | u64 size = i_size_read(jd->jd_inode); | 360 | u64 size = i_size_read(jd->jd_inode); |
361 | 361 | ||
362 | if (gfs2_check_internal_file_size(jd->jd_inode, 8 << 20, 1 << 30)) | 362 | if (gfs2_check_internal_file_size(jd->jd_inode, 8 << 20, BIT(30))) |
363 | return -EIO; | 363 | return -EIO; |
364 | 364 | ||
365 | jd->jd_blocks = size >> sdp->sd_sb.sb_bsize_shift; | 365 | jd->jd_blocks = size >> sdp->sd_sb.sb_bsize_shift; |