get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/807114/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 807114,
    "url": "http://patchwork.ozlabs.org/api/patches/807114/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20170829142942.21594-5-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-5-agruenba@redhat.com>",
    "list_archive_url": null,
    "date": "2017-08-29T14:29:42",
    "name": "[4/4] ext4: Switch to iomap for SEEK_HOLE / SEEK_DATA",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c5714b5bfe5a3a2656d20e3afd89bc150dae7b5d",
    "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-5-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/807114/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807114/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 3xhWJ00b21z9t38\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 00:30:08 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754377AbdH2OaC (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 29 Aug 2017 10:30:02 -0400",
            "from mx1.redhat.com ([209.132.183.28]:58392 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1754369AbdH2O37 (ORCPT <rfc822;linux-ext4@vger.kernel.org>);\n\tTue, 29 Aug 2017 10:29:59 -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 F041F68BC;\n\tTue, 29 Aug 2017 14:29:58 +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 7FD376F0A3;\n\tTue, 29 Aug 2017 14:29:55 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com F041F68BC",
        "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 4/4] ext4: Switch to iomap for SEEK_HOLE / SEEK_DATA",
        "Date": "Tue, 29 Aug 2017 16:29:42 +0200",
        "Message-Id": "<20170829142942.21594-5-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:59 +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": "From: Christoph Hellwig <hch@lst.de>\n\nSwitch to the iomap_seek_hole and iomap_seek_data helpers for\nimplementing lseek SEEK_HOLE / SEEK_DATA, and remove all the code that\nisn't needed any more.\n\nNote that with this patch, ext4 will now always depend on the iomap code\ninstead of only when CONFIG_DAX is enabled, and it requires adding a\ncall into the extent status tree for iomap_begin as well to properly\ndeal with delalloc extents.\n\nSigned-off-by: Christoph Hellwig <hch@lst.de>\n[Minor fixes and cleanups by Andreas]\nSigned-off-by: Andreas Gruenbacher <agruenba@redhat.com>\n---\n fs/ext4/Kconfig |   1 +\n fs/ext4/ext4.h  |   3 -\n fs/ext4/file.c  | 271 +++-----------------------------------------------------\n fs/ext4/inode.c | 100 ++++++---------------\n 4 files changed, 43 insertions(+), 332 deletions(-)",
    "diff": "diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig\nindex e38039fd96ff..73b850f5659c 100644\n--- a/fs/ext4/Kconfig\n+++ b/fs/ext4/Kconfig\n@@ -37,6 +37,7 @@ config EXT4_FS\n \tselect CRC16\n \tselect CRYPTO\n \tselect CRYPTO_CRC32C\n+\tselect FS_IOMAP\n \thelp\n \t  This is the next generation of the ext3 filesystem.\n \ndiff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\nindex 017e55942a49..f295fce7a9c8 100644\n--- a/fs/ext4/ext4.h\n+++ b/fs/ext4/ext4.h\n@@ -2515,9 +2515,6 @@ extern void ext4_da_update_reserve_space(struct inode *inode,\n \t\t\t\t\tint used, int quota_claim);\n extern int ext4_issue_zeroout(struct inode *inode, ext4_lblk_t lblk,\n \t\t\t      ext4_fsblk_t pblk, ext4_lblk_t len);\n-extern int ext4_get_next_extent(struct inode *inode, ext4_lblk_t lblk,\n-\t\t\t\tunsigned int map_len,\n-\t\t\t\tstruct extent_status *result);\n \n /* indirect.c */\n extern int ext4_ind_map_blocks(handle_t *handle, struct inode *inode,\ndiff --git a/fs/ext4/file.c b/fs/ext4/file.c\nindex 0d7cf0cc9b87..bc7a901c8b3f 100644\n--- a/fs/ext4/file.c\n+++ b/fs/ext4/file.c\n@@ -20,6 +20,7 @@\n \n #include <linux/time.h>\n #include <linux/fs.h>\n+#include <linux/iomap.h>\n #include <linux/mount.h>\n #include <linux/path.h>\n #include <linux/dax.h>\n@@ -455,256 +456,6 @@ static int ext4_file_open(struct inode * inode, struct file * filp)\n }\n \n /*\n- * Here we use ext4_map_blocks() to get a block mapping for a extent-based\n- * file rather than ext4_ext_walk_space() because we can introduce\n- * SEEK_DATA/SEEK_HOLE for block-mapped and extent-mapped file at the same\n- * function.  When extent status tree has been fully implemented, it will\n- * track all extent status for a file and we can directly use it to\n- * retrieve the offset for SEEK_DATA/SEEK_HOLE.\n- */\n-\n-/*\n- * When we retrieve the offset for SEEK_DATA/SEEK_HOLE, we would need to\n- * lookup page cache to check whether or not there has some data between\n- * [startoff, endoff] because, if this range contains an unwritten extent,\n- * we determine this extent as a data or a hole according to whether the\n- * page cache has data or not.\n- */\n-static int ext4_find_unwritten_pgoff(struct inode *inode,\n-\t\t\t\t     int whence,\n-\t\t\t\t     ext4_lblk_t end_blk,\n-\t\t\t\t     loff_t *offset)\n-{\n-\tstruct pagevec pvec;\n-\tunsigned int blkbits;\n-\tpgoff_t index;\n-\tpgoff_t end;\n-\tloff_t endoff;\n-\tloff_t startoff;\n-\tloff_t lastoff;\n-\tint found = 0;\n-\n-\tblkbits = inode->i_sb->s_blocksize_bits;\n-\tstartoff = *offset;\n-\tlastoff = startoff;\n-\tendoff = (loff_t)end_blk << blkbits;\n-\n-\tindex = startoff >> PAGE_SHIFT;\n-\tend = (endoff - 1) >> PAGE_SHIFT;\n-\n-\tpagevec_init(&pvec, 0);\n-\tdo {\n-\t\tint i, num;\n-\t\tunsigned long nr_pages;\n-\n-\t\tnum = min_t(pgoff_t, end - index, PAGEVEC_SIZE - 1) + 1;\n-\t\tnr_pages = pagevec_lookup(&pvec, inode->i_mapping, index,\n-\t\t\t\t\t  (pgoff_t)num);\n-\t\tif (nr_pages == 0)\n-\t\t\tbreak;\n-\n-\t\tfor (i = 0; i < nr_pages; i++) {\n-\t\t\tstruct page *page = pvec.pages[i];\n-\t\t\tstruct buffer_head *bh, *head;\n-\n-\t\t\t/*\n-\t\t\t * If current offset is smaller than the page offset,\n-\t\t\t * there is a hole at this offset.\n-\t\t\t */\n-\t\t\tif (whence == SEEK_HOLE && lastoff < endoff &&\n-\t\t\t    lastoff < page_offset(pvec.pages[i])) {\n-\t\t\t\tfound = 1;\n-\t\t\t\t*offset = lastoff;\n-\t\t\t\tgoto out;\n-\t\t\t}\n-\n-\t\t\tif (page->index > end)\n-\t\t\t\tgoto out;\n-\n-\t\t\tlock_page(page);\n-\n-\t\t\tif (unlikely(page->mapping != inode->i_mapping)) {\n-\t\t\t\tunlock_page(page);\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\n-\t\t\tif (!page_has_buffers(page)) {\n-\t\t\t\tunlock_page(page);\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\n-\t\t\tif (page_has_buffers(page)) {\n-\t\t\t\tlastoff = page_offset(page);\n-\t\t\t\tbh = head = page_buffers(page);\n-\t\t\t\tdo {\n-\t\t\t\t\tif (lastoff + bh->b_size <= startoff)\n-\t\t\t\t\t\tgoto next;\n-\t\t\t\t\tif (buffer_uptodate(bh) ||\n-\t\t\t\t\t    buffer_unwritten(bh)) {\n-\t\t\t\t\t\tif (whence == SEEK_DATA)\n-\t\t\t\t\t\t\tfound = 1;\n-\t\t\t\t\t} else {\n-\t\t\t\t\t\tif (whence == SEEK_HOLE)\n-\t\t\t\t\t\t\tfound = 1;\n-\t\t\t\t\t}\n-\t\t\t\t\tif (found) {\n-\t\t\t\t\t\t*offset = max_t(loff_t,\n-\t\t\t\t\t\t\tstartoff, lastoff);\n-\t\t\t\t\t\tunlock_page(page);\n-\t\t\t\t\t\tgoto out;\n-\t\t\t\t\t}\n-next:\n-\t\t\t\t\tlastoff += bh->b_size;\n-\t\t\t\t\tbh = bh->b_this_page;\n-\t\t\t\t} while (bh != head);\n-\t\t\t}\n-\n-\t\t\tlastoff = page_offset(page) + PAGE_SIZE;\n-\t\t\tunlock_page(page);\n-\t\t}\n-\n-\t\t/* The no. of pages is less than our desired, we are done. */\n-\t\tif (nr_pages < num)\n-\t\t\tbreak;\n-\n-\t\tindex = pvec.pages[i - 1]->index + 1;\n-\t\tpagevec_release(&pvec);\n-\t} while (index <= end);\n-\n-\tif (whence == SEEK_HOLE && lastoff < endoff) {\n-\t\tfound = 1;\n-\t\t*offset = lastoff;\n-\t}\n-out:\n-\tpagevec_release(&pvec);\n-\treturn found;\n-}\n-\n-/*\n- * ext4_seek_data() retrieves the offset for SEEK_DATA.\n- */\n-static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)\n-{\n-\tstruct inode *inode = file->f_mapping->host;\n-\tstruct extent_status es;\n-\text4_lblk_t start, last, end;\n-\tloff_t dataoff, isize;\n-\tint blkbits;\n-\tint ret;\n-\n-\tinode_lock(inode);\n-\n-\tisize = i_size_read(inode);\n-\tif (offset >= isize) {\n-\t\tinode_unlock(inode);\n-\t\treturn -ENXIO;\n-\t}\n-\n-\tblkbits = inode->i_sb->s_blocksize_bits;\n-\tstart = offset >> blkbits;\n-\tlast = start;\n-\tend = isize >> blkbits;\n-\tdataoff = offset;\n-\n-\tdo {\n-\t\tret = ext4_get_next_extent(inode, last, end - last + 1, &es);\n-\t\tif (ret <= 0) {\n-\t\t\t/* No extent found -> no data */\n-\t\t\tif (ret == 0)\n-\t\t\t\tret = -ENXIO;\n-\t\t\tinode_unlock(inode);\n-\t\t\treturn ret;\n-\t\t}\n-\n-\t\tlast = es.es_lblk;\n-\t\tif (last != start)\n-\t\t\tdataoff = (loff_t)last << blkbits;\n-\t\tif (!ext4_es_is_unwritten(&es))\n-\t\t\tbreak;\n-\n-\t\t/*\n-\t\t * If there is a unwritten extent at this offset,\n-\t\t * it will be as a data or a hole according to page\n-\t\t * cache that has data or not.\n-\t\t */\n-\t\tif (ext4_find_unwritten_pgoff(inode, SEEK_DATA,\n-\t\t\t\t\t      es.es_lblk + es.es_len, &dataoff))\n-\t\t\tbreak;\n-\t\tlast += es.es_len;\n-\t\tdataoff = (loff_t)last << blkbits;\n-\t\tcond_resched();\n-\t} while (last <= end);\n-\n-\tinode_unlock(inode);\n-\n-\tif (dataoff > isize)\n-\t\treturn -ENXIO;\n-\n-\treturn vfs_setpos(file, dataoff, maxsize);\n-}\n-\n-/*\n- * ext4_seek_hole() retrieves the offset for SEEK_HOLE.\n- */\n-static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize)\n-{\n-\tstruct inode *inode = file->f_mapping->host;\n-\tstruct extent_status es;\n-\text4_lblk_t start, last, end;\n-\tloff_t holeoff, isize;\n-\tint blkbits;\n-\tint ret;\n-\n-\tinode_lock(inode);\n-\n-\tisize = i_size_read(inode);\n-\tif (offset >= isize) {\n-\t\tinode_unlock(inode);\n-\t\treturn -ENXIO;\n-\t}\n-\n-\tblkbits = inode->i_sb->s_blocksize_bits;\n-\tstart = offset >> blkbits;\n-\tlast = start;\n-\tend = isize >> blkbits;\n-\tholeoff = offset;\n-\n-\tdo {\n-\t\tret = ext4_get_next_extent(inode, last, end - last + 1, &es);\n-\t\tif (ret < 0) {\n-\t\t\tinode_unlock(inode);\n-\t\t\treturn ret;\n-\t\t}\n-\t\t/* Found a hole? */\n-\t\tif (ret == 0 || es.es_lblk > last) {\n-\t\t\tif (last != start)\n-\t\t\t\tholeoff = (loff_t)last << blkbits;\n-\t\t\tbreak;\n-\t\t}\n-\t\t/*\n-\t\t * If there is a unwritten extent at this offset,\n-\t\t * it will be as a data or a hole according to page\n-\t\t * cache that has data or not.\n-\t\t */\n-\t\tif (ext4_es_is_unwritten(&es) &&\n-\t\t    ext4_find_unwritten_pgoff(inode, SEEK_HOLE,\n-\t\t\t\t\t      last + es.es_len, &holeoff))\n-\t\t\tbreak;\n-\n-\t\tlast += es.es_len;\n-\t\tholeoff = (loff_t)last << blkbits;\n-\t\tcond_resched();\n-\t} while (last <= end);\n-\n-\tinode_unlock(inode);\n-\n-\tif (holeoff > isize)\n-\t\tholeoff = isize;\n-\n-\treturn vfs_setpos(file, holeoff, maxsize);\n-}\n-\n-/*\n  * ext4_llseek() handles both block-mapped and extent-mapped maxbytes values\n  * by calling generic_file_llseek_size() with the appropriate maxbytes\n  * value for each.\n@@ -720,18 +471,24 @@ loff_t ext4_llseek(struct file *file, loff_t offset, int whence)\n \t\tmaxbytes = inode->i_sb->s_maxbytes;\n \n \tswitch (whence) {\n-\tcase SEEK_SET:\n-\tcase SEEK_CUR:\n-\tcase SEEK_END:\n+\tdefault:\n \t\treturn generic_file_llseek_size(file, offset, whence,\n \t\t\t\t\t\tmaxbytes, i_size_read(inode));\n-\tcase SEEK_DATA:\n-\t\treturn ext4_seek_data(file, offset, maxbytes);\n \tcase SEEK_HOLE:\n-\t\treturn ext4_seek_hole(file, offset, maxbytes);\n+\t\tinode_lock_shared(inode);\n+\t\toffset = iomap_seek_hole(inode, offset, &ext4_iomap_ops);\n+\t\tinode_unlock_shared(inode);\n+\t\tbreak;\n+\tcase SEEK_DATA:\n+\t\tinode_lock_shared(inode);\n+\t\toffset = iomap_seek_data(inode, offset, &ext4_iomap_ops);\n+\t\tinode_unlock_shared(inode);\n+\t\tbreak;\n \t}\n \n-\treturn -EINVAL;\n+\tif (offset < 0)\n+\t\treturn offset;\n+\treturn vfs_setpos(file, offset, maxbytes);\n }\n \n const struct file_operations ext4_file_operations = {\ndiff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex ab6ab835255e..f5895ea6ac70 100644\n--- a/fs/ext4/inode.c\n+++ b/fs/ext4/inode.c\n@@ -3400,7 +3400,6 @@ static int ext4_releasepage(struct page *page, gfp_t wait)\n \t\treturn try_to_free_buffers(page);\n }\n \n-#ifdef CONFIG_FS_DAX\n static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,\n \t\t\t    unsigned flags, struct iomap *iomap)\n {\n@@ -3409,6 +3408,7 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,\n \tunsigned long first_block = offset >> blkbits;\n \tunsigned long last_block = (offset + length - 1) >> blkbits;\n \tstruct ext4_map_blocks map;\n+\tbool delalloc = false;\n \tint ret;\n \n \tif ((flags & IOMAP_REPORT) && ext4_has_inline_data(inode)) {\n@@ -3425,6 +3425,29 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,\n \n \tif (!(flags & IOMAP_WRITE)) {\n \t\tret = ext4_map_blocks(NULL, inode, &map, 0);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t\tif (!ret) {\n+\t\t\tstruct extent_status es = {};\n+\n+\t\t\text4_es_find_delayed_extent_range(inode, map.m_lblk,\n+\t\t\t\t\tmap.m_lblk + map.m_len - 1, &es);\n+\t\t\t/* Is delalloc data before next block in extent tree? */\n+\t\t\tif (es.es_len && es.es_lblk < map.m_lblk + map.m_len) {\n+\t\t\t\text4_lblk_t offs = 0;\n+\n+\t\t\t\tif (es.es_lblk < map.m_lblk)\n+\t\t\t\t\toffs = map.m_lblk - es.es_lblk;\n+\t\t\t\tmap.m_lblk = es.es_lblk + offs;\n+\t\t\t\tmap.m_pblk = ext4_es_pblock(&es) + offs;\n+\t\t\t\tmap.m_len = es.es_len - offs;\n+\t\t\t\tif (ext4_es_is_unwritten(&es))\n+\t\t\t\t\tmap.m_flags |= EXT4_MAP_UNWRITTEN;\n+\t\t\t\tif (ext4_es_is_delayed(&es))\n+\t\t\t\t\tdelalloc = true;\n+\t\t\t\tret = 1;\n+\t\t\t}\n+\t\t}\n \t} else {\n \t\tint dio_credits;\n \t\thandle_t *handle;\n@@ -3486,11 +3509,14 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,\n \telse\n \t\tiomap->dax_dev = NULL;\n \tiomap->offset = first_block << blkbits;\n+\tiomap->length = (u64)map.m_len << blkbits;\n \n \tif (ret == 0) {\n \t\tiomap->type = IOMAP_HOLE;\n \t\tiomap->addr = IOMAP_NULL_ADDR;\n-\t\tiomap->length = (u64)map.m_len << blkbits;\n+\t} else if (delalloc) {\n+\t\tiomap->type = IOMAP_DELALLOC;\n+\t\tiomap->addr = IOMAP_NULL_ADDR;\n \t} else {\n \t\tif (map.m_flags & EXT4_MAP_MAPPED) {\n \t\t\tiomap->type = IOMAP_MAPPED;\n@@ -3501,7 +3527,6 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,\n \t\t\treturn -EIO;\n \t\t}\n \t\tiomap->addr = (u64)map.m_pblk << blkbits;\n-\t\tiomap->length = (u64)map.m_len << blkbits;\n \t}\n \n \tif (map.m_flags & EXT4_MAP_NEW)\n@@ -3567,8 +3592,6 @@ const struct iomap_ops ext4_iomap_ops = {\n \t.iomap_end\t\t= ext4_iomap_end,\n };\n \n-#endif\n-\n static int ext4_end_io_dio(struct kiocb *iocb, loff_t offset,\n \t\t\t    ssize_t size, void *private)\n {\n@@ -6132,70 +6155,3 @@ int ext4_filemap_fault(struct vm_fault *vmf)\n \n \treturn err;\n }\n-\n-/*\n- * Find the first extent at or after @lblk in an inode that is not a hole.\n- * Search for @map_len blocks at most. The extent is returned in @result.\n- *\n- * The function returns 1 if we found an extent. The function returns 0 in\n- * case there is no extent at or after @lblk and in that case also sets\n- * @result->es_len to 0. In case of error, the error code is returned.\n- */\n-int ext4_get_next_extent(struct inode *inode, ext4_lblk_t lblk,\n-\t\t\t unsigned int map_len, struct extent_status *result)\n-{\n-\tstruct ext4_map_blocks map;\n-\tstruct extent_status es = {};\n-\tint ret;\n-\n-\tmap.m_lblk = lblk;\n-\tmap.m_len = map_len;\n-\n-\t/*\n-\t * For non-extent based files this loop may iterate several times since\n-\t * we do not determine full hole size.\n-\t */\n-\twhile (map.m_len > 0) {\n-\t\tret = ext4_map_blocks(NULL, inode, &map, 0);\n-\t\tif (ret < 0)\n-\t\t\treturn ret;\n-\t\t/* There's extent covering m_lblk? Just return it. */\n-\t\tif (ret > 0) {\n-\t\t\tint status;\n-\n-\t\t\text4_es_store_pblock(result, map.m_pblk);\n-\t\t\tresult->es_lblk = map.m_lblk;\n-\t\t\tresult->es_len = map.m_len;\n-\t\t\tif (map.m_flags & EXT4_MAP_UNWRITTEN)\n-\t\t\t\tstatus = EXTENT_STATUS_UNWRITTEN;\n-\t\t\telse\n-\t\t\t\tstatus = EXTENT_STATUS_WRITTEN;\n-\t\t\text4_es_store_status(result, status);\n-\t\t\treturn 1;\n-\t\t}\n-\t\text4_es_find_delayed_extent_range(inode, map.m_lblk,\n-\t\t\t\t\t\t  map.m_lblk + map.m_len - 1,\n-\t\t\t\t\t\t  &es);\n-\t\t/* Is delalloc data before next block in extent tree? */\n-\t\tif (es.es_len && es.es_lblk < map.m_lblk + map.m_len) {\n-\t\t\text4_lblk_t offset = 0;\n-\n-\t\t\tif (es.es_lblk < lblk)\n-\t\t\t\toffset = lblk - es.es_lblk;\n-\t\t\tresult->es_lblk = es.es_lblk + offset;\n-\t\t\text4_es_store_pblock(result,\n-\t\t\t\t\t     ext4_es_pblock(&es) + offset);\n-\t\t\tresult->es_len = es.es_len - offset;\n-\t\t\text4_es_store_status(result, ext4_es_status(&es));\n-\n-\t\t\treturn 1;\n-\t\t}\n-\t\t/* There's a hole at m_lblk, advance us after it */\n-\t\tmap.m_lblk += map.m_len;\n-\t\tmap_len -= map.m_len;\n-\t\tmap.m_len = map_len;\n-\t\tcond_resched();\n-\t}\n-\tresult->es_len = 0;\n-\treturn 0;\n-}\n",
    "prefixes": [
        "4/4"
    ]
}