get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 811975,
    "url": "http://patchwork.ozlabs.org/api/patches/811975/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170909171606.20029-8-robdclark@gmail.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170909171606.20029-8-robdclark@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-09T17:15:58",
    "name": "[U-Boot,v3,7/9] fat/fs: move ls to generic implementation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ad830d0a9b8457258faf87b682100fe218fb15cc",
    "submitter": {
        "id": 18760,
        "url": "http://patchwork.ozlabs.org/api/people/18760/?format=api",
        "name": "Rob Clark",
        "email": "robdclark@gmail.com"
    },
    "delegate": {
        "id": 3651,
        "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api",
        "username": "trini",
        "first_name": "Tom",
        "last_name": "Rini",
        "email": "trini@ti.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170909171606.20029-8-robdclark@gmail.com/mbox/",
    "series": [
        {
            "id": 2355,
            "url": "http://patchwork.ozlabs.org/api/series/2355/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2355",
            "date": "2017-09-09T17:15:51",
            "name": "fs/fat: cleanups + readdir implementation",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/2355/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811975/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811975/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"mEcmliIj\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqLcG07s0z9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 03:22:53 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid C2278C21C58; Sat,  9 Sep 2017 17:19:59 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 70CAAC21E74;\n\tSat,  9 Sep 2017 17:19:01 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 605A6C21F14; Sat,  9 Sep 2017 17:16:51 +0000 (UTC)",
            "from mail-qt0-f196.google.com (mail-qt0-f196.google.com\n\t[209.85.216.196])\n\tby lists.denx.de (Postfix) with ESMTPS id F1044C21EFC\n\tfor <u-boot@lists.denx.de>; Sat,  9 Sep 2017 17:16:50 +0000 (UTC)",
            "by mail-qt0-f196.google.com with SMTP id u48so400900qtc.4\n\tfor <u-boot@lists.denx.de>; Sat, 09 Sep 2017 10:16:50 -0700 (PDT)",
            "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tz50sm3490640qta.19.2017.09.09.10.16.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 09 Sep 2017 10:16:48 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=UGWkoFliRrSUA/JZSO1m2p6u+Wt51fM3gKGKCoQ5dpU=;\n\tb=mEcmliIjiwhGeEDWle4e0Z1b2nBV/zzHH/2RgAhysvOHFqe4fOqbfw06cJ2jWHFPqd\n\tfhRN3t/r+oB+Ug8LZIB6HjzoSnLjsbL4xyXBEdo2AE6LRswue9OlwnMhv4tTWcXjcqGA\n\tsyfiBcUfojn6WHrxp6Bb4a+7Q88y1LMHNecP9e7nrFZAOwWcbJiZnK38+IfEYgcKKmTy\n\tM914S1IXfmL0Vj2hFWV05nKhDO3koduasLA9nETSjQgh5iK5WEfo3Mts49S5nu4tG9A5\n\tUKAXg03VRptj3WSe2cHt0qdV77NNOOyaZx3n087AWZN0Kvzlb/ZNgW36oMLYQq44ASC4\n\t++QQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=UGWkoFliRrSUA/JZSO1m2p6u+Wt51fM3gKGKCoQ5dpU=;\n\tb=RmWtNZGCI7pIS+Mi/UZCkgAo8O3Rx53dtQhjaClmtPQSauPCXjC7FaPyxcnsAci8Dl\n\tUuJPUrUKehDU0IH51C9fbeDp6rSdUnv0BtI1kLcQpTeyJ/fNAN1J6L9dHR4SHHPpNy7S\n\t5GU68/jD24gedDEemjZptyF3R28r8fw9TpIfEPazGlOLCXr+zRkojDHVXrUxHBs5ZgwT\n\tXV2Qct+pDzMARTQr4WQFAVCOp1IOZJR796aQiPQA7IvyEeRUi9K/coKbp3CjySom7fO2\n\tNv90izaR3ns+p6e18P90MZkDrj51fgoVLNz65DBIzzcsDS0SihrsSCwMwglSgQ3bq1jp\n\tcx3w==",
        "X-Gm-Message-State": "AHPjjUhDhnfaMEDvFSfzkzKxLxJl956La1MXdQdtQhGqbg/gWsJSCbKg\n\tPs51mZAhtvw/YaUwIP8=",
        "X-Google-Smtp-Source": "AOwi7QCeoUTIZ3b+kxK8bU04atf2K/c+X0inpFH9RLHe5gzN9csHpHpcyEeBWcsw8sdjxvbL5H9g1w==",
        "X-Received": "by 10.237.62.200 with SMTP id o8mr9532670qtf.294.1504977409712; \n\tSat, 09 Sep 2017 10:16:49 -0700 (PDT)",
        "From": "Rob Clark <robdclark@gmail.com>",
        "To": "U-Boot Mailing List <u-boot@lists.denx.de>",
        "Date": "Sat,  9 Sep 2017 13:15:58 -0400",
        "Message-Id": "<20170909171606.20029-8-robdclark@gmail.com>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170909171606.20029-1-robdclark@gmail.com>",
        "References": "<20170909171606.20029-1-robdclark@gmail.com>",
        "MIME-Version": "1.0",
        "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>,\n\tGenevieve Chan <ccheauya@altera.com>, Tien Fong Chee <tfchee@altera.com>",
        "Subject": "[U-Boot] [PATCH v3 7/9] fat/fs: move ls to generic implementation",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "Add a generic implementation of 'ls' using opendir/readdir/closedir, and\nreplace fat's custom implementation.  Other filesystems should move to\nthe generic implementation after they add opendir/readdir/closedir\nsupport.\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\nReviewed-by: Łukasz Majewski <lukma@denx.de>\nReviewed-by: Simon Glass <sjg@chromium.org>\n---\n fs/fat/fat.c  | 32 --------------------------------\n fs/fs.c       | 35 +++++++++++++++++++++++++++++++++--\n include/fat.h |  5 ++++-\n 3 files changed, 37 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/fs/fat/fat.c b/fs/fat/fat.c\nindex 82ddb7eab1..c951d84f57 100644\n--- a/fs/fat/fat.c\n+++ b/fs/fat/fat.c\n@@ -1029,38 +1029,6 @@ int file_fat_detectfs(void)\n \treturn 0;\n }\n \n-int file_fat_ls(const char *dir)\n-{\n-\tfsdata fsdata;\n-\tfat_itr itrblock, *itr = &itrblock;\n-\tint files = 0, dirs = 0;\n-\tint ret;\n-\n-\tret = fat_itr_root(itr, &fsdata);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tret = fat_itr_resolve(itr, dir, TYPE_DIR);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\twhile (fat_itr_next(itr)) {\n-\t\tif (fat_itr_isdir(itr)) {\n-\t\t\tprintf(\"            %s/\\n\", itr->name);\n-\t\t\tdirs++;\n-\t\t} else {\n-\t\t\tprintf(\" %8u   %s\\n\",\n-\t\t\t       FAT2CPU32(itr->dent->size),\n-\t\t\t       itr->name);\n-\t\t\tfiles++;\n-\t\t}\n-\t}\n-\n-\tprintf(\"\\n%d file(s), %d dir(s)\\n\\n\", files, dirs);\n-\n-\treturn 0;\n-}\n-\n int fat_exists(const char *filename)\n {\n \tfsdata fsdata;\ndiff --git a/fs/fs.c b/fs/fs.c\nindex fc0c953fcb..3481229aa6 100644\n--- a/fs/fs.c\n+++ b/fs/fs.c\n@@ -37,6 +37,35 @@ static inline int fs_ls_unsupported(const char *dirname)\n \treturn -1;\n }\n \n+/* generic implementation of ls in terms of opendir/readdir/closedir */\n+__maybe_unused\n+static int fs_ls_generic(const char *dirname)\n+{\n+\tstruct fs_dir_stream *dirs;\n+\tstruct fs_dirent *dent;\n+\tint nfiles = 0, ndirs = 0;\n+\n+\tdirs = fs_opendir(dirname);\n+\tif (!dirs)\n+\t\treturn -errno;\n+\n+\twhile ((dent = fs_readdir(dirs))) {\n+\t\tif (dent->type == FS_DT_DIR) {\n+\t\t\tprintf(\"            %s/\\n\", dent->name);\n+\t\t\tndirs++;\n+\t\t} else {\n+\t\t\tprintf(\" %8lld   %s\\n\", dent->size, dent->name);\n+\t\t\tnfiles++;\n+\t\t}\n+\t}\n+\n+\tfs_closedir(dirs);\n+\n+\tprintf(\"\\n%d file(s), %d dir(s)\\n\\n\", nfiles, ndirs);\n+\n+\treturn 0;\n+}\n+\n static inline int fs_exists_unsupported(const char *filename)\n {\n \treturn 0;\n@@ -123,7 +152,7 @@ static struct fstype_info fstypes[] = {\n \t\t.null_dev_desc_ok = false,\n \t\t.probe = fat_set_blk_dev,\n \t\t.close = fat_close,\n-\t\t.ls = file_fat_ls,\n+\t\t.ls = fs_ls_generic,\n \t\t.exists = fat_exists,\n \t\t.size = fat_size,\n \t\t.read = fat_read_file,\n@@ -133,7 +162,9 @@ static struct fstype_info fstypes[] = {\n \t\t.write = fs_write_unsupported,\n #endif\n \t\t.uuid = fs_uuid_unsupported,\n-\t\t.opendir = fs_opendir_unsupported,\n+\t\t.opendir = fat_opendir,\n+\t\t.readdir = fat_readdir,\n+\t\t.closedir = fat_closedir,\n \t},\n #endif\n #ifdef CONFIG_FS_EXT4\ndiff --git a/include/fat.h b/include/fat.h\nindex b255ce5337..83cd90017e 100644\n--- a/include/fat.h\n+++ b/include/fat.h\n@@ -11,6 +11,7 @@\n #define _FAT_H_\n \n #include <asm/byteorder.h>\n+#include <fs.h>\n \n #define CONFIG_SUPPORT_VFAT\n /* Maximum Long File Name length supported here is 128 UTF-16 code units */\n@@ -179,7 +180,6 @@ static inline u32 clust_to_sect(fsdata *fsdata, u32 clust)\n }\n \n int file_fat_detectfs(void);\n-int file_fat_ls(const char *dir);\n int fat_exists(const char *filename);\n int fat_size(const char *filename, loff_t *size);\n int file_fat_read_at(const char *filename, loff_t pos, void *buffer,\n@@ -192,5 +192,8 @@ int file_fat_write(const char *filename, void *buf, loff_t offset, loff_t len,\n \t\t   loff_t *actwrite);\n int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,\n \t\t  loff_t *actread);\n+int fat_opendir(const char *filename, struct fs_dir_stream **dirsp);\n+int fat_readdir(struct fs_dir_stream *dirs, struct fs_dirent **dentp);\n+void fat_closedir(struct fs_dir_stream *dirs);\n void fat_close(void);\n #endif /* _FAT_H_ */\n",
    "prefixes": [
        "U-Boot",
        "v3",
        "7/9"
    ]
}