From: Arshad Hussain Date: Sun, 1 Nov 2020 03:33:13 +0000 (+0530) Subject: LU-13765 osd-ldiskfs: Rename dt_declare_falloc to dt_declare_fallocate X-Git-Tag: 2.13.57~86 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6a2b9ef84274e319bce9a367cb0261aff3ae636b;p=fs%2Flustre-release.git LU-13765 osd-ldiskfs: Rename dt_declare_falloc to dt_declare_fallocate 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 Change-Id: If911a59a9c944e660e9926f4c436a4aeb2919284 Reviewed-on: https://review.whamcloud.com/40509 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Wang Shilong Reviewed-by: Andreas Dilger --- diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 5146cc1..264d161 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -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); } -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) diff --git a/lustre/ofd/ofd_objects.c b/lustre/ofd/ofd_objects.c index 5447b54..5ac4b74 100644 --- a/lustre/ofd/ofd_objects.c +++ b/lustre/ofd/ofd_objects.c @@ -757,8 +757,8 @@ out: * \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); @@ -795,7 +795,7 @@ int ofd_object_fallocate(const struct lu_env *env, struct ofd_object *fo, 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); diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 8ce4b08..d65421c 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -2000,13 +2000,6 @@ static int osd_fallocate(const struct lu_env *env, struct dt_object *dt, 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); @@ -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; - /* - * 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;