linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices()
@ 2012-05-25  3:10 Asias He
  2012-05-25  3:10 ` [PATCH 2/2] block: Drop dead function blk_abort_queue() Asias He
  2012-05-28 13:41 ` [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices() David Sterba
  0 siblings, 2 replies; 6+ messages in thread
From: Asias He @ 2012-05-25  3:10 UTC (permalink / raw)
  To: linux-kernel, linux-btrfs; +Cc: Asias He, Chris Mason, Jens Axboe

1) This function is not used anywhere.

2) Using the blk_abort_queue() to abort the queue seems not correct.
blk_abort_queue() is used for timeout handling (block/blk-timeout.c).

Cc: Chris Mason <chris.mason@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Asias He <asias@redhat.com>
---
 fs/btrfs/disk-io.c |   13 -------------
 fs/btrfs/disk-io.h |    1 -
 2 files changed, 14 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index e1fe74a..3521866 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2902,19 +2902,6 @@ int write_ctree_super(struct btrfs_trans_handle *trans,
 	return ret;
 }
 
-/* Kill all outstanding I/O */
-void btrfs_abort_devices(struct btrfs_root *root)
-{
-	struct list_head *head;
-	struct btrfs_device *dev;
-	mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
-	head = &root->fs_info->fs_devices->devices;
-	list_for_each_entry_rcu(dev, head, dev_list) {
-		blk_abort_queue(dev->bdev->bd_disk->queue);
-	}
-	mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
-}
-
 void btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root)
 {
 	spin_lock(&fs_info->fs_roots_radix_lock);
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
index ab1830a..05b3fab 100644
--- a/fs/btrfs/disk-io.h
+++ b/fs/btrfs/disk-io.h
@@ -89,7 +89,6 @@ int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
 int btrfs_cleanup_transaction(struct btrfs_root *root);
 void btrfs_cleanup_one_transaction(struct btrfs_transaction *trans,
 				  struct btrfs_root *root);
-void btrfs_abort_devices(struct btrfs_root *root);
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 void btrfs_init_lockdep(void);
-- 
1.7.10.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] block: Drop dead function blk_abort_queue()
  2012-05-25  3:10 [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices() Asias He
@ 2012-05-25  3:10 ` Asias He
  2012-05-28 13:41 ` [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices() David Sterba
  1 sibling, 0 replies; 6+ messages in thread
From: Asias He @ 2012-05-25  3:10 UTC (permalink / raw)
  To: linux-kernel, linux-btrfs; +Cc: Asias He, Jens Axboe, Chris Mason

This function is only used by btrfs code in btrfs_abort_devices()
(seems in a wrong way). However, btrfs_abort_devices() is not used
anywhere. Let's remove the dead code to avoid any confusion.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org
Cc: Chris Mason <chris.mason@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Asias He <asias@redhat.com>
---
 block/blk-timeout.c    |   41 -----------------------------------------
 include/linux/blkdev.h |    1 -
 2 files changed, 42 deletions(-)

diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 7803548..6e4744c 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -197,44 +197,3 @@ void blk_add_timer(struct request *req)
 		mod_timer(&q->timeout, expiry);
 }
 
-/**
- * blk_abort_queue -- Abort all request on given queue
- * @queue:	pointer to queue
- *
- */
-void blk_abort_queue(struct request_queue *q)
-{
-	unsigned long flags;
-	struct request *rq, *tmp;
-	LIST_HEAD(list);
-
-	/*
-	 * Not a request based block device, nothing to abort
-	 */
-	if (!q->request_fn)
-		return;
-
-	spin_lock_irqsave(q->queue_lock, flags);
-
-	elv_abort_queue(q);
-
-	/*
-	 * Splice entries to local list, to avoid deadlocking if entries
-	 * get readded to the timeout list by error handling
-	 */
-	list_splice_init(&q->timeout_list, &list);
-
-	list_for_each_entry_safe(rq, tmp, &list, timeout_list)
-		blk_abort_request(rq);
-
-	/*
-	 * Occasionally, blk_abort_request() will return without
-	 * deleting the element from the list. Make sure we add those back
-	 * instead of leaving them on the local stack list.
-	 */
-	list_splice(&list, &q->timeout_list);
-
-	spin_unlock_irqrestore(q->queue_lock, flags);
-
-}
-EXPORT_SYMBOL_GPL(blk_abort_queue);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4d4ac24..dcd9738 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -809,7 +809,6 @@ extern bool __blk_end_request_err(struct request *rq, int error);
 extern void blk_complete_request(struct request *);
 extern void __blk_complete_request(struct request *);
 extern void blk_abort_request(struct request *);
-extern void blk_abort_queue(struct request_queue *);
 extern void blk_unprep_request(struct request *);
 
 /*
-- 
1.7.10.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices()
  2012-05-25  3:10 [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices() Asias He
  2012-05-25  3:10 ` [PATCH 2/2] block: Drop dead function blk_abort_queue() Asias He
@ 2012-05-28 13:41 ` David Sterba
  2012-06-06  2:17   ` Asias He
  1 sibling, 1 reply; 6+ messages in thread
From: David Sterba @ 2012-05-28 13:41 UTC (permalink / raw)
  To: Asias He; +Cc: linux-kernel, linux-btrfs, Chris Mason, Jens Axboe, jeffm

On Fri, May 25, 2012 at 11:10:21AM +0800, Asias He wrote:
> 1) This function is not used anywhere.

This was added in 49b25e0540904be0bf558b84475c69d72e4de66e adding a
transaction abort infrastructure.  I'm not sure if Jeff had some
intentions with it or whether it got obsolete during the patchset long
evolution, CCed.


david


> 2) Using the blk_abort_queue() to abort the queue seems not correct.
> blk_abort_queue() is used for timeout handling (block/blk-timeout.c).
> 
> Cc: Chris Mason <chris.mason@oracle.com>
> Cc: linux-btrfs@vger.kernel.org
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Asias He <asias@redhat.com>
> ---
>  fs/btrfs/disk-io.c |   13 -------------
>  fs/btrfs/disk-io.h |    1 -
>  2 files changed, 14 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index e1fe74a..3521866 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -2902,19 +2902,6 @@ int write_ctree_super(struct btrfs_trans_handle *trans,
>  	return ret;
>  }
>  
> -/* Kill all outstanding I/O */
> -void btrfs_abort_devices(struct btrfs_root *root)
> -{
> -	struct list_head *head;
> -	struct btrfs_device *dev;
> -	mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
> -	head = &root->fs_info->fs_devices->devices;
> -	list_for_each_entry_rcu(dev, head, dev_list) {
> -		blk_abort_queue(dev->bdev->bd_disk->queue);
> -	}
> -	mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
> -}
> -
>  void btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root)
>  {
>  	spin_lock(&fs_info->fs_roots_radix_lock);
> diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
> index ab1830a..05b3fab 100644
> --- a/fs/btrfs/disk-io.h
> +++ b/fs/btrfs/disk-io.h
> @@ -89,7 +89,6 @@ int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
>  int btrfs_cleanup_transaction(struct btrfs_root *root);
>  void btrfs_cleanup_one_transaction(struct btrfs_transaction *trans,
>  				  struct btrfs_root *root);
> -void btrfs_abort_devices(struct btrfs_root *root);
>  
>  #ifdef CONFIG_DEBUG_LOCK_ALLOC
>  void btrfs_init_lockdep(void);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices()
  2012-05-28 13:41 ` [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices() David Sterba
@ 2012-06-06  2:17   ` Asias He
  2012-06-06  9:24     ` David Sterba
  0 siblings, 1 reply; 6+ messages in thread
From: Asias He @ 2012-06-06  2:17 UTC (permalink / raw)
  To: linux-kernel, linux-btrfs, Chris Mason, Jens Axboe, jeffm

Hello, Jeff

On 05/28/2012 09:41 PM, David Sterba wrote:
> On Fri, May 25, 2012 at 11:10:21AM +0800, Asias He wrote:
>> 1) This function is not used anywhere.
>
> This was added in 49b25e0540904be0bf558b84475c69d72e4de66e adding a
> transaction abort infrastructure.  I'm not sure if Jeff had some
> intentions with it or whether it got obsolete during the patchset long
> evolution, CCed.

Any comments?

>
>
> david
>
>
>> 2) Using the blk_abort_queue() to abort the queue seems not correct.
>> blk_abort_queue() is used for timeout handling (block/blk-timeout.c).
>>
>> Cc: Chris Mason<chris.mason@oracle.com>
>> Cc: linux-btrfs@vger.kernel.org
>> Cc: Jens Axboe<axboe@kernel.dk>
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Asias He<asias@redhat.com>
>> ---
>>   fs/btrfs/disk-io.c |   13 -------------
>>   fs/btrfs/disk-io.h |    1 -
>>   2 files changed, 14 deletions(-)
>>
>> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
>> index e1fe74a..3521866 100644
>> --- a/fs/btrfs/disk-io.c
>> +++ b/fs/btrfs/disk-io.c
>> @@ -2902,19 +2902,6 @@ int write_ctree_super(struct btrfs_trans_handle *trans,
>>   	return ret;
>>   }
>>
>> -/* Kill all outstanding I/O */
>> -void btrfs_abort_devices(struct btrfs_root *root)
>> -{
>> -	struct list_head *head;
>> -	struct btrfs_device *dev;
>> -	mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
>> -	head =&root->fs_info->fs_devices->devices;
>> -	list_for_each_entry_rcu(dev, head, dev_list) {
>> -		blk_abort_queue(dev->bdev->bd_disk->queue);
>> -	}
>> -	mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
>> -}
>> -
>>   void btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root)
>>   {
>>   	spin_lock(&fs_info->fs_roots_radix_lock);
>> diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
>> index ab1830a..05b3fab 100644
>> --- a/fs/btrfs/disk-io.h
>> +++ b/fs/btrfs/disk-io.h
>> @@ -89,7 +89,6 @@ int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
>>   int btrfs_cleanup_transaction(struct btrfs_root *root);
>>   void btrfs_cleanup_one_transaction(struct btrfs_transaction *trans,
>>   				  struct btrfs_root *root);
>> -void btrfs_abort_devices(struct btrfs_root *root);
>>
>>   #ifdef CONFIG_DEBUG_LOCK_ALLOC
>>   void btrfs_init_lockdep(void);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


-- 
Asias

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices()
  2012-06-06  2:17   ` Asias He
@ 2012-06-06  9:24     ` David Sterba
  2012-06-06 12:38       ` Asias He
  0 siblings, 1 reply; 6+ messages in thread
From: David Sterba @ 2012-06-06  9:24 UTC (permalink / raw)
  To: Asias He; +Cc: linux-kernel, linux-btrfs, Chris Mason, Jens Axboe, jeffm

On Wed, Jun 06, 2012 at 10:17:28AM +0800, Asias He wrote:
> Hello, Jeff
> >This was added in 49b25e0540904be0bf558b84475c69d72e4de66e adding a
> >transaction abort infrastructure.  I'm not sure if Jeff had some
> >intentions with it or whether it got obsolete during the patchset long
> >evolution, CCed.
> 
> Any comments?

Has been merged via the 3.5 -rc1 pull, commit
d07eb9117050c9ed3f78296ebcc06128b52693be

david

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices()
  2012-06-06  9:24     ` David Sterba
@ 2012-06-06 12:38       ` Asias He
  0 siblings, 0 replies; 6+ messages in thread
From: Asias He @ 2012-06-06 12:38 UTC (permalink / raw)
  To: linux-kernel, linux-btrfs, Chris Mason, Jens Axboe, jeffm

On 06/06/2012 05:24 PM, David Sterba wrote:
> On Wed, Jun 06, 2012 at 10:17:28AM +0800, Asias He wrote:
>> Hello, Jeff
>>> This was added in 49b25e0540904be0bf558b84475c69d72e4de66e adding a
>>> transaction abort infrastructure.  I'm not sure if Jeff had some
>>> intentions with it or whether it got obsolete during the patchset long
>>> evolution, CCed.
>>
>> Any comments?
>
> Has been merged via the 3.5 -rc1 pull, commit
> d07eb9117050c9ed3f78296ebcc06128b52693be

Great.

-- 
Asias

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-06 12:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-25  3:10 [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices() Asias He
2012-05-25  3:10 ` [PATCH 2/2] block: Drop dead function blk_abort_queue() Asias He
2012-05-28 13:41 ` [PATCH 1/2] btrfs: Drop unused function btrfs_abort_devices() David Sterba
2012-06-06  2:17   ` Asias He
2012-06-06  9:24     ` David Sterba
2012-06-06 12:38       ` Asias He

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).