* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <linux/string.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
+
+#include <ldiskfs/ldiskfs.h>
+#include <ldiskfs/xattr.h>
+#undef ENTRY
+
#include "osd_internal.h"
-#include "xattr.h"
-#include "acl.h"
+#include <ldiskfs/acl.h>
/*
* List of all registered formats.
struct inode *inode = c->ic_object;
struct iam_idle_head *head;
struct buffer_head *bh;
- int err;
+ int err = 0;
LASSERT(mutex_is_locked(&c->ic_idle_mutex));
CERROR("%.16s: cannot load idle blocks, blk = %u, err = %d\n",
LDISKFS_SB(inode->i_sb)->s_es->s_volume_name, blk, err);
c->ic_idle_failed = 1;
+ err = err ? err : -EIO;
return ERR_PTR(err);
}
*bh = ldiskfs_bread(h, c->ic_object, (int)ptr, 0, &result);
if (*bh == NULL)
- result = -EIO;
+ result = result ? result : -EIO;
return result;
}
mutex_unlock(&c->ic_idle_mutex);
bh = ldiskfs_bread(NULL, inode, *b, 0, e);
- if (bh == NULL)
+ if (bh == NULL) {
+ *e = *e ? *e : -EIO;
return NULL;
+ }
goto got;
}
return bh;
newblock:
- bh = osd_ldiskfs_append(h, inode, b, e);
+ bh = osd_ldiskfs_append(h, inode, b);
+ if (IS_ERR(bh)) {
+ *e = PTR_ERR(bh);
+ bh = NULL;
+ }
+
return bh;
fail:
iam_unlock_htree(path->ip_container, lh);
do_corr(schedule());
err = iam_txn_dirty(handle, path, new_leaf);
- brelse(new_leaf);
if (err == 0)
err = ldiskfs_mark_inode_dirty(handle, obj);
do_corr(schedule());
} else
err = -ENOMEM;
+ brelse(new_leaf);
}
assert_inv(iam_leaf_check(leaf));
assert_inv(iam_leaf_check(&iam_leaf_path(leaf)->ip_leaf));