Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807113/?format=api
{ "id": 807113, "url": "http://patchwork.ozlabs.org/api/patches/807113/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20170829142942.21594-4-agruenba@redhat.com/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/projects/8/?format=api", "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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170829142942.21594-4-agruenba@redhat.com>", "list_archive_url": null, "date": "2017-08-29T14:29:41", "name": "[3/4] ext4: Add iomap support for inline data", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "157407c80f904b6f7c2fdf89e8f91d7565fb0f24", "submitter": { "id": 67290, "url": "http://patchwork.ozlabs.org/api/people/67290/?format=api", "name": "Andreas Gruenbacher", "email": "agruenba@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20170829142942.21594-4-agruenba@redhat.com/mbox/", "series": [ { "id": 378, "url": "http://patchwork.ozlabs.org/api/series/378/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=378", "date": "2017-08-29T14:29:38", "name": "ext4: SEEK_HOLE / SEEK_DATA via iomap", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/378/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807113/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807113/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-ext4-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=agruenba@redhat.com" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhWHy1L9Gz9t38\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 00:30:06 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754378AbdH2OaD (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 29 Aug 2017 10:30:03 -0400", "from mx1.redhat.com ([209.132.183.28]:23893 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1754360AbdH2O3z (ORCPT <rfc822;linux-ext4@vger.kernel.org>);\n\tTue, 29 Aug 2017 10:29:55 -0400", "from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7EC28404327;\n\tTue, 29 Aug 2017 14:29:55 +0000 (UTC)", "from max.home.com (ovpn-116-105.ams2.redhat.com [10.36.116.105])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 565B76929B;\n\tTue, 29 Aug 2017 14:29:52 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 7EC28404327", "From": "Andreas Gruenbacher <agruenba@redhat.com>", "To": "linux-fsdevel@vger.kernel.org", "Cc": "linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,\n\tJan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,\n\tAndreas Gruenbacher <agruenba@redhat.com>", "Subject": "[PATCH 3/4] ext4: Add iomap support for inline data", "Date": "Tue, 29 Aug 2017 16:29:41 +0200", "Message-Id": "<20170829142942.21594-4-agruenba@redhat.com>", "In-Reply-To": "<20170829142942.21594-1-agruenba@redhat.com>", "References": "<20170829142942.21594-1-agruenba@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tTue, 29 Aug 2017 14:29:55 +0000 (UTC)", "Sender": "linux-ext4-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-ext4.vger.kernel.org>", "X-Mailing-List": "linux-ext4@vger.kernel.org" }, "content": "Report inline data as an IOMAP_F_DATA_INLINE mapping. This allows to\nswitch to iomap_seek_hole and iomap_seek_data in ext4_llseek, and will\nmake switching to iomap_fiemap in ext4_fiemap easier as well.\n\nSigned-off-by: Andreas Gruenbacher <agruenba@redhat.com>\n---\n fs/ext4/ext4.h | 4 ++++\n fs/ext4/inline.c | 33 +++++++++++++++++++++++++++++++++\n fs/ext4/inode.c | 10 ++++++++--\n 3 files changed, 45 insertions(+), 2 deletions(-)", "diff": "diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\nindex a2bb7d2870e4..017e55942a49 100644\n--- a/fs/ext4/ext4.h\n+++ b/fs/ext4/ext4.h\n@@ -3048,6 +3048,10 @@ extern struct buffer_head *ext4_get_first_inline_block(struct inode *inode,\n extern int ext4_inline_data_fiemap(struct inode *inode,\n \t\t\t\t struct fiemap_extent_info *fieinfo,\n \t\t\t\t int *has_inline, __u64 start, __u64 len);\n+\n+struct iomap;\n+extern int ext4_inline_data_iomap(struct inode *inode, struct iomap *iomap);\n+\n extern int ext4_try_to_evict_inline_data(handle_t *handle,\n \t\t\t\t\t struct inode *inode,\n \t\t\t\t\t int needed);\ndiff --git a/fs/ext4/inline.c b/fs/ext4/inline.c\nindex 28c5c3abddb3..21a078fef80f 100644\n--- a/fs/ext4/inline.c\n+++ b/fs/ext4/inline.c\n@@ -12,6 +12,7 @@\n * GNU General Public License for more details.\n */\n \n+#include <linux/iomap.h>\n #include <linux/fiemap.h>\n \n #include \"ext4_jbd2.h\"\n@@ -1827,6 +1828,38 @@ int ext4_destroy_inline_data(handle_t *handle, struct inode *inode)\n \treturn ret;\n }\n \n+int ext4_inline_data_iomap(struct inode *inode, struct iomap *iomap)\n+{\n+\t__u64 addr;\n+\tint error = -ENOENT;\n+\tstruct ext4_iloc iloc;\n+\n+\tdown_read(&EXT4_I(inode)->xattr_sem);\n+\tif (!ext4_has_inline_data(inode))\n+\t\tgoto out;\n+\n+\terror = ext4_get_inode_loc(inode, &iloc);\n+\tif (error)\n+\t\tgoto out;\n+\n+\taddr = (__u64)iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits;\n+\taddr += (char *)ext4_raw_inode(&iloc) - iloc.bh->b_data;\n+\taddr += offsetof(struct ext4_inode, i_block);\n+\n+\tbrelse(iloc.bh);\n+\n+\tiomap->addr = addr;\n+\tiomap->offset = 0;\n+\tiomap->length = min_t(loff_t, ext4_get_inline_size(inode),\n+\t\t\t i_size_read(inode));\n+\tiomap->type = 0;\n+\tiomap->flags = IOMAP_F_DATA_INLINE;\n+\n+out:\n+\tup_read(&EXT4_I(inode)->xattr_sem);\n+\treturn error;\n+}\n+\n int ext4_inline_data_fiemap(struct inode *inode,\n \t\t\t struct fiemap_extent_info *fieinfo,\n \t\t\t int *has_inline, __u64 start, __u64 len)\ndiff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex 429f0afde9f2..ab6ab835255e 100644\n--- a/fs/ext4/inode.c\n+++ b/fs/ext4/inode.c\n@@ -3411,8 +3411,14 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,\n \tstruct ext4_map_blocks map;\n \tint ret;\n \n-\tif (WARN_ON_ONCE(ext4_has_inline_data(inode)))\n-\t\treturn -ERANGE;\n+\tif ((flags & IOMAP_REPORT) && ext4_has_inline_data(inode)) {\n+\t\tret = ext4_inline_data_iomap(inode, iomap);\n+\t\tif (ret != -ENOENT) {\n+\t\t\tif (ret == 0 && offset >= iomap->length)\n+\t\t\t\tret = -ENOENT;\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n \n \tmap.m_lblk = first_block;\n \tmap.m_len = last_block - first_block + 1;\n", "prefixes": [ "3/4" ] }