linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: rwheeler@redhat.com, sandeen@redhat.com, jack@suse.cz,
	tytso@mit.edu, adilger@dilger.ca, lczerner@redhat.com
Subject: [PATCH 1/3] Add helper function for blkdev_issue_zeroout
Date: Fri, 20 Aug 2010 19:51:42 +0200	[thread overview]
Message-ID: <1282326704-14838-2-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1282326704-14838-1-git-send-email-lczerner@redhat.com>

This is done the same way as function sb_issue_discard for
blkdev_issue_discard.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 include/linux/blkdev.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 09a8402..a22939d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1023,6 +1023,14 @@ static inline int sb_issue_discard(struct super_block *sb,
 	return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
 				   BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
 }
+static inline int sb_issue_zeroout(struct super_block *sb,
+				   sector_t block, sector_t nr_blocks)
+{
+	block <<= (sb->s_blocksize_bits - 9);
+	nr_blocks <<= (sb->s_blocksize_bits - 9);
+	return blkdev_issue_zeroout(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
+				   BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
+}
 
 extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
 
-- 
1.7.2.1


  reply	other threads:[~2010-08-20 17:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20 17:51 [PATCH 0/3] Lazy itable initialization for Ext4 Lukas Czerner
2010-08-20 17:51 ` Lukas Czerner [this message]
2010-08-20 17:51 ` [PATCH 2/3] Add inititable/noinititable mount options for ext4 Lukas Czerner
2010-08-20 17:51 ` [PATCH 3/3] Add inode table initialization code into Ext4 Lukas Czerner
2010-08-23 22:59   ` Andreas Dilger
2010-08-24  9:01     ` Lukas Czerner
2010-08-25  6:08       ` Andreas Dilger
2010-08-25 13:00         ` Lukas Czerner
2010-08-24 12:38     ` Ric Wheeler
2010-08-26 11:03   ` Peng Tao
2010-08-26 12:14     ` Lukas Czerner
2010-08-26 14:15       ` Peng Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282326704-14838-2-git-send-email-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=rwheeler@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).