* [PATCH] btrfs: reada: Remove unused function
@ 2015-01-04 0:59 Rickard Strandqvist
2015-01-05 13:33 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Rickard Strandqvist @ 2015-01-04 0:59 UTC (permalink / raw)
To: Chris Mason, Josef Bacik; +Cc: Rickard Strandqvist, linux-btrfs, linux-kernel
Remove the function btrfs_reada_detach() that is not used anywhere.
This was partially found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
fs/btrfs/ctree.h | 1 -
fs/btrfs/reada.c | 9 +--------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index fe69edd..030a7b5 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -4111,7 +4111,6 @@ struct reada_control {
struct reada_control *btrfs_reada_add(struct btrfs_root *root,
struct btrfs_key *start, struct btrfs_key *end);
int btrfs_reada_wait(void *handle);
-void btrfs_reada_detach(void *handle);
int btree_readahead_hook(struct btrfs_root *root, struct extent_buffer *eb,
u64 start, int err);
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
index b63ae20..97073c0c 100644
--- a/fs/btrfs/reada.c
+++ b/fs/btrfs/reada.c
@@ -37,7 +37,7 @@
* To trigger a readahead, btrfs_reada_add must be called. It will start
* a read ahead for the given range [start, end) on tree root. The returned
* handle can either be used to wait on the readahead to finish
- * (btrfs_reada_wait), or to send it to the background (btrfs_reada_detach).
+ * (btrfs_reada_wait).
*
* The read ahead works as follows:
* On btrfs_reada_add, the root of the tree is inserted into a radix_tree.
@@ -986,10 +986,3 @@ int btrfs_reada_wait(void *handle)
return 0;
}
#endif
-
-void btrfs_reada_detach(void *handle)
-{
- struct reada_control *rc = handle;
-
- kref_put(&rc->refcnt, reada_control_release);
-}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] btrfs: reada: Remove unused function
2015-01-04 0:59 [PATCH] btrfs: reada: Remove unused function Rickard Strandqvist
@ 2015-01-05 13:33 ` David Sterba
2015-01-06 10:42 ` Jiri Kosina
0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2015-01-05 13:33 UTC (permalink / raw)
To: Rickard Strandqvist; +Cc: Chris Mason, Josef Bacik, linux-btrfs, linux-kernel
On Sun, Jan 04, 2015 at 01:59:57AM +0100, Rickard Strandqvist wrote:
> Remove the function btrfs_reada_detach() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
No please, this function is part of public readahead API and similar
patch has been NACKed several times.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: reada: Remove unused function
2015-01-05 13:33 ` David Sterba
@ 2015-01-06 10:42 ` Jiri Kosina
2015-01-06 12:22 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2015-01-06 10:42 UTC (permalink / raw)
To: David Sterba
Cc: Rickard Strandqvist, Chris Mason, Josef Bacik, linux-btrfs,
linux-kernel
On Mon, 5 Jan 2015, David Sterba wrote:
> > Remove the function btrfs_reada_detach() that is not used anywhere.
> >
> > This was partially found by using a static code analysis program called cppcheck.
> >
> > Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>
> No please, this function is part of public readahead API and similar
> patch has been NACKed several times.
BTW how is this any kind of API for anybody, given it's not exported to
modules?
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: reada: Remove unused function
2015-01-06 10:42 ` Jiri Kosina
@ 2015-01-06 12:22 ` David Sterba
0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2015-01-06 12:22 UTC (permalink / raw)
To: Jiri Kosina
Cc: Rickard Strandqvist, Chris Mason, Josef Bacik, linux-btrfs,
linux-kernel
On Tue, Jan 06, 2015 at 11:42:07AM +0100, Jiri Kosina wrote:
> On Mon, 5 Jan 2015, David Sterba wrote:
>
> > > Remove the function btrfs_reada_detach() that is not used anywhere.
> > >
> > > This was partially found by using a static code analysis program called cppcheck.
> > >
> > > Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> >
> > No please, this function is part of public readahead API and similar
> > patch has been NACKed several times.
>
> BTW how is this any kind of API for anybody, given it's not exported to
> modules?
Scratch 'public' from the sentence, that was misleading. The API is internal to
btrfs. The readahead can work in synchronous and asynchronous modes, this
function is API to the async mode.
Documented at reada.c:
34 /*
35 * This is the implementation for the generic read ahead framework.
36 *
37 * To trigger a readahead, btrfs_reada_add must be called. It will start
38 * a read ahead for the given range [start, end) on tree root. The returned
39 * handle can either be used to wait on the readahead to finish
40 * (btrfs_reada_wait), or to send it to the background (btrfs_reada_detach).
41 *
...
I've experimented with it for readdir speedups, but I haven't finished that due
to other problems.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-06 12:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-04 0:59 [PATCH] btrfs: reada: Remove unused function Rickard Strandqvist
2015-01-05 13:33 ` David Sterba
2015-01-06 10:42 ` Jiri Kosina
2015-01-06 12:22 ` David Sterba
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).