Add helper function for blkdev_issue_zeroout (sb_issue_discard)
authorLukas Czerner <lczerner@redhat.com>
Thu, 28 Oct 2010 01:30:04 +0000 (21:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Oct 2010 01:30:04 +0000 (21:30 -0400)
This is done the same way as helper sb_issue_discard for
blkdev_issue_discard.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
include/linux/blkdev.h

index 2c54906f678f10dd3b861c1de832c40e7405ff43..e5cb4d029689a1b9daef52eed22878581462cb82 100644 (file)
@@ -941,6 +941,14 @@ static inline int sb_issue_discard(struct super_block *sb,
        return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_NOFS,
                                   BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
 }
+static inline int sb_issue_zeroout(struct super_block *sb, sector_t block,
+               sector_t nr_blocks, gfp_t gfp_mask, unsigned long flags)
+{
+       return blkdev_issue_zeroout(sb->s_bdev,
+                                   block << (sb->s_blocksize_bits - 9),
+                                   nr_blocks << (sb->s_blocksize_bits - 9),
+                                   gfp_mask, flags);
+}
 
 extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);