aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/super.c10
-rw-r--r--fs/nilfs2/the_nilfs.c7
2 files changed, 3 insertions, 14 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 922263393c76..faa5078ff751 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -178,17 +178,9 @@ static int nilfs_sync_super(struct nilfs_sb_info *sbi, int flag)
178 178
179 retry: 179 retry:
180 set_buffer_dirty(nilfs->ns_sbh[0]); 180 set_buffer_dirty(nilfs->ns_sbh[0]);
181
182 if (nilfs_test_opt(sbi, BARRIER)) { 181 if (nilfs_test_opt(sbi, BARRIER)) {
183 err = __sync_dirty_buffer(nilfs->ns_sbh[0], 182 err = __sync_dirty_buffer(nilfs->ns_sbh[0],
184 WRITE_SYNC | WRITE_BARRIER); 183 WRITE_SYNC | WRITE_FLUSH_FUA);
185 if (err == -EOPNOTSUPP) {
186 nilfs_warning(sbi->s_super, __func__,
187 "barrier-based sync failed. "
188 "disabling barriers\n");
189 nilfs_clear_opt(sbi, BARRIER);
190 goto retry;
191 }
192 } else { 184 } else {
193 err = sync_dirty_buffer(nilfs->ns_sbh[0]); 185 err = sync_dirty_buffer(nilfs->ns_sbh[0]);
194 } 186 }
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
index ba7c10c917fc..d27715103376 100644
--- a/fs/nilfs2/the_nilfs.c
+++ b/fs/nilfs2/the_nilfs.c
@@ -775,9 +775,7 @@ int nilfs_discard_segments(struct the_nilfs *nilfs, __u64 *segnump,
775 ret = blkdev_issue_discard(nilfs->ns_bdev, 775 ret = blkdev_issue_discard(nilfs->ns_bdev,
776 start * sects_per_block, 776 start * sects_per_block,
777 nblocks * sects_per_block, 777 nblocks * sects_per_block,
778 GFP_NOFS, 778 GFP_NOFS, 0);
779 BLKDEV_IFL_WAIT |
780 BLKDEV_IFL_BARRIER);
781 if (ret < 0) 779 if (ret < 0)
782 return ret; 780 return ret;
783 nblocks = 0; 781 nblocks = 0;
@@ -787,8 +785,7 @@ int nilfs_discard_segments(struct the_nilfs *nilfs, __u64 *segnump,
787 ret = blkdev_issue_discard(nilfs->ns_bdev, 785 ret = blkdev_issue_discard(nilfs->ns_bdev,
788 start * sects_per_block, 786 start * sects_per_block,
789 nblocks * sects_per_block, 787 nblocks * sects_per_block,
790 GFP_NOFS, 788 GFP_NOFS, 0);
791 BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
792 return ret; 789 return ret;
793} 790}
794 791