Skip to content
Commit 5378e607 authored by Li Dongyang's avatar Li Dongyang Committed by root
Browse files

Btrfs: adjust btrfs_discard_extent() return errors and trimmed bytes



Callers of btrfs_discard_extent() should check if we are mounted with -o discard,
as we want to make fitrim to work even the fs is not mounted with -o discard.
Also we should use REQ_DISCARD to map the free extent to get a full mapping,
last we only return errors if
1. the error is not a EOPNOTSUPP
2. no device supports discard

Signed-off-by: default avatarLi Dongyang <lidongyang@novell.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent fce3bb9a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment