{"id":2230313,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2230313/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/177747214590.4107473.12172144510741083607.stgit@frogsfrogsfrogs/","project":{"id":8,"url":"http://patchwork.ozlabs.org/api/1.1/projects/8/?format=json","name":"Linux ext4 filesystem development","link_name":"linux-ext4","list_id":"linux-ext4.vger.kernel.org","list_email":"linux-ext4@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<177747214590.4107473.12172144510741083607.stgit@frogsfrogsfrogs>","date":"2026-04-29T14:53:24","name":"[03/19] fuse2fs: implement iomap configuration","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"55dad231af65ca035c23b2cde411a20c85129c11","submitter":{"id":77032,"url":"http://patchwork.ozlabs.org/api/1.1/people/77032/?format=json","name":"Darrick J. Wong","email":"djwong@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/177747214590.4107473.12172144510741083607.stgit@frogsfrogsfrogs/mbox/","series":[{"id":502087,"url":"http://patchwork.ozlabs.org/api/1.1/series/502087/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=502087","date":"2026-04-29T14:53:09","name":"[01/19] fuse2fs: implement bare minimum iomap for file mapping reporting","version":1,"mbox":"http://patchwork.ozlabs.org/series/502087/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230313/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230313/checks/","tags":{},"headers":{"Return-Path":"\n <SRS0=eTZa=C4=vger.kernel.org=linux-ext4+bounces-16192-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=BQn43XuH;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=etza=c4=vger.kernel.org=linux-ext4+bounces-16192-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.234.253.10 arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org","gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=BQn43XuH;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16192-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"BQn43XuH\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5L5p6GM7z1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 00:58:22 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g5L5p5Jwdz4w02\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 00:58:22 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4g5L5p597qz4wQg; Thu, 30 Apr 2026 00:58:22 +1000 (AEST)","from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4g5L5l1yTxz4wLR\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 30 Apr 2026 00:58:19 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id C18CD30E33F0\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 29 Apr 2026 14:53:29 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 822CF35F60B;\n\tWed, 29 Apr 2026 14:53:25 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 4393C348860;\n\tWed, 29 Apr 2026 14:53:25 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 1F6B7C19425;\n\tWed, 29 Apr 2026 14:53:25 +0000 (UTC)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1777474702; cv=pass;\n\tb=MlYXOhJP/J/OtctBSr5NJY06Ubthq8L3USF51YwepCsbVIqZ0fgaKePz9GXWP4zqf0PQByHy9g67/s3Czblqw0aQdV3yw9mhfqIHj4aLN7mURQsv+hWdsoEYn4TY67S2Atc9TNEGRNLyiz7SMjaKosRFVUzX0e7C/TpHWZ2DipB1aKgZE0TzywtlVGhGSla67p+bEV2DP84vCTEt1Dwzk9hx3Iq2dyI2ZjAmaibdyz+m/DgzlDouUV9TN+rRvzQuUE2KF1rfuJR2rSMqiXetbzpdT8FkZC9dF2OeFO3hq+mcDXWEpyOOFK4O1co4zPVSNvwNMzVNP3jCsTy58Wm8fg==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777474405; cv=none;\n b=I08Ej0y6/4Yi1uaMiehHBDkuu+dKwuyIJyQ6LyZXQdXMRV2tlAuLBkN1jGYnqKh4JJlTPxcFJ7EKPXmwlB8ndiG8mIMaYLhTZCW0ImCdPLwueWxNadPl8IkFgNTfQhzNTeaRxFdbaeCrjyWsAQI+akyPeZcl04NqDfs/bk60cxY="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1777474702; c=relaxed/relaxed;\n\tbh=B7t5+HqDp4G6qJj0bk5Ul/Q5ab9+KAHA4/s5B2ZfMZo=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=AH81/cEdr64qD+CcbmGM09HMdeEfrAsD2KWqiXVP2nSJtQe7WkP6mUDpsuh7+672tuS1+CNGjcwma/zM58pAX0uJvP5QLCrXNd+JWUHwHwujlIwBfA5N+yQfIOSzj2RbQE9fhnzp+i0lSWA5G3tYthLdvOILyfTDcNsCxszB+PizJc4n4U20HNppi9KtZEWXjTNi8n/ybrwjpaun4izpteJDkXm7ms627i6rvJSsG0QOqDlvFlfP4kdOR+QRccqy70jIosPgFbnKLTbAU8JIHinqsAGfqj5RmtFLPR8o3tW2YHlPs4kWfNQz/DhtXwBoxwmGMYMav/FaZQlCrjRJew==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777474405; c=relaxed/simple;\n\tbh=5b8JXRY84oGHHIhcsgBig9mNPsyF7xzRBfsqkN+n4uM=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=m8+jvDpXGnWTy5mLDtVoExx8qqR+QWzL/WY7MAW4cEeVrN7GiEWLjcUMT/oqh6Ch1SyFIO65VAPhYYNTUvzQV+7qYkDM9Hk0nHnBBQMQ+sYvvhi+E+o72fxwcPsYTRojt9/tb0yJ1PVa35G1fAB17p+EZIhxzgnJkWBuaDNLz0g="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=BQn43XuH; dkim-atps=neutral;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16192-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=BQn43XuH; arc=none smtp.client-ip=10.30.226.201"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777474405;\n\tbh=5b8JXRY84oGHHIhcsgBig9mNPsyF7xzRBfsqkN+n4uM=;\n\th=Date:Subject:From:To:Cc:In-Reply-To:References:From;\n\tb=BQn43XuHFC8bGERwhJdlPVCEp9MXexOURGmZw6Hg42io2BbWvZRRGkTklMl09X/qM\n\t A+QbSOi40etPU9GGpBCnY5prYPc768PkuBcxJD67y8dA9haCmZfKwaLQyo7CEH5TUO\n\t pBM1ZXq88urPBgoTaqOIXVbI1dzugynczKnkr3Tw876qmU65WLJc+wjL5q25Tc6j9j\n\t n1WWbBaktnwUACSWT1W7q8Fh3lw6aUnqvoDTHOKw8cKQe+1vUmm4zWcMXp9T6UC60D\n\t k795Jh+O6AGiwu5beZXOoJiy/vYgco6cFewN0Lv2qxXxnvinTaxOZoAAx0XszLVZ6/\n\t k7nxbABzQsuRA==","Date":"Wed, 29 Apr 2026 07:53:24 -0700","Subject":"[PATCH 03/19] fuse2fs: implement iomap configuration","From":"\"Darrick J. Wong\" <djwong@kernel.org>","To":"tytso@mit.edu","Cc":"bernd@bsbernd.com, miklos@szeredi.hu, linux-ext4@vger.kernel.org,\n neal@gompa.dev, linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev,\n joannelkoong@gmail.com","Message-ID":"<177747214590.4107473.12172144510741083607.stgit@frogsfrogsfrogs>","In-Reply-To":"<177747214459.4107473.9520724883867588970.stgit@frogsfrogsfrogs>","References":"<177747214459.4107473.9520724883867588970.stgit@frogsfrogsfrogs>","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","X-Spam-Status":"No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"},"content":"From: Darrick J. Wong <djwong@kernel.org>\n\nUpload the filesystem geometry to the kernel when asked.\n\nSigned-off-by: \"Darrick J. Wong\" <djwong@kernel.org>\n---\n fuse4fs/fuse4fs.c |   98 +++++++++++++++++++++++++++++++++++++++++++++++++++--\n misc/fuse2fs.c    |   96 ++++++++++++++++++++++++++++++++++++++++++++++++++--\n 2 files changed, 188 insertions(+), 6 deletions(-)","diff":"diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c\nindex df2bda7cc22bf2..feb46bdfbac39b 100644\n--- a/fuse4fs/fuse4fs.c\n+++ b/fuse4fs/fuse4fs.c\n@@ -208,6 +208,10 @@ static inline uint64_t round_down(uint64_t b, unsigned int align)\n # define FL_ZERO_RANGE_FLAG (0)\n #endif\n \n+#ifndef NSEC_PER_SEC\n+# define NSEC_PER_SEC\t(1000000000L)\n+#endif\n+\n errcode_t ext2fs_check_ext3_journal(ext2_filsys fs);\n errcode_t ext2fs_run_ext3_journal(ext2_filsys *fs);\n \n@@ -995,9 +999,9 @@ static int update_atime(ext2_filsys fs, ext2_ino_t ino)\n \tEXT4_INODE_GET_XTIME(i_mtime, &mtime, pinode);\n \tget_now(&now);\n \n-\tdatime = atime.tv_sec + ((double)atime.tv_nsec / 1000000000);\n-\tdmtime = mtime.tv_sec + ((double)mtime.tv_nsec / 1000000000);\n-\tdnow = now.tv_sec + ((double)now.tv_nsec / 1000000000);\n+\tdatime = atime.tv_sec + ((double)atime.tv_nsec / NSEC_PER_SEC);\n+\tdmtime = mtime.tv_sec + ((double)mtime.tv_nsec / NSEC_PER_SEC);\n+\tdnow = now.tv_sec + ((double)now.tv_nsec / NSEC_PER_SEC);\n \n \t/*\n \t * If atime is newer than mtime and atime hasn't been updated in thirty\n@@ -6459,6 +6463,93 @@ static void op_iomap_end(fuse_req_t req, fuse_ino_t fino, uint64_t dontcare,\n \n \tfuse_reply_err(req, 0);\n }\n+\n+/*\n+ * Maximal extent format file size.\n+ * Resulting logical blkno at s_maxbytes must fit in our on-disk\n+ * extent format containers, within a sector_t, and within i_blocks\n+ * in the vfs.  ext4 inode has 48 bits of i_block in fsblock units,\n+ * so that won't be a limiting factor.\n+ *\n+ * However there is other limiting factor. We do store extents in the form\n+ * of starting block and length, hence the resulting length of the extent\n+ * covering maximum file size must fit into on-disk format containers as\n+ * well. Given that length is always by 1 unit bigger than max unit (because\n+ * we count 0 as well) we have to lower the s_maxbytes by one fs block.\n+ *\n+ * Note, this does *not* consider any metadata overhead for vfs i_blocks.\n+ */\n+static off_t fuse4fs_max_size(struct fuse4fs *ff, off_t upper_limit)\n+{\n+\toff_t res;\n+\n+\tif (!ext2fs_has_feature_huge_file(ff->fs->super)) {\n+\t\tupper_limit = (1LL << 32) - 1;\n+\n+\t\t/* total blocks in file system block size */\n+\t\tupper_limit >>= (ff->blocklog - 9);\n+\t\tupper_limit <<= ff->blocklog;\n+\t}\n+\n+\t/*\n+\t * 32-bit extent-start container, ee_block. We lower the maxbytes\n+\t * by one fs block, so ee_len can cover the extent of maximum file\n+\t * size\n+\t */\n+\tres = (1LL << 32) - 1;\n+\tres <<= ff->blocklog;\n+\n+\t/* Sanity check against vm- & vfs- imposed limits */\n+\tif (res > upper_limit)\n+\t\tres = upper_limit;\n+\n+\treturn res;\n+}\n+\n+static void op_iomap_config(fuse_req_t req,\n+\t\t\t    const struct fuse_iomap_config_params *p,\n+\t\t\t    size_t psize)\n+{\n+\tstruct fuse_iomap_config cfg = { };\n+\tstruct fuse4fs *ff = fuse4fs_get(req);\n+\text2_filsys fs;\n+\n+\tFUSE4FS_CHECK_CONTEXT(req);\n+\n+\tdbg_printf(ff, \"%s: flags=0x%llx maxbytes=0x%llx\\n\", __func__,\n+\t\t   (unsigned long long)p->flags,\n+\t\t   (unsigned long long)p->maxbytes);\n+\tfs = fuse4fs_start(ff);\n+\n+\tcfg.flags |= FUSE_IOMAP_CONFIG_UUID;\n+\tmemcpy(cfg.s_uuid, fs->super->s_uuid, sizeof(cfg.s_uuid));\n+\tcfg.s_uuid_len = sizeof(fs->super->s_uuid);\n+\n+\tcfg.flags |= FUSE_IOMAP_CONFIG_BLOCKSIZE;\n+\tcfg.s_blocksize = FUSE4FS_FSB_TO_B(ff, 1);\n+\n+\t/*\n+\t * If there inode is large enough to house i_[acm]time_extra then we\n+\t * can turn on nanosecond timestamps; i_crtime was the next field added\n+\t * after i_atime_extra.\n+\t */\n+\tcfg.flags |= FUSE_IOMAP_CONFIG_TIME;\n+\tif (fs->super->s_inode_size >=\n+\t    offsetof(struct ext2_inode_large, i_crtime)) {\n+\t\tcfg.s_time_gran = 1;\n+\t\tcfg.s_time_max = EXT4_EXTRA_TIMESTAMP_MAX;\n+\t} else {\n+\t\tcfg.s_time_gran = NSEC_PER_SEC;\n+\t\tcfg.s_time_max = EXT4_NON_EXTRA_TIMESTAMP_MAX;\n+\t}\n+\tcfg.s_time_min = EXT4_TIMESTAMP_MIN;\n+\n+\tcfg.flags |= FUSE_IOMAP_CONFIG_MAXBYTES;\n+\tcfg.s_maxbytes = fuse4fs_max_size(ff, p->maxbytes);\n+\n+\tfuse4fs_finish(ff, 0);\n+\tfuse_reply_iomap_config(req, &cfg);\n+}\n #endif /* HAVE_FUSE_IOMAP */\n \n static struct fuse_lowlevel_ops fs_ops = {\n@@ -6507,6 +6598,7 @@ static struct fuse_lowlevel_ops fs_ops = {\n #ifdef HAVE_FUSE_IOMAP\n \t.iomap_begin = op_iomap_begin,\n \t.iomap_end = op_iomap_end,\n+\t.iomap_config = op_iomap_config,\n #endif /* HAVE_FUSE_IOMAP */\n };\n \ndiff --git a/misc/fuse2fs.c b/misc/fuse2fs.c\nindex 15ebe6b39f1288..7df4e127e5981a 100644\n--- a/misc/fuse2fs.c\n+++ b/misc/fuse2fs.c\n@@ -191,6 +191,10 @@ static inline uint64_t round_down(uint64_t b, unsigned int align)\n # define FL_ZERO_RANGE_FLAG (0)\n #endif\n \n+#ifndef NSEC_PER_SEC\n+# define NSEC_PER_SEC\t(1000000000L)\n+#endif\n+\n errcode_t ext2fs_check_ext3_journal(ext2_filsys fs);\n errcode_t ext2fs_run_ext3_journal(ext2_filsys *fs);\n \n@@ -806,9 +810,9 @@ static int update_atime(ext2_filsys fs, ext2_ino_t ino)\n \tEXT4_INODE_GET_XTIME(i_mtime, &mtime, pinode);\n \tget_now(&now);\n \n-\tdatime = atime.tv_sec + ((double)atime.tv_nsec / 1000000000);\n-\tdmtime = mtime.tv_sec + ((double)mtime.tv_nsec / 1000000000);\n-\tdnow = now.tv_sec + ((double)now.tv_nsec / 1000000000);\n+\tdatime = atime.tv_sec + ((double)atime.tv_nsec / NSEC_PER_SEC);\n+\tdmtime = mtime.tv_sec + ((double)mtime.tv_nsec / NSEC_PER_SEC);\n+\tdnow = now.tv_sec + ((double)now.tv_nsec / NSEC_PER_SEC);\n \n \t/*\n \t * If atime is newer than mtime and atime hasn't been updated in thirty\n@@ -5692,6 +5696,91 @@ static int op_iomap_end(const char *path, uint64_t nodeid, uint64_t attr_ino,\n \n \treturn 0;\n }\n+\n+/*\n+ * Maximal extent format file size.\n+ * Resulting logical blkno at s_maxbytes must fit in our on-disk\n+ * extent format containers, within a sector_t, and within i_blocks\n+ * in the vfs.  ext4 inode has 48 bits of i_block in fsblock units,\n+ * so that won't be a limiting factor.\n+ *\n+ * However there is other limiting factor. We do store extents in the form\n+ * of starting block and length, hence the resulting length of the extent\n+ * covering maximum file size must fit into on-disk format containers as\n+ * well. Given that length is always by 1 unit bigger than max unit (because\n+ * we count 0 as well) we have to lower the s_maxbytes by one fs block.\n+ *\n+ * Note, this does *not* consider any metadata overhead for vfs i_blocks.\n+ */\n+static off_t fuse2fs_max_size(struct fuse2fs *ff, off_t upper_limit)\n+{\n+\toff_t res;\n+\n+\tif (!ext2fs_has_feature_huge_file(ff->fs->super)) {\n+\t\tupper_limit = (1LL << 32) - 1;\n+\n+\t\t/* total blocks in file system block size */\n+\t\tupper_limit >>= (ff->blocklog - 9);\n+\t\tupper_limit <<= ff->blocklog;\n+\t}\n+\n+\t/*\n+\t * 32-bit extent-start container, ee_block. We lower the maxbytes\n+\t * by one fs block, so ee_len can cover the extent of maximum file\n+\t * size\n+\t */\n+\tres = (1LL << 32) - 1;\n+\tres <<= ff->blocklog;\n+\n+\t/* Sanity check against vm- & vfs- imposed limits */\n+\tif (res > upper_limit)\n+\t\tres = upper_limit;\n+\n+\treturn res;\n+}\n+\n+static int op_iomap_config(const struct fuse_iomap_config_params *p,\n+\t\t\t   size_t psize, struct fuse_iomap_config *cfg)\n+{\n+\tstruct fuse2fs *ff = fuse2fs_get();\n+\text2_filsys fs;\n+\n+\tFUSE2FS_CHECK_CONTEXT(ff);\n+\n+\tdbg_printf(ff, \"%s: flags=0x%llx maxbytes=0x%llx\\n\", __func__,\n+\t\t   (unsigned long long)p->flags,\n+\t\t   (unsigned long long)p->maxbytes);\n+\tfs = fuse2fs_start(ff);\n+\n+\tcfg->flags |= FUSE_IOMAP_CONFIG_UUID;\n+\tmemcpy(cfg->s_uuid, fs->super->s_uuid, sizeof(cfg->s_uuid));\n+\tcfg->s_uuid_len = sizeof(fs->super->s_uuid);\n+\n+\tcfg->flags |= FUSE_IOMAP_CONFIG_BLOCKSIZE;\n+\tcfg->s_blocksize = FUSE2FS_FSB_TO_B(ff, 1);\n+\n+\t/*\n+\t * If there inode is large enough to house i_[acm]time_extra then we\n+\t * can turn on nanosecond timestamps; i_crtime was the next field added\n+\t * after i_atime_extra.\n+\t */\n+\tcfg->flags |= FUSE_IOMAP_CONFIG_TIME;\n+\tif (fs->super->s_inode_size >=\n+\t    offsetof(struct ext2_inode_large, i_crtime)) {\n+\t\tcfg->s_time_gran = 1;\n+\t\tcfg->s_time_max = EXT4_EXTRA_TIMESTAMP_MAX;\n+\t} else {\n+\t\tcfg->s_time_gran = NSEC_PER_SEC;\n+\t\tcfg->s_time_max = EXT4_NON_EXTRA_TIMESTAMP_MAX;\n+\t}\n+\tcfg->s_time_min = EXT4_TIMESTAMP_MIN;\n+\n+\tcfg->flags |= FUSE_IOMAP_CONFIG_MAXBYTES;\n+\tcfg->s_maxbytes = fuse2fs_max_size(ff, p->maxbytes);\n+\n+\tfuse2fs_finish(ff, 0);\n+\treturn 0;\n+}\n #endif /* HAVE_FUSE_IOMAP */\n \n static struct fuse_operations fs_ops = {\n@@ -5738,6 +5827,7 @@ static struct fuse_operations fs_ops = {\n #ifdef HAVE_FUSE_IOMAP\n \t.iomap_begin = op_iomap_begin,\n \t.iomap_end = op_iomap_end,\n+\t.iomap_config = op_iomap_config,\n #endif /* HAVE_FUSE_IOMAP */\n };\n \n","prefixes":["03/19"]}