Whamcloud - gitweb
LU-13765 osd-ldiskfs: Rename dt_declare_falloc to dt_declare_fallocate 09/40509/2
authorArshad Hussain <arshad.super@gmail.com>
Sun, 1 Nov 2020 03:33:13 +0000 (09:03 +0530)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Nov 2020 08:13:57 +0000 (08:13 +0000)
This patch is the follow up of the patch: 93f700ca24
(LU-13765 osd-ldiskfs: Extend credit correctly for fallocate) and
it makes these changes:

01. Rename dt_declare_falloc() to dt_declare_fallocate()
for better readability.

02. Removes fallocate mode check under osd_fallocate()
as mode check is already done under declare phase.

03. Minor space/tabs changes

Test-Parameters: trivial testlist=sanity ostsizegb=12 env=ONLY="150e"
Test-Parameters: testlist=sanity-quota
Signed-off-by: Arshad Hussain <arshad.super@gmail.com>
Change-Id: If911a59a9c944e660e9926f4c436a4aeb2919284
Reviewed-on: https://review.whamcloud.com/40509
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/dt_object.h
lustre/ofd/ofd_objects.c
lustre/osd-ldiskfs/osd_io.c

index 5146cc1..264d161 100644 (file)
@@ -2587,9 +2587,9 @@ static inline int dt_ladvise(const struct lu_env *env, struct dt_object *dt,
        return dt->do_body_ops->dbo_ladvise(env, dt, start, end, advice);
 }
 
        return dt->do_body_ops->dbo_ladvise(env, dt, start, end, advice);
 }
 
-static inline int dt_declare_falloc(const struct lu_env *env,
-                                   struct dt_object *dt, __u64 start,
-                                   __u64 end, int mode, struct thandle *th)
+static inline int dt_declare_fallocate(const struct lu_env *env,
+                                      struct dt_object *dt, __u64 start,
+                                      __u64 end, int mode, struct thandle *th)
 {
        LASSERT(dt);
        if (!dt->do_body_ops)
 {
        LASSERT(dt);
        if (!dt->do_body_ops)
index 5447b54..5ac4b74 100644 (file)
@@ -757,8 +757,8 @@ out:
  * \retval             negative value on error
  */
 int ofd_object_fallocate(const struct lu_env *env, struct ofd_object *fo,
  * \retval             negative value on error
  */
 int ofd_object_fallocate(const struct lu_env *env, struct ofd_object *fo,
-                       __u64 start, __u64 end, int mode, struct lu_attr *la,
-                       struct obdo *oa)
+                        __u64 start, __u64 end, int mode, struct lu_attr *la,
+                        struct obdo *oa)
 {
        struct ofd_thread_info *info = ofd_info(env);
        struct ofd_device *ofd = ofd_obj2dev(fo);
 {
        struct ofd_thread_info *info = ofd_info(env);
        struct ofd_device *ofd = ofd_obj2dev(fo);
@@ -795,7 +795,7 @@ int ofd_object_fallocate(const struct lu_env *env, struct ofd_object *fo,
        if (rc)
                GOTO(stop, rc);
 
        if (rc)
                GOTO(stop, rc);
 
-       rc = dt_declare_falloc(env, dob, start, end, mode, th);
+       rc = dt_declare_fallocate(env, dob, start, end, mode, th);
        if (rc)
                GOTO(stop, rc);
 
        if (rc)
                GOTO(stop, rc);
 
index 8ce4b08..d65421c 100644 (file)
@@ -2000,13 +2000,6 @@ static int osd_fallocate(const struct lu_env *env, struct dt_object *dt,
 
        ENTRY;
 
 
        ENTRY;
 
-       /*
-        * Only mode == 0 (which is standard prealloc) is supported now.
-        * Rest of mode options is not supported yet.
-        */
-       if (mode & ~FALLOC_FL_KEEP_SIZE)
-               RETURN(-EOPNOTSUPP);
-
        LASSERT(dt_object_exists(dt));
        LASSERT(osd_invariant(obj));
        LASSERT(inode != NULL);
        LASSERT(dt_object_exists(dt));
        LASSERT(osd_invariant(obj));
        LASSERT(inode != NULL);
@@ -2046,10 +2039,8 @@ static int osd_fallocate(const struct lu_env *env, struct dt_object *dt,
        map.m_lblk = boff;
        map.m_len = blen;
 
        map.m_lblk = boff;
        map.m_len = blen;
 
-       /*
-        * Don't normalize the request if it can fit in one extent so
-        * that it doesn't get unnecessarily split into multiple
-        * extents.
+       /* Don't normalize the request if it can fit in one extent so
+        * that it doesn't get unnecessarily split into multiple extents.
         */
        if (blen <= EXT_UNWRITTEN_MAX_LEN)
                flags |= LDISKFS_GET_BLOCKS_NO_NORMALIZE;
         */
        if (blen <= EXT_UNWRITTEN_MAX_LEN)
                flags |= LDISKFS_GET_BLOCKS_NO_NORMALIZE;