linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Timofey Titovets <nefelim4ag@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Timofey Titovets <nefelim4ag@gmail.com>
Subject: [PATCH v6 1/6] Btrfs: heuristic make use compression workspaces
Date: Thu, 24 Aug 2017 01:45:40 +0300	[thread overview]
Message-ID: <20170823224545.16375-2-nefelim4ag@gmail.com> (raw)
In-Reply-To: <20170823224545.16375-1-nefelim4ag@gmail.com>

Move heuristic to external file
Implement compression workspaces support for
heuristic resources

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
---
 fs/btrfs/heuristic.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/heuristic.c b/fs/btrfs/heuristic.c
index 96ae3e9334bc..d0e9f9112b7e 100644
--- a/fs/btrfs/heuristic.c
+++ b/fs/btrfs/heuristic.c
@@ -48,14 +48,20 @@ static int heuristic(struct list_head *ws, struct inode *inode,
 {
 	struct page *page;
 	u64 index, index_end;
-	u8 *input_data;

 	index = start >> PAGE_SHIFT;
 	index_end = end >> PAGE_SHIFT;

+	/*
+	 * If end aligned to PAGE_SIZE
+	 * It's useless to check +1 PAGE
+	 */
+	if(end%PAGE_SIZE == 0)
+		index_end--;
+
 	for (; index <= index_end; index++) {
 		page = find_get_page(inode->i_mapping, index);
-		input_data = kmap(page);
+		kmap(page);
 		kunmap(page);
 		put_page(page);
 	}
--
2.14.1

  reply	other threads:[~2017-08-23 22:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 22:45 [PATCH v6 0/6] Btrfs: populate heuristic with code Timofey Titovets
2017-08-23 22:45 ` Timofey Titovets [this message]
2017-08-23 22:45 ` [PATCH v6 2/6] Btrfs: heuristic workspace add bucket and sample items Timofey Titovets
2017-08-23 22:45 ` [PATCH v6 3/6] Btrfs: implement heuristic sampling logic Timofey Titovets
2017-08-23 22:45 ` [PATCH v6 4/6] Btrfs: heuristic add detection of repeated data patterns Timofey Titovets
2017-08-23 22:45 ` [PATCH v6 5/6] Btrfs: heuristic add byte set calculation Timofey Titovets
2017-08-23 22:45 ` [PATCH v6 6/6] Btrfs: heuristic add byte core " Timofey Titovets

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=20170823224545.16375-2-nefelim4ag@gmail.com \
    --to=nefelim4ag@gmail.com \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).