Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322342
b: refs/heads/master
c: 9f0bbd8
h: refs/heads/master
v: v3
  • Loading branch information
Prasad Joshi committed Jul 23, 2012
1 parent 4c209d8 commit 7f96523
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41b93bc1ee7e7276db698dd66afa7b740cda517a
refs/heads/master: 9f0bbd8ca7905fcc0602c038013b095322fec939
14 changes: 6 additions & 8 deletions trunk/fs/logfs/dev_bdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,11 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index,
struct address_space *mapping = super->s_mapping_inode->i_mapping;
struct bio *bio;
struct page *page;
struct request_queue *q = bdev_get_queue(sb->s_bdev);
unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
unsigned int max_pages;
int i;

if (max_pages > BIO_MAX_PAGES)
max_pages = BIO_MAX_PAGES;
max_pages = min(nr_pages, (size_t) bio_get_nr_vecs(super->s_bdev));

bio = bio_alloc(GFP_NOFS, max_pages);
BUG_ON(!bio);

Expand Down Expand Up @@ -191,12 +190,11 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index,
{
struct logfs_super *super = logfs_super(sb);
struct bio *bio;
struct request_queue *q = bdev_get_queue(sb->s_bdev);
unsigned int max_pages = queue_max_hw_sectors(q) >> (PAGE_SHIFT - 9);
unsigned int max_pages;
int i;

if (max_pages > BIO_MAX_PAGES)
max_pages = BIO_MAX_PAGES;
max_pages = min(nr_pages, (size_t) bio_get_nr_vecs(super->s_bdev));

bio = bio_alloc(GFP_NOFS, max_pages);
BUG_ON(!bio);

Expand Down

0 comments on commit 7f96523

Please sign in to comment.