get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 809110,
    "url": "http://patchwork.ozlabs.org/api/patches/809110/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170902163806.27265-6-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": "<20170902163806.27265-6-robdclark@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-02T16:38:00",
    "name": "[U-Boot,v2,5/8] fs/fat: implement opendir/readdir/closedir",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c696dd271901979bb36c6610ecd8ff2920020241",
    "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/20170902163806.27265-6-robdclark@gmail.com/mbox/",
    "series": [
        {
            "id": 1165,
            "url": "http://patchwork.ozlabs.org/api/series/1165/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=1165",
            "date": "2017-09-02T16:37:55",
            "name": "fs/fat: cleanups + readdir implementation",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/1165/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/809110/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/809110/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=\"Ry3DzxJ8\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xl23J3RDZz9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  3 Sep 2017 02:42:52 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 38A79C21F69; Sat,  2 Sep 2017 16:40:27 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 45E60C21F78;\n\tSat,  2 Sep 2017 16:39:26 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 343BFC21F1C; Sat,  2 Sep 2017 16:38:47 +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 97CDAC21F68\n\tfor <u-boot@lists.denx.de>; Sat,  2 Sep 2017 16:38:44 +0000 (UTC)",
            "by mail-qt0-f196.google.com with SMTP id d15so2068017qta.5\n\tfor <u-boot@lists.denx.de>; Sat, 02 Sep 2017 09:38:44 -0700 (PDT)",
            "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tq14sm1068014qki.90.2017.09.02.09.38.41\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 02 Sep 2017 09:38:42 -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\tbh=7lP91YbAe+mGKrjt+Y3cWMV+ClO3x26wFKTZvqhy6uY=;\n\tb=Ry3DzxJ8ST08bPbAp6ptliN+KO0VCNAsfuzCxenMvXyHcQ46EWIXRhZaRLvZ0MagXA\n\tPBEioVJWt3CRZIi9SJca7Y+gUYXtFKlKUdSTv84s5stUZi4sy1f444q++ptwk5Crl2xp\n\tKuh1dHJf96aBa9ohCO5niIYkam7kdKOzeUJl9i+hhmCtswCa7u0fCvAd/8MPjg7vJ72A\n\twp6qVPj7KzqBozUsbn5sH+72mwZDHvC8YpbEyaLdTixcA/rsdIT2WzEkKiBW0tL0/TJK\n\tmhv+wASir51cwqMZzUDYjWL03I7QEgXzEpL8sGuutSB4mNcAm8YGxR6zO66pkWKcKl3S\n\ttCDg==",
        "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;\n\tbh=7lP91YbAe+mGKrjt+Y3cWMV+ClO3x26wFKTZvqhy6uY=;\n\tb=RN42hNFW/9f4P4HTLsFQ5AcMsnOGRuwelLhF9P8Q3JTmZRa6nryRH2FAKgmBegxtGC\n\tuJ5mjttfeb3437w1OUjEjUieoATi2wBl0NwQdapAO+b2eC32VJycTKNVQkjutwjTrKSq\n\tAuDg8N7IHKdc9FPrrgmMuCsRZcsyPb/mBkrJ+HvHRoFn6/c28XGt8wogO0PMa21awuuz\n\tV77yFSsjXNdWCVFprdHY5teu1unyUAu59J7nRfJUPC69w21xkqOC2zVReadgnwEFaVjj\n\t2O/DgmraIlBOf6pgBDKguEKTI/08/h4ACnjEhGiYaKr2z6sFK8IMeWUr29dEa0jJtT0b\n\tQ7tg==",
        "X-Gm-Message-State": "AHPjjUiHo7l2H358Wdv1UJWr8Br1aJGjpJXxUWlCNGxvrnl/McNtHKMK\n\tZnvoVzKMJccnklY5VHw=",
        "X-Google-Smtp-Source": "ADKCNb4uXCH6xcWVAKOq45N469jGPRKRJzyYkX6Kko/W/TOGKECu2ATdbyZGknsGfEWOHtILygctbw==",
        "X-Received": "by 10.200.41.171 with SMTP id 40mr8384493qts.131.1504370323369; \n\tSat, 02 Sep 2017 09:38:43 -0700 (PDT)",
        "From": "Rob Clark <robdclark@gmail.com>",
        "To": "U-Boot Mailing List <u-boot@lists.denx.de>",
        "Date": "Sat,  2 Sep 2017 12:38:00 -0400",
        "Message-Id": "<20170902163806.27265-6-robdclark@gmail.com>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170902163806.27265-1-robdclark@gmail.com>",
        "References": "<20170902163806.27265-1-robdclark@gmail.com>",
        "Subject": "[U-Boot] [PATCH v2 5/8] fs/fat: implement opendir/readdir/closedir",
        "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>",
        "MIME-Version": "1.0",
        "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": "Implement the readdir interface using the directory iterators.\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n fs/fat/fat.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 56 insertions(+)",
    "diff": "diff --git a/fs/fat/fat.c b/fs/fat/fat.c\nindex 3193290434..d30ef3903b 100644\n--- a/fs/fat/fat.c\n+++ b/fs/fat/fat.c\n@@ -14,6 +14,7 @@\n #include <config.h>\n #include <exports.h>\n #include <fat.h>\n+#include <fs.h>\n #include <asm/byteorder.h>\n #include <part.h>\n #include <malloc.h>\n@@ -1119,6 +1120,61 @@ int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,\n \treturn ret;\n }\n \n+typedef struct {\n+\tFS_DIR parent;\n+\tfsdata fsdata;\n+\tfat_itr itr;\n+} fat_dir;\n+\n+int fat_opendir(const char *filename, FS_DIR **dirp)\n+{\n+\tfat_dir *dir = malloc(sizeof(*dir));\n+\tint ret;\n+\n+\tif (!dir)\n+\t\treturn -ENOMEM;\n+\n+\tret = fat_itr_root(&dir->itr, &dir->fsdata);\n+\tif (ret)\n+\t\tgoto fail;\n+\n+\tret = fat_itr_resolve(&dir->itr, filename, TYPE_DIR);\n+\tif (ret)\n+\t\tgoto fail;\n+\n+\t*dirp = (FS_DIR *)dir;\n+\treturn 0;\n+\n+fail:\n+\tfree(dir);\n+\treturn ret;\n+}\n+\n+int fat_readdir(FS_DIR *dirp)\n+{\n+\tfat_dir *dir = (fat_dir *)dirp;\n+\tstruct fs_dirent *dent = &dirp->dirent;\n+\n+\tif (!fat_itr_next(&dir->itr))\n+\t\treturn -ENOENT;\n+\n+\tstrcpy(dent->name, dir->itr.name);\n+\tif (fat_itr_isdir(&dir->itr)) {\n+\t\tdent->type = FS_DT_DIR;\n+\t} else {\n+\t\tdent->type = FS_DT_REG;\n+\t\tdent->size = FAT2CPU32(dir->itr.dent->size);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+void fat_closedir(FS_DIR *dirp)\n+{\n+\tfat_dir *dir = (fat_dir *)dirp;\n+\tfree(dir);\n+}\n+\n void fat_close(void)\n {\n }\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "5/8"
    ]
}