Skip to contentSkip to conversation

Fix section conflict of current_io_context

PATCH Martin Michlmayr 2 participants 2 messages May 15, 2007 Block layer

lore
Share & tools
lore
#0 lore raw

Building with GCC 4.2, I get the following error:

CC block/ll_rw_blk.o
block/ll_rw_blk.c:3751: error: __ksymtab_current_io_context causes a section type conflict

This is because current_io_context is both declared static and exported.

block/ll_rw_blk.c +2 -2
@@ -41,7 +41,7 @@ static void blk_unplug_timeout(unsigned long data);
 static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io);
 static void init_request_from_bio(struct request *req, struct bio *bio);
 static int __make_request(request_queue_t *q, struct bio *bio);
-static struct io_context *current_io_context(gfp_t gfp_flags, int node);
+struct io_context *current_io_context(gfp_t gfp_flags, int node);
 
 /*
  * For the allocated request tables
@@ -3723,7 +3723,7 @@ void exit_io_context(void)
  * but since the current task itself holds a reference, the context can be
  * used in general code, so long as it stays within `current` context.
  */
-static struct io_context *current_io_context(gfp_t gfp_flags, int node)
+struct io_context *current_io_context(gfp_t gfp_flags, int node)
 {
 	struct task_struct *tsk = current;
 	struct io_context *ret;
Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#1 lore raw
Quoted 21 lines · Martin Michlmayr

Building with GCC 4.2, I get the following error:

CC block/ll_rw_blk.o
block/ll_rw_blk.c:3751: error: __ksymtab_current_io_context causes a section type conflict

This is because current_io_context is both declared static and exported.

block/ll_rw_blk.c +1 -1
@@ -41,7 +41,7 @@ static void blk_unplug_timeout(unsigned long data);
 static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io);
 static void init_request_from_bio(struct request *req, struct bio *bio);
 static int __make_request(request_queue_t *q, struct bio *bio);
-static struct io_context *current_io_context(gfp_t gfp_flags, int node);
+struct io_context *current_io_context(gfp_t gfp_flags, int node);
 
 /*
  * For the allocated request tables

block/ll_rw_blk.c void exit_io_context(void) · line 3729

Quoted 8 lines
block/ll_rw_blk.c +1 -1
@@ -3723,7 +3723,7 @@ void exit_io_context(void)
  * but since the current task itself holds a reference, the context can be
  * used in general code, so long as it stays within `current` context.
  */
-static struct io_context *current_io_context(gfp_t gfp_flags, int node)
+struct io_context *current_io_context(gfp_t gfp_flags, int node)
 {
 	struct task_struct *tsk = current;
 	struct io_context *ret;

There are no users outside ll_rw_blk.c, so the export just needs to be removed.

block/ll_rw_blk.c +0 -1
index 1e853f4..b085d0e 100644
@@ -3807,7 +3807,6 @@ static struct io_context *current_io_context(gfp_t gfp_flags, int node)
 
 	return ret;
 }
-EXPORT_SYMBOL(current_io_context);
 
 /*
  * If the current task has no IO context then create one and initialise it.
Signature · 1 line
Jens Axboe