From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: [PATCH 2 of 7] block: Globalize bio_set and bio_vec_slab
Date: Sat, 07 Jun 2008 00:55:35 -0400 [thread overview]
Message-ID: <550d61001baa70aebab7.1212814535@sermon.lab.mkp.net> (raw)
In-Reply-To: <patchbomb.1212814533@sermon.lab.mkp.net>
2 files changed, 38 insertions(+), 28 deletions(-)
fs/bio.c | 36 ++++++++----------------------------
include/linux/bio.h | 30 ++++++++++++++++++++++++++++++
Move struct bio_set and biovec_slab definitions to bio.h so they can
be used outside of bio.c.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
diff -r fb6f53e13ff3 -r 550d61001baa fs/bio.c
--- a/fs/bio.c Sat Jun 07 00:45:14 2008 -0400
+++ b/fs/bio.c Sat Jun 07 00:45:14 2008 -0400
@@ -28,24 +28,9 @@
#include <linux/blktrace_api.h>
#include <scsi/sg.h> /* for struct sg_iovec */
-#define BIO_POOL_SIZE 2
-
static struct kmem_cache *bio_slab __read_mostly;
-#define BIOVEC_NR_POOLS 6
-
-/*
- * a small number of entries is fine, not going to be performance critical.
- * basically we just need to survive
- */
-#define BIO_SPLIT_ENTRIES 2
mempool_t *bio_split_pool __read_mostly;
-
-struct biovec_slab {
- int nr_vecs;
- char *name;
- struct kmem_cache *slab;
-};
/*
* if you change this list, also change bvec_alloc or things will
@@ -60,23 +45,18 @@
#undef BV
/*
- * bio_set is used to allow other portions of the IO system to
- * allocate their own private memory pools for bio and iovec structures.
- * These memory pools in turn all allocate from the bio_slab
- * and the bvec_slabs[].
- */
-struct bio_set {
- mempool_t *bio_pool;
- mempool_t *bvec_pools[BIOVEC_NR_POOLS];
-};
-
-/*
* fs_bio_set is the bio_set containing bio and iovec memory pools used by
* IO code that does not need private memory pools.
*/
-static struct bio_set *fs_bio_set;
+struct bio_set *fs_bio_set;
-static inline struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned long *idx, struct bio_set *bs)
+inline int bvec_nr_vecs(int idx)
+{
+ return bvec_slabs[idx].nr_vecs;
+}
+EXPORT_SYMBOL(bvec_nr_vecs);
+
+struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned long *idx, struct bio_set *bs)
{
struct bio_vec *bvl;
diff -r fb6f53e13ff3 -r 550d61001baa include/linux/bio.h
--- a/include/linux/bio.h Sat Jun 07 00:45:14 2008 -0400
+++ b/include/linux/bio.h Sat Jun 07 00:45:14 2008 -0400
@@ -333,6 +333,36 @@
int, int);
extern int bio_uncopy_user(struct bio *);
void zero_fill_bio(struct bio *bio);
+extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *);
+extern inline int bvec_nr_vecs(int idx);
+
+/*
+ * bio_set is used to allow other portions of the IO system to
+ * allocate their own private memory pools for bio and iovec structures.
+ * These memory pools in turn all allocate from the bio_slab
+ * and the bvec_slabs[].
+ */
+#define BIO_POOL_SIZE 2
+#define BIOVEC_NR_POOLS 6
+
+struct bio_set {
+ mempool_t *bio_pool;
+ mempool_t *bvec_pools[BIOVEC_NR_POOLS];
+};
+
+struct biovec_slab {
+ int nr_vecs;
+ char *name;
+ struct kmem_cache *slab;
+};
+
+extern struct bio_set *fs_bio_set;
+
+/*
+ * a small number of entries is fine, not going to be performance critical.
+ * basically we just need to survive
+ */
+#define BIO_SPLIT_ENTRIES 2
#ifdef CONFIG_HIGHMEM
/*
next prev parent reply other threads:[~2008-06-07 4:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-07 4:55 [PATCH 0 of 7] Block/SCSI Data Integrity Support Martin K. Petersen
2008-06-07 4:55 ` [PATCH 1 of 7] lib: Add support for the T10 Data Integrity Field CRC Martin K. Petersen
2008-06-07 4:55 ` Martin K. Petersen [this message]
2008-06-10 18:55 ` [PATCH 2 of 7] block: Globalize bio_set and bio_vec_slab Jeff Moyer
2008-06-07 4:55 ` [PATCH 3 of 7] block: Find bio sector offset given idx and offset Martin K. Petersen
2008-06-09 16:07 ` Jeff Moyer
2008-06-09 16:15 ` Martin K. Petersen
2008-06-10 19:02 ` Jeff Moyer
2008-06-07 4:55 ` [PATCH 4 of 7] block: bio data integrity support Martin K. Petersen
2008-06-07 14:45 ` Monakhov Dmitri
2008-06-09 15:05 ` Martin K. Petersen
2008-06-10 20:52 ` Jeff Moyer
2008-06-11 4:05 ` Martin K. Petersen
2008-06-11 17:41 ` Jeff Moyer
2008-06-07 4:55 ` [PATCH 5 of 7] block: Block/request layer " Martin K. Petersen
2008-06-08 4:27 ` Greg KH
2008-06-09 15:06 ` Martin K. Petersen
2008-06-07 4:55 ` [PATCH 6 of 7] scsi: Support devices with protection information (DIF) Martin K. Petersen
2008-06-07 4:55 ` [PATCH 7 of 7] Support for SCSI disk (SBC) Data Integrity Field Martin K. Petersen
2008-06-10 14:41 ` [PATCH 0 of 7] Block/SCSI Data Integrity Support Jeff Moyer
2008-06-10 15:28 ` Martin K. Petersen
2008-06-10 18:49 ` Jeff Moyer
2008-06-10 20:47 ` Martin K. Petersen
2008-06-10 20:53 ` Jeff Moyer
2008-07-17 13:55 ` Mike Snitzer
2008-07-17 15:35 ` Martin K. Petersen
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=550d61001baa70aebab7.1212814535@sermon.lab.mkp.net \
--to=martin.petersen@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®