{
LASSERT(dt);
LASSERT(dt->do_body_ops);
- LASSERT(dt->do_body_ops->dbo_ladvise);
+
+ if (!dt->do_body_ops->dbo_ladvise)
+ return -EOPNOTSUPP;
+
return dt->do_body_ops->dbo_ladvise(env, dt, start, end, advice);
}
__u64 end, int mode, struct thandle *th)
{
LASSERT(dt);
+
if (!dt->do_body_ops)
return -EOPNOTSUPP;
- LASSERT(dt->do_body_ops);
- LASSERT(dt->do_body_ops->dbo_declare_fallocate);
+
+ if (!dt->do_body_ops->dbo_declare_fallocate)
+ return -EOPNOTSUPP;
+
return dt->do_body_ops->dbo_declare_fallocate(env, dt, start, end,
mode, th);
}
struct thandle *th)
{
LASSERT(dt);
+
if (!dt->do_body_ops)
return -EOPNOTSUPP;
- LASSERT(dt->do_body_ops);
- LASSERT(dt->do_body_ops->dbo_fallocate);
+
+ if (!dt->do_body_ops->dbo_fallocate)
+ return -EOPNOTSUPP;
+
return dt->do_body_ops->dbo_fallocate(env, dt, start, end, mode, th);
}
0, oh, NULL, OSD_QID_BLK));
}
-static int osd_ladvise(const struct lu_env *env, struct dt_object *dt,
- __u64 start, __u64 end, enum lu_ladvise_type advice)
-{
- int rc;
-
- ENTRY;
- switch (advice) {
- default:
- rc = -ENOTSUPP;
- break;
- }
-
- RETURN(rc);
-}
-
-static int osd_fallocate(const struct lu_env *env, struct dt_object *dt,
- __u64 start, __u64 end, int mode, struct thandle *th)
-{
- int rc = -EOPNOTSUPP;
-
- ENTRY;
- /*
- * space preallocation is not supported for ZFS
- * Returns -EOPNOTSUPP for now
- */
- RETURN(rc);
-}
-
-static int osd_declare_fallocate(const struct lu_env *env,
- struct dt_object *dt, __u64 start, __u64 end,
- int mode, struct thandle *th)
-{
- int rc = -EOPNOTSUPP;
-
- ENTRY;
- /*
- * space preallocation is not supported for ZFS
- * Returns -EOPNOTSUPP for now
- */
- RETURN(rc);
-}
-
static loff_t osd_lseek(const struct lu_env *env, struct dt_object *dt,
loff_t offset, int whence)
{
.dbo_read_prep = osd_read_prep,
.dbo_declare_punch = osd_declare_punch,
.dbo_punch = osd_punch,
- .dbo_ladvise = osd_ladvise,
- .dbo_declare_fallocate = osd_declare_fallocate,
- .dbo_fallocate = osd_fallocate,
.dbo_lseek = osd_lseek,
};