You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Btrfs: add mount -o auto_defrag
This will detect small random writes into files and queue the up for an auto defrag process. It isn't well suited to database workloads yet, but works for smaller files such as rpm, sqlite or bdb databases. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
+6
-1
@@ -160,7 +160,7 @@ enum {
|
||||
Opt_compress_type, Opt_compress_force, Opt_compress_force_type,
|
||||
Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard,
|
||||
Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed,
|
||||
Opt_enospc_debug, Opt_subvolrootid, Opt_err,
|
||||
Opt_enospc_debug, Opt_subvolrootid, Opt_defrag, Opt_err,
|
||||
};
|
||||
|
||||
static match_table_t tokens = {
|
||||
@@ -191,6 +191,7 @@ static match_table_t tokens = {
|
||||
{Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"},
|
||||
{Opt_enospc_debug, "enospc_debug"},
|
||||
{Opt_subvolrootid, "subvolrootid=%d"},
|
||||
{Opt_defrag, "autodefrag"},
|
||||
{Opt_err, NULL},
|
||||
};
|
||||
|
||||
@@ -369,6 +370,10 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
|
||||
case Opt_enospc_debug:
|
||||
btrfs_set_opt(info->mount_opt, ENOSPC_DEBUG);
|
||||
break;
|
||||
case Opt_defrag:
|
||||
printk(KERN_INFO "btrfs: enabling auto defrag");
|
||||
btrfs_set_opt(info->mount_opt, AUTO_DEFRAG);
|
||||
break;
|
||||
case Opt_err:
|
||||
printk(KERN_INFO "btrfs: unrecognized mount option "
|
||||
"'%s'\n", p);
|
||||
|
||||
Reference in New Issue
Block a user