From: Boaz Harrosh <boaz@plexistor.com>
To: Jens Axboe <axboe@fb.com>, Dave Chinner <david@fromorbit.com>
Cc: Brian Foster <bfoster@redhat.com>,
fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH] brd: Only request 4K sectors if DAX is enabled
Date: Thu, 26 Feb 2015 10:41:46 +0200 [thread overview]
Message-ID: <54EEDC4A.8090000@plexistor.com> (raw)
In-Reply-To: <54EED5F6.2030804@plexistor.com>
People systems have been using ramdisk with
smaller-than-page-size blocks in their mkfs.
The 4K sectors is only important if we will be
using brd with a DAX filesystem.
So only enable 4K sectors if DAX is configured
Signed-off-by: Boaz Harrosh <boaz@plexistor.com>
---
drivers/block/brd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 6e0775b..e875f12 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -495,6 +495,7 @@ static struct brd_device *brd_alloc(int i)
blk_queue_max_hw_sectors(brd->brd_queue, 1024);
blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY);
+#ifdef CONFIG_BLK_DEV_RAM_DAX
/* This is so fdisk will align partitions on 4k, because of
* direct_access API needing 4k alignment, returning a PFN
* (This is only a problem on very small devices <= 4M,
@@ -502,6 +503,7 @@ static struct brd_device *brd_alloc(int i)
* is harmless)
*/
blk_queue_physical_block_size(brd->brd_queue, PAGE_SIZE);
+#endif
brd->brd_queue->limits.discard_granularity = PAGE_SIZE;
brd->brd_queue->limits.max_discard_sectors = UINT_MAX;
--
1.9.3
next prev parent reply other threads:[~2015-02-26 8:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 22:54 [PATCH v2 0/4] fstests: sector size fixes and whiteouts Dave Chinner
2015-02-24 22:54 ` [PATCH 1/4] xfs/104: log size too small for 4k sector drives Dave Chinner
2015-02-25 16:11 ` Brian Foster
2015-02-25 22:32 ` ramdisk problems in 4.0-rc1? (was Re: [PATCH 1/4] xfs/104: log size too small for 4k sector drives) Dave Chinner
2015-02-25 23:31 ` Brian Foster
2015-02-25 23:43 ` Dave Chinner
2015-02-26 7:46 ` Boaz Harrosh
2015-02-26 17:23 ` Brian Foster
2015-03-01 8:49 ` Boaz Harrosh
2015-03-01 14:28 ` Brian Foster
2015-02-27 0:58 ` Dave Chinner
2015-03-01 8:27 ` Boaz Harrosh
2015-03-02 1:09 ` Dave Chinner
2015-03-02 9:40 ` Boaz Harrosh
2015-02-26 8:14 ` [PATCH] brd: Re-instate ram disk visibility option (part_show) Boaz Harrosh
2015-02-26 8:41 ` Boaz Harrosh [this message]
2015-02-26 8:48 ` [PATCH] brd: Only request 4K sectors if DAX is enabled Boaz Harrosh
2015-02-27 0:23 ` Dave Chinner
2015-03-01 8:30 ` Boaz Harrosh
2015-02-24 22:54 ` [PATCH 2/4] xfs: don't output mkfs sector sizes into golden output Dave Chinner
2015-02-27 18:56 ` Brian Foster
2015-02-24 22:54 ` [PATCH 3/4] xfs/049: umount -d fails when kernel wins teardown race Dave Chinner
2015-02-27 18:56 ` Brian Foster
2015-02-24 22:54 ` [PATCH 4/4] generic: Add rudimetary RENAME_WHITEOUT test Dave Chinner
2015-02-27 18:57 ` Brian Foster
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=54EEDC4A.8090000@plexistor.com \
--to=boaz@plexistor.com \
--cc=axboe@fb.com \
--cc=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.