get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 809112,
    "url": "http://patchwork.ozlabs.org/api/patches/809112/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170902163806.27265-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": "<20170902163806.27265-8-robdclark@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-02T16:38:02",
    "name": "[U-Boot,v2,7/8] fat/fs: move ls to generic implementation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9e74da9720673ea1a1b6e0cd41981ba7e1984e5d",
    "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-8-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/809112/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/809112/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=\"DvhbSA4c\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xl24J57R6z9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  3 Sep 2017 02:43:44 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 2860DC21FAC; Sat,  2 Sep 2017 16:41:16 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 03756C21F65;\n\tSat,  2 Sep 2017 16:40:46 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 18E2CC21F21; Sat,  2 Sep 2017 16:39:02 +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 E0E40C21F5E\n\tfor <u-boot@lists.denx.de>; Sat,  2 Sep 2017 16:38:56 +0000 (UTC)",
            "by mail-qt0-f196.google.com with SMTP id u11so2073809qtu.2\n\tfor <u-boot@lists.denx.de>; Sat, 02 Sep 2017 09:38:56 -0700 (PDT)",
            "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\t47sm2139183qtx.49.2017.09.02.09.38.54\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 02 Sep 2017 09:38:54 -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=6lrTLU8V09mu5B3glt61+47zJeI9gKbjp9RWhPY+2is=;\n\tb=DvhbSA4cOgcTF0WcIk+YwH40o7QyunHyacQAgICgWoZPYrq7xjdQVRf6zvt972KS0H\n\th1uoYhS3TrMEAB52z+iXpWA87cvIBzxVGT4Vj5WTRAW/qup7TpUZZCAYD/WdWWaSctb3\n\t++l3q+iBcgW/TILCwo2iQ9XmpVb9rK0eNusb93BvA8ydpe2gi8np+AsFbXqwMQbGLhE7\n\tfD5Z2ny0huIY561x8lH/sljpP3tbMhwjFDbETuKY4sSy/LdLIkA2s1tsVMwnF7/fOSLD\n\tx63ccoeBO0D0v0im4NbY7p6KbbJrY6Sge7R9Ivee/LIfj5yKyHQAHE9e/HeBItTOVMpF\n\tKIhA==",
        "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=6lrTLU8V09mu5B3glt61+47zJeI9gKbjp9RWhPY+2is=;\n\tb=rLlnjDiLRwLgm+WRGavU7ZZ0VnHRFRUZXJEndaMu5a2HJAZwmfDkdrW9/35rr+GF5N\n\t5Dobiok2rx38k2jmJrX0kQ3T0JA9PAMzpxB6DpagKhZ6unXjbNrO9BiHZFgx0Y/S0a6a\n\tciHplwIQtfOLhv6/E73Zqp6gGVLGqCQCDKLdCsF70FT/9BFPgw2snTFO0SuwDYBvn8XI\n\tZCThlEl5OXAoE2cwvdeyQzfzTD0TT0r2UCiatvRlrtW2WzaxBl7V9NDIzzcdGfHtJwda\n\tpnIuyWt12pASfe8WQuAZ86kgABg71MGsgr8MxfAYt2nLTnmYAsP3gSCZXYSp4jP7cQxo\n\t4/lQ==",
        "X-Gm-Message-State": "AHPjjUgiiL0MnlomMQ58Y5Ri3Hc0SiW0wKOGaCYjDkR4V5sw5Ao4362I\n\tjtMjPQtO2ymyUbGYLQA=",
        "X-Google-Smtp-Source": "ADKCNb6l6lggCp/SEG2CwduQPqSbX8Bo+t7uQjV9qcpwHA/GdIPs5nEe5vribo+6veWe+BYoLQUwPg==",
        "X-Received": "by 10.200.15.236 with SMTP id f41mr7571305qtk.115.1504370335614; \n\tSat, 02 Sep 2017 09:38:55 -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:02 -0400",
        "Message-Id": "<20170902163806.27265-8-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>",
        "Cc": "=?utf-8?q?=C5=81ukasz_Majewski?= <l.majewski@samsung.com>,\n\tGenevieve Chan <ccheauya@altera.com>, Tien Fong Chee <tfchee@altera.com>",
        "Subject": "[U-Boot] [PATCH v2 7/8] 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>",
        "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": "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>\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 d30ef3903b..fc3106aacb 100644\n--- a/fs/fat/fat.c\n+++ b/fs/fat/fat.c\n@@ -1002,38 +1002,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 441c880654..716c223ec6 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+\tFS_DIR *dirp;\n+\tstruct fs_dirent *dent;\n+\tint files = 0, dirs = 0;\n+\n+\tdirp = fs_opendir(dirname);\n+\tif (!dirp)\n+\t\treturn -errno;\n+\n+\twhile ((dent = fs_readdir(dirp))) {\n+\t\tif (dent->type == FS_DT_DIR) {\n+\t\t\tprintf(\"            %s/\\n\", dent->name);\n+\t\t\tdirs++;\n+\t\t} else {\n+\t\t\tprintf(\" %8lld   %s\\n\", dent->size, dent->name);\n+\t\t\tfiles++;\n+\t\t}\n+\t}\n+\n+\tfs_closedir(dirp);\n+\n+\tprintf(\"\\n%d file(s), %d dir(s)\\n\\n\", files, dirs);\n+\n+\treturn 0;\n+}\n+\n static inline int fs_exists_unsupported(const char *filename)\n {\n \treturn 0;\n@@ -111,7 +140,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@@ -121,7 +150,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 1e8bc44e9a..b2d4b952fd 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@@ -172,7 +173,6 @@ typedef struct {\n } fsdata;\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@@ -185,5 +185,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, FS_DIR **dirp);\n+int fat_readdir(FS_DIR *dirp);\n+void fat_closedir(FS_DIR *dirp);\n void fat_close(void);\n #endif /* _FAT_H_ */\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "7/8"
    ]
}