get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 809311,
    "url": "http://patchwork.ozlabs.org/api/patches/809311/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170903150031.18179-6-marek.behun@nic.cz/",
    "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": "<20170903150031.18179-6-marek.behun@nic.cz>",
    "list_archive_url": null,
    "date": "2017-09-03T15:00:27",
    "name": "[U-Boot,5/9] fs: btrfs: Add disk-to-cpu and cpu-to-disk conversion functions",
    "commit_ref": "597b4aff7b5d85946d2028ab9498116f53357dbc",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4028584c7aee763806efadd1ced671918c29fa8e",
    "submitter": {
        "id": 71605,
        "url": "http://patchwork.ozlabs.org/api/people/71605/?format=api",
        "name": "Marek Behún",
        "email": "marek.behun@nic.cz"
    },
    "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/20170903150031.18179-6-marek.behun@nic.cz/mbox/",
    "series": [
        {
            "id": 1246,
            "url": "http://patchwork.ozlabs.org/api/series/1246/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=1246",
            "date": "2017-09-03T15:00:25",
            "name": "Add single-device read-only BTRFS support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/1246/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/809311/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/809311/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\" (1024-bit key;\n\tsecure) header.d=nic.cz header.i=@nic.cz header.b=\"haADeKLe\"; \n\tdkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlbqx38Xdz9t2y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 01:05:01 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 02382C21E5B; Sun,  3 Sep 2017 15:02:15 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 43D71C21E8E;\n\tSun,  3 Sep 2017 15:01:37 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid E1166C21D99; Sun,  3 Sep 2017 15:01:33 +0000 (UTC)",
            "from mail.nic.cz (mail.nic.cz [217.31.204.67])\n\tby lists.denx.de (Postfix) with ESMTPS id 863D8C21D99\n\tfor <u-boot@lists.denx.de>; Sun,  3 Sep 2017 15:01:33 +0000 (UTC)",
            "from dellmb.labs.office.nic.cz (unknown\n\t[IPv6:2001:1488:fffe:6:8982:ed8c:62b1:c0c8])\n\tby mail.nic.cz (Postfix) with ESMTP id 37187623F1;\n\tSun,  3 Sep 2017 17:01:33 +0200 (CEST)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default;\n\tt=1504450893; bh=c55e5VXWudyHQHfB81r8zjKV6Geb67acenbN3Ka8QMI=;\n\th=From:To:Date;\n\tb=haADeKLebBXNVwGJULu6rUvAUhqjdIf4A8t8TJQX73esG1UkPYpEkRoL0pJUSG9tv\n\tosZ+PJBXi1elUERJOtJKS2fGjwW0cr1qGWq++0OLbpIF8obRGIv2tc7be8AabuAtgD\n\tc55W4Yvnxt0gjOP2pLzyHRTendUJRBy3B9jtwwXQ=",
        "From": "=?utf-8?q?Marek_Beh=C3=BAn?= <marek.behun@nic.cz>",
        "To": "u-boot@lists.denx.de",
        "Date": "Sun,  3 Sep 2017 17:00:27 +0200",
        "Message-Id": "<20170903150031.18179-6-marek.behun@nic.cz>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170903150031.18179-1-marek.behun@nic.cz>",
        "References": "<20170903150031.18179-1-marek.behun@nic.cz>",
        "X-Virus-Scanned": "clamav-milter 0.99.2 at mail",
        "X-Virus-Status": "Clean",
        "Cc": "Tomas Hlavacek <tomas.hlavacek@nic.cz>, Stefan Roese <sr@denx.de>,\n\t=?utf-8?q?Andreas_F=C3=A4rber?= <afaerber@suse.de>",
        "Subject": "[U-Boot] [PATCH 5/9] fs: btrfs: Add disk-to-cpu and cpu-to-disk\n\tconversion functions",
        "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": "BTRFS on disk structures are stored in Little Endian. Add functions\nto convert this structures to cpu and to disk format.\n\nOn Little Endian hosts, these functions do nothing.\n\nOn Big Endian the CALL_MACRO_FROM_EACH from variadic-macro.h is used\nto define all the members for each structure on which cpu_to_le* or\nle*_to_cpu is to be called.\n\nSigned-off-by: Marek Behun <marek.behun@nic.cz>\n\n create mode 100644 fs/btrfs/conv-funcs.h",
    "diff": "diff --git a/fs/btrfs/conv-funcs.h b/fs/btrfs/conv-funcs.h\nnew file mode 100644\nindex 0000000000..f2e7944e4e\n--- /dev/null\n+++ b/fs/btrfs/conv-funcs.h\n@@ -0,0 +1,176 @@\n+/*\n+ * Functions to convert BTRFS structures from disk to CPU endianness and back.\n+ *\n+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz\n+ *\n+ * SPDX-License-Identifier:\tGPL-2.0+\n+ */\n+\n+#ifndef __BTRFS_CONV_FUNCS_H__\n+#define __BTRFS_CONV_FUNCS_H__\n+\n+#include \"ctree.h\"\n+#include <u-boot/variadic-macro.h>\n+#include <asm/byteorder.h>\n+\n+/* We are using variadic macros and C11 _Generic to achieve compact code.\n+\n+   We want to define macro DEFINE_CONV(x, ...), where the first argument is the\n+   name of the structure for which it shall define conversion functions (the\n+   names of the functions shall be x_to_cpu and x_to_disk), and the other\n+   arguments are names of the members on which the functions shall do\n+   endianness conversion. */\n+\n+#if defined(__LITTLE_ENDIAN)\n+\n+/* If the target machine is little endian, the conversion functions do\n+   nothing, since the on disk format is little endian. */\n+\n+# define DEFINE_CONV(n,...)\t\t\t\t\t\\\n+\tstatic inline struct n *n##_to_disk(struct n * r)\t\\\n+\t{\t\t\t\t\t\t\t\\\n+\t\treturn r;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+\tstatic inline struct n *n##_to_cpu(struct n * r)\t\\\n+\t{\t\t\t\t\t\t\t\\\n+\t\treturn r;\t\t\t\t\t\\\n+\t}\n+\n+# define DEFINE_CONV_ALT(n,a,...)\t\t\t\t\\\n+\tstatic inline struct n *n##_to_disk_##a(struct n * r)\t\\\n+\t{\t\t\t\t\t\t\t\\\n+\t\treturn r;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+\tstatic inline struct n *n##_to_cpu_##a(struct n * r)\t\\\n+\t{\t\t\t\t\t\t\t\\\n+\t\treturn r;\t\t\t\t\t\\\n+\t}\n+\n+#else /* !defined(__LITTLE_ENDIAN) */\n+\n+/* Some structures contain not only scalar members, but compound types as well\n+   (for example, struct btrfs_inode_item contains members of type struct\n+   btrfs_timespec.\n+\n+   For these members we want to call the conversion function recursively, so\n+   first we declare the functions taking pointers to this types (these function\n+   will be defined later by the DEFINE_CONV macro) and then we define\n+   correspond functions taking non-pointers, so that they can be used in the\n+   expansion of the _Generic. */\n+# define DEFINE_CONV_FOR_STRUCT(n)\t\t\t\t\\\n+\tstatic inline struct n * n##_to_disk(struct n *);\t\\\n+\tstatic inline struct n * n##_to_cpu(struct n *);\t\\\n+\tstatic inline struct n n##_to_disk_v(struct n x) {\t\\\n+\t\treturn *n##_to_disk(&x);\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+\tstatic inline struct n n##_to_cpu_v(struct n x) {\t\\\n+\t\treturn *n##_to_cpu(&x);\t\t\t\t\\\n+\t}\n+\n+DEFINE_CONV_FOR_STRUCT(btrfs_key)\n+DEFINE_CONV_FOR_STRUCT(btrfs_stripe)\n+DEFINE_CONV_FOR_STRUCT(btrfs_timespec)\n+DEFINE_CONV_FOR_STRUCT(btrfs_inode_item)\n+DEFINE_CONV_FOR_STRUCT(btrfs_root_backup)\n+DEFINE_CONV_FOR_STRUCT(btrfs_dev_item)\n+\n+/* Now define the _Generic for both CPU to LE and LE to CPU */\n+# define DEFINE_CONV_CPU_TO_LE(x)\t\t\t\t\t\\\n+\t(d->x) = _Generic((d->x),\t\t\t\t\t\\\n+\t\t__u16: cpu_to_le16,\t\t\t\t\t\\\n+\t\t__u32: cpu_to_le32,\t\t\t\t\t\\\n+\t\t__u64: cpu_to_le64,\t\t\t\t\t\\\n+\t\tstruct btrfs_key: btrfs_key_to_disk_v,\t\t\t\\\n+\t\tstruct btrfs_stripe: btrfs_stripe_to_disk_v,\t\t\\\n+\t\tstruct btrfs_timespec: btrfs_timespec_to_disk_v,\t\\\n+\t\tstruct btrfs_inode_item: btrfs_inode_item_to_disk_v,\t\\\n+\t\tstruct btrfs_root_backup: btrfs_root_backup_to_disk_v,\t\\\n+\t\tstruct btrfs_dev_item: btrfs_dev_item_to_disk_v\t\t\\\n+\t\t)((d->x));\n+\n+# define DEFINE_CONV_LE_TO_CPU(x)\t\t\t\t\t\\\n+\t(d->x) = _Generic((d->x),\t\t\t\t\t\\\n+\t\t__u16: le16_to_cpu,\t\t\t\t\t\\\n+\t\t__u32: le32_to_cpu,\t\t\t\t\t\\\n+\t\t__u64: le64_to_cpu,\t\t\t\t\t\\\n+\t\tstruct btrfs_key: btrfs_key_to_cpu_v,\t\t\t\\\n+\t\tstruct btrfs_stripe: btrfs_stripe_to_cpu_v,\t\t\\\n+\t\tstruct btrfs_timespec: btrfs_timespec_to_cpu_v,\t\t\\\n+\t\tstruct btrfs_inode_item: btrfs_inode_item_to_cpu_v,\t\\\n+\t\tstruct btrfs_root_backup: btrfs_root_backup_to_cpu_v,\t\\\n+\t\tstruct btrfs_dev_item: btrfs_dev_item_to_cpu_v\t\t\\\n+\t\t)((d->x));\n+\n+# define DEFINE_CONV_ONE(t,n,m,...)\t\t\t\\\n+\tstatic inline struct t * n(struct t * d) {\t\\\n+\t\tCALL_MACRO_FOR_EACH(m, ##__VA_ARGS__)\t\\\n+\t\treturn d;\t\t\t\t\\\n+\t}\n+\n+/* Finally define the DEFINE_CONV macro */\n+# define DEFINE_CONV(n,...) \\\n+\tDEFINE_CONV_ONE(n,n##_to_disk,DEFINE_CONV_CPU_TO_LE,##__VA_ARGS__) \\\n+\tDEFINE_CONV_ONE(n,n##_to_cpu,DEFINE_CONV_LE_TO_CPU,##__VA_ARGS__)\n+\n+# define DEFINE_CONV_ALT(n,a,...) \\\n+\tDEFINE_CONV_ONE(n,n##_to_disk_##a,DEFINE_CONV_CPU_TO_LE, \\\n+\t\t##__VA_ARGS__) \\\n+\tDEFINE_CONV_ONE(n,n##_to_cpu_##a,DEFINE_CONV_LE_TO_CPU,##__VA_ARGS__)\n+\n+#endif /* !defined(__LITTLE_ENDIAN) */\n+\n+DEFINE_CONV(btrfs_key, objectid, offset)\n+DEFINE_CONV(btrfs_dev_item, devid, total_bytes, bytes_used, io_align, io_width,\n+\t    sector_size, type, generation, start_offset, dev_group)\n+DEFINE_CONV(btrfs_stripe, devid, offset)\n+DEFINE_CONV(btrfs_chunk, length, owner, stripe_len, type, io_align, io_width,\n+\t    sector_size, num_stripes, sub_stripes)\n+DEFINE_CONV(btrfs_free_space_entry, offset, bytes)\n+DEFINE_CONV(btrfs_free_space_header, location, generation, num_entries,\n+\t    num_bitmaps)\n+DEFINE_CONV(btrfs_extent_item, refs, generation, flags)\n+DEFINE_CONV(btrfs_tree_block_info, key)\n+DEFINE_CONV(btrfs_extent_data_ref, root, objectid, offset, count)\n+DEFINE_CONV(btrfs_shared_data_ref, count)\n+DEFINE_CONV(btrfs_extent_inline_ref, offset)\n+DEFINE_CONV(btrfs_dev_extent, chunk_tree, chunk_objectid, chunk_offset, length)\n+DEFINE_CONV(btrfs_inode_ref, index, name_len)\n+DEFINE_CONV(btrfs_inode_extref, parent_objectid, index, name_len)\n+DEFINE_CONV(btrfs_timespec, sec, nsec)\n+DEFINE_CONV(btrfs_inode_item, generation, transid, size, nbytes, block_group,\n+\t    nlink, uid, gid, mode, rdev, flags, sequence, atime, ctime, mtime,\n+\t    otime)\n+DEFINE_CONV(btrfs_dir_log_item, end)\n+DEFINE_CONV(btrfs_dir_item, location, transid, data_len, name_len)\n+DEFINE_CONV(btrfs_root_item, inode, generation, root_dirid, bytenr, byte_limit,\n+\t    bytes_used, last_snapshot, flags, refs, drop_progress,\n+\t    generation_v2, ctransid, otransid, stransid, rtransid, ctime,\n+\t    otime, stime, rtime)\n+DEFINE_CONV(btrfs_root_ref, dirid, sequence, name_len)\n+DEFINE_CONV(btrfs_file_extent_item, generation, ram_bytes, other_encoding,\n+\t    disk_bytenr, disk_num_bytes, offset, num_bytes)\n+DEFINE_CONV_ALT(btrfs_file_extent_item, inl, generation, ram_bytes,\n+\t\tother_encoding)\n+DEFINE_CONV(btrfs_dev_replace_item, src_devid, cursor_left, cursor_right,\n+\t    cont_reading_from_srcdev_mode, replace_state, time_started,\n+\t    time_stopped, num_write_errors, num_uncorrectable_read_errors)\n+DEFINE_CONV(btrfs_block_group_item, used, chunk_objectid, flags)\n+DEFINE_CONV(btrfs_free_space_info, extent_count, flags)\n+\n+DEFINE_CONV(btrfs_header, bytenr, flags, generation, owner, nritems)\n+DEFINE_CONV(btrfs_root_backup, tree_root, tree_root_gen, chunk_root,\n+\t    chunk_root_gen, extent_root, extent_root_gen, fs_root, fs_root_gen,\n+\t    dev_root, dev_root_gen, csum_root, csum_root_gen, total_bytes,\n+\t    bytes_used, num_devices)\n+DEFINE_CONV(btrfs_super_block, bytenr, flags, magic, generation, root,\n+\t    chunk_root, log_root, log_root_transid, total_bytes, bytes_used,\n+\t    root_dir_objectid, num_devices, sectorsize, nodesize,\n+\t    __unused_leafsize, stripesize, sys_chunk_array_size,\n+\t    chunk_root_generation, compat_flags, compat_ro_flags,\n+\t    incompat_flags, csum_type, dev_item, cache_generation,\n+\t    uuid_tree_generation, super_roots[0], super_roots[1], \n+\t    super_roots[2], super_roots[3])\n+DEFINE_CONV(btrfs_item, key, offset, size)\n+DEFINE_CONV(btrfs_key_ptr, key, blockptr, generation)\n+\n+#endif /* __BTRFS_CONV_FUNCS_H__ */\n",
    "prefixes": [
        "U-Boot",
        "5/9"
    ]
}