fs/xl: Simplify bucket metadata reading. (#3486)

ObjectLayer GetObject() now returns the entire object
if starting offset is 0 and length is negative. This
also allows to simplify handler layer code where
we always had to use GetObjectInfo() before proceeding
to read bucket metadata files examples `policy.json`.

This also reduces one additional call overhead.
This commit is contained in:
Harshavardhana
2016-12-21 11:29:32 -08:00
committed by GitHub
parent f57f773189
commit 15b4c49621
6 changed files with 43 additions and 68 deletions

View File

@@ -69,7 +69,7 @@ func TestInitEventNotifierFaultyDisks(t *testing.T) {
}
// Test initEventNotifier() with faulty disks
for i := 1; i <= 5; i++ {
for i := 1; i <= 3; i++ {
fs.storage = newNaughtyDisk(fsstorage, map[int]error{i: errFaultyDisk}, nil)
if err := initEventNotifier(fs); errorCause(err) != errFaultyDisk {
t.Fatal("Unexpected error:", err)