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>
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)
* \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);
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);
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);
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;