linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>
Subject: [PATCH 01/14] btrfs: defrag, use unsigned type for extent thresh
Date: Thu,  2 Oct 2014 18:49:49 +0200	[thread overview]
Message-ID: <aab110abcbbf06b5d52d9974b4a72d3c7cd38537.1412264872.git.dsterba@suse.cz> (raw)
In-Reply-To: <cover.1412264871.git.dsterba@suse.cz>

Signed type mismatches the ioctl structure, all extent calculations are
done on unsigned types.

Signed-off-by: David Sterba <dsterba@suse.cz>
---
 fs/btrfs/ioctl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 0ff212757b95..87a7267a6bb2 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -885,7 +885,7 @@ out_unlock:
  * file you want to defrag, we return 0 to let you know to skip this
  * part of the file
  */
-static int check_defrag_in_cache(struct inode *inode, u64 offset, int thresh)
+static int check_defrag_in_cache(struct inode *inode, u64 offset, u32 thresh)
 {
 	struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
 	struct extent_map *em = NULL;
@@ -920,7 +920,7 @@ static int check_defrag_in_cache(struct inode *inode, u64 offset, int thresh)
  */
 static int find_new_extents(struct btrfs_root *root,
 			    struct inode *inode, u64 newer_than,
-			    u64 *off, int thresh)
+			    u64 *off, u32 thresh)
 {
 	struct btrfs_path *path;
 	struct btrfs_key min_key;
@@ -1029,7 +1029,7 @@ static bool defrag_check_next_extent(struct inode *inode, struct extent_map *em)
 	return ret;
 }
 
-static int should_defrag_range(struct inode *inode, u64 start, int thresh,
+static int should_defrag_range(struct inode *inode, u64 start, u32 thresh,
 			       u64 *last_len, u64 *skip, u64 *defrag_end,
 			       int compress)
 {
@@ -1259,7 +1259,7 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
 	int ret;
 	int defrag_count = 0;
 	int compress_type = BTRFS_COMPRESS_ZLIB;
-	int extent_thresh = range->extent_thresh;
+	u32 extent_thresh = range->extent_thresh;
 	unsigned long max_cluster = (256 * 1024) >> PAGE_CACHE_SHIFT;
 	unsigned long cluster = max_cluster;
 	u64 new_align = ~((u64)128 * 1024 - 1);
-- 
1.8.4.5


  reply	other threads:[~2014-10-02 16:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 16:49 [PATCH 00/14] Misc cleanups for 3.18 David Sterba
2014-10-02 16:49 ` David Sterba [this message]
2014-10-02 16:49 ` [PATCH 02/14] btrfs: remove unused variable from btrfs_parse_options David Sterba
2014-10-02 16:49 ` [PATCH 03/14] Btrfs: set default max_inline to 8KiB instead of 8MiB David Sterba
2014-10-02 16:50 ` [PATCH 04/14] btrfs: remove unused extent state bits David Sterba
2014-10-02 16:50 ` [PATCH 05/14] btrfs: use enum for wq endio metadata type David Sterba
2014-10-02 16:50 ` [PATCH 06/14] btrfs: fix error labels in init_btrfs_fs David Sterba
2014-10-02 16:50 ` [PATCH 07/14] btrfs: use slab for end_io_wq structures David Sterba
2014-10-02 16:50 ` [PATCH 08/14] btrfs: remove unused members from struct scrub_warning David Sterba
2014-10-02 16:50 ` [PATCH 09/14] btrfs: let merge_reloc_roots return void David Sterba
2014-10-02 16:50 ` [PATCH 10/14] btrfs: hide typecast to definition of BTRFS_SEND_TRANS_STUB David Sterba
2014-10-02 16:50 ` [PATCH 11/14] btrfs: drop constant param from btrfs_release_extent_buffer_page David Sterba
2014-10-02 16:50 ` [PATCH 12/14] btrfs: kill extent_buffer_page helper David Sterba
2014-10-02 16:50 ` [PATCH 13/14] btrfs: new define for the inline extent data start David Sterba
2014-10-02 16:50 ` [PATCH 14/14] btrfs: move checks for DUMMY_ROOT into a helper David Sterba

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=aab110abcbbf06b5d52d9974b4a72d3c7cd38537.1412264872.git.dsterba@suse.cz \
    --to=dsterba@suse.cz \
    --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).