Whamcloud - gitweb
LU-3606 fallocate: Implement fallocate preallocate operation
[fs/lustre-release.git] / lustre / osd-zfs / osd_io.c
index baef188..59902bd 100644 (file)
@@ -1119,6 +1119,32 @@ static int osd_ladvise(const struct lu_env *env, struct dt_object *dt,
        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, struct thandle *th)
+{
+       int rc = -EOPNOTSUPP;
+       ENTRY;
+
+        /*
+         * space preallocation is not supported for ZFS
+         * Returns -EOPNOTSUPP for now
+         */
+       RETURN(rc);
+}
+
 struct dt_body_operations osd_body_ops = {
        .dbo_read                       = osd_read,
        .dbo_declare_write              = osd_declare_write,
@@ -1132,6 +1158,8 @@ struct dt_body_operations osd_body_ops = {
        .dbo_declare_punch              = osd_declare_punch,
        .dbo_punch                      = osd_punch,
        .dbo_ladvise                    = osd_ladvise,
+       .dbo_declare_fallocate          = osd_declare_fallocate,
+       .dbo_fallocate                  = osd_fallocate,
 };
 
 struct dt_body_operations osd_body_scrub_ops = {