From: Mitch Harder <mitch.harder@sabayonlinux.org>
To: linux-btrfs@vger.kernel.org
Cc: Mitch Harder <mitch.harder@sabayonlinux.org>
Subject: [PATCH v2 2/2] Btrfs: Use common function to check lzo INCOMPAT on defrag.
Date: Fri, 20 Jul 2012 14:12:38 -0500 [thread overview]
Message-ID: <1342811558-5303-2-git-send-email-mitch.harder@sabayonlinux.org> (raw)
In-Reply-To: <1342811558-5303-1-git-send-email-mitch.harder@sabayonlinux.org>
When defragmenting with explicit lzo compression, simplify
the check for lzo INCOMPAT by using the new common function
introduced to support remounting with lzo compression.
Signed-off-by: Mitch Harder <mitch.harder@sabayonlinux.org>
---
fs/btrfs/ioctl.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 17facea..d5fd69e 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1042,11 +1042,9 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
u64 newer_than, unsigned long max_to_defrag)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
- struct btrfs_super_block *disk_super;
struct file_ra_state *ra = NULL;
unsigned long last_index;
u64 isize = i_size_read(inode);
- u64 features;
u64 last_len = 0;
u64 skip = 0;
u64 defrag_end = 0;
@@ -1233,11 +1231,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
mutex_unlock(&inode->i_mutex);
}
- disk_super = root->fs_info->super_copy;
- features = btrfs_super_incompat_flags(disk_super);
if (range->compress_type == BTRFS_COMPRESS_LZO) {
- features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO;
- btrfs_set_super_incompat_flags(disk_super, features);
+ btrfs_chk_lzo_incompat(root);
}
ret = defrag_count;
--
1.7.8.6
prev parent reply other threads:[~2012-07-20 19:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 19:12 [PATCH v2 1/2] Btrfs: Check INCOMPAT flags on remount with lzo compression Mitch Harder
2012-07-20 19:12 ` Mitch Harder [this message]
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=1342811558-5303-2-git-send-email-mitch.harder@sabayonlinux.org \
--to=mitch.harder@sabayonlinux.org \
--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).