ceph: remove useless IS_ERR checks
ceph_lookup_snap_realm either returns a valid pointer or NULL; there is no need to check IS_ERR(result). Reported-by: Julia Lawall <julia@diku.dk> Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
32c895e776
commit
75eb359281
@ -226,8 +226,6 @@ static int adjust_snap_realm_parent(struct ceph_mds_client *mdsc,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
parent = ceph_lookup_snap_realm(mdsc, parentino);
|
parent = ceph_lookup_snap_realm(mdsc, parentino);
|
||||||
if (IS_ERR(parent))
|
|
||||||
return PTR_ERR(parent);
|
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
parent = ceph_create_snap_realm(mdsc, parentino);
|
parent = ceph_create_snap_realm(mdsc, parentino);
|
||||||
if (IS_ERR(parent))
|
if (IS_ERR(parent))
|
||||||
@ -541,10 +539,6 @@ more:
|
|||||||
p += sizeof(u64) * le32_to_cpu(ri->num_prior_parent_snaps);
|
p += sizeof(u64) * le32_to_cpu(ri->num_prior_parent_snaps);
|
||||||
|
|
||||||
realm = ceph_lookup_snap_realm(mdsc, le64_to_cpu(ri->ino));
|
realm = ceph_lookup_snap_realm(mdsc, le64_to_cpu(ri->ino));
|
||||||
if (IS_ERR(realm)) {
|
|
||||||
err = PTR_ERR(realm);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
if (!realm) {
|
if (!realm) {
|
||||||
realm = ceph_create_snap_realm(mdsc, le64_to_cpu(ri->ino));
|
realm = ceph_create_snap_realm(mdsc, le64_to_cpu(ri->ino));
|
||||||
if (IS_ERR(realm)) {
|
if (IS_ERR(realm)) {
|
||||||
@ -762,8 +756,6 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
|
|||||||
ri = p;
|
ri = p;
|
||||||
|
|
||||||
realm = ceph_lookup_snap_realm(mdsc, split);
|
realm = ceph_lookup_snap_realm(mdsc, split);
|
||||||
if (IS_ERR(realm))
|
|
||||||
goto out;
|
|
||||||
if (!realm) {
|
if (!realm) {
|
||||||
realm = ceph_create_snap_realm(mdsc, split);
|
realm = ceph_create_snap_realm(mdsc, split);
|
||||||
if (IS_ERR(realm))
|
if (IS_ERR(realm))
|
||||||
@ -829,8 +821,6 @@ skip_inode:
|
|||||||
struct ceph_snap_realm *child =
|
struct ceph_snap_realm *child =
|
||||||
ceph_lookup_snap_realm(mdsc,
|
ceph_lookup_snap_realm(mdsc,
|
||||||
le64_to_cpu(split_realms[i]));
|
le64_to_cpu(split_realms[i]));
|
||||||
if (IS_ERR(child))
|
|
||||||
continue;
|
|
||||||
if (!child)
|
if (!child)
|
||||||
continue;
|
continue;
|
||||||
adjust_snap_realm_parent(mdsc, child, realm->ino);
|
adjust_snap_realm_parent(mdsc, child, realm->ino);
|
||||||
|
Loading…
Reference in New Issue
Block a user