Btrfs: adjust btrfs_discard_extent() return errors and trimmed bytes
authorLi Dongyang <lidongyang@novell.com>
Thu, 24 Mar 2011 10:24:27 +0000 (10:24 +0000)
committerroot <Chris Mason chris.mason@oracle.com>
Mon, 28 Mar 2011 09:37:46 +0000 (05:37 -0400)
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: Li Dongyang <lidongyang@novell.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

No differences found