get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 4331,
    "url": "https://patches.dpdk.org/api/patches/4331/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1429184910-30186-2-git-send-email-pboldin@mirantis.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1429184910-30186-2-git-send-email-pboldin@mirantis.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1429184910-30186-2-git-send-email-pboldin@mirantis.com",
    "date": "2015-04-16T11:48:26",
    "name": "[dpdk-dev,v5,1/5] vhost: eventfd_link: moving ioctl to a function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c7ba2d7358cad922a4d5f4ebd4cefb3494293354",
    "submitter": {
        "id": 194,
        "url": "https://patches.dpdk.org/api/people/194/?format=api",
        "name": "Pavel Boldin",
        "email": "pboldin@mirantis.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1429184910-30186-2-git-send-email-pboldin@mirantis.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/4331/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/4331/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id DA2BCC360;\n\tThu, 16 Apr 2015 13:48:39 +0200 (CEST)",
            "from mail-la0-f50.google.com (mail-la0-f50.google.com\n\t[209.85.215.50]) by dpdk.org (Postfix) with ESMTP id EDE5FADA2\n\tfor <dev@dpdk.org>; Thu, 16 Apr 2015 13:48:35 +0200 (CEST)",
            "by laat2 with SMTP id t2so54586959laa.1\n\tfor <dev@dpdk.org>; Thu, 16 Apr 2015 04:48:35 -0700 (PDT)",
            "from pboldin-pc.kha.mirantis.net ([194.213.110.67])\n\tby mx.google.com with ESMTPSA id\n\toy3sm1636510lbb.1.2015.04.16.04.48.34\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 16 Apr 2015 04:48:34 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=QxfMAqnJbcbOv/kD2ERCdY8wBzas7W6NArESlKtbFqk=;\n\tb=g5TyACfFEqXjdokfIv7LjIbjmTqxH6yCLd3C5Rz0YQbZWbgkIDE8pVsz+fzvwa9LOJ\n\t9xBbEdY3mOlyI2nv2yCIwMRbrFrpskc+LhY+3AoloiFTIDT2VE5yrq3yFYtNZZVpYy8L\n\tS1I09D6+WuFHMUoeuzJ6IB7f/J7XazsUszL/w=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=QxfMAqnJbcbOv/kD2ERCdY8wBzas7W6NArESlKtbFqk=;\n\tb=bJno/xzltGVK8krDK7nVG0De0uRhV1j4pbYDgCpg7zPdOSFiYaiQlEAuXFe+3EO0/R\n\tHMLiY12xNpePWHGXelIpTm9H4ZQypiDJCAqD/WHb5kQmkhcVf4tdAUumR6FykPSkc/3J\n\tzyR6U0bZJxCv7TD6J/wNjWawAnrWU47wp5Lnz73w2DxL506ZcizFyR6wtNHkq1+jScs1\n\tMupFRwoGAbi/k87LFnbq4h5YNh1i78ZzkNpG+BSkl7der546LoG5ckbOvH/5XyTqS1lY\n\tCtvb8vlpTBQt9WgJZnMoZBzMKr2OUAOEK58Sej1uBIiTXkCq/heL8mE+86aCa6BfziC4\n\t+7ug==",
        "X-Gm-Message-State": "ALoCoQn/V+h9U2t9afip05rHqqf8b0prKC1UYFKsVtWK1hWzEJptoe3S58O22A588t4JNHaBJxP4",
        "X-Received": "by 10.152.8.78 with SMTP id p14mr28368266laa.19.1429184915611;\n\tThu, 16 Apr 2015 04:48:35 -0700 (PDT)",
        "From": "Pavel Boldin <pboldin@mirantis.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 16 Apr 2015 14:48:26 +0300",
        "Message-Id": "<1429184910-30186-2-git-send-email-pboldin@mirantis.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1429184910-30186-1-git-send-email-pboldin@mirantis.com>",
        "References": "<1427994080-10163-1-git-send-email-pboldin@mirantis.com>\n\t<1429184910-30186-1-git-send-email-pboldin@mirantis.com>",
        "Subject": "[dpdk-dev] [PATCH v5 1/5] vhost: eventfd_link: moving ioctl to a\n\tfunction",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Move ioctl `EVENTFD_COPY' handler code to an inline function.\n\nSigned-off-by: Pavel Boldin <pboldin@mirantis.com>\n---\n lib/librte_vhost/eventfd_link/eventfd_link.c | 171 ++++++++++++++-------------\n 1 file changed, 89 insertions(+), 82 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventfd_link/eventfd_link.c\nindex 62c45c8..d7cb81f 100644\n--- a/lib/librte_vhost/eventfd_link/eventfd_link.c\n+++ b/lib/librte_vhost/eventfd_link/eventfd_link.c\n@@ -65,9 +65,8 @@ put_files_struct(struct files_struct *files)\n \t\tBUG();\n }\n \n-\n-static long\n-eventfd_link_ioctl(struct file *f, unsigned int ioctl, unsigned long arg)\n+static inline long\n+eventfd_link_ioctl_copy(unsigned long arg)\n {\n \tvoid __user *argp = (void __user *) arg;\n \tstruct task_struct *task_target = NULL;\n@@ -76,90 +75,98 @@ eventfd_link_ioctl(struct file *f, unsigned int ioctl, unsigned long arg)\n \tstruct fdtable *fdt;\n \tstruct eventfd_copy eventfd_copy;\n \n-\tswitch (ioctl) {\n-\tcase EVENTFD_COPY:\n-\t\tif (copy_from_user(&eventfd_copy, argp,\n-\t\t\tsizeof(struct eventfd_copy)))\n-\t\t\treturn -EFAULT;\n-\n-\t\t/*\n-\t\t * Find the task struct for the target pid\n-\t\t */\n-\t\ttask_target =\n-\t\t\tpid_task(find_vpid(eventfd_copy.target_pid), PIDTYPE_PID);\n-\t\tif (task_target == NULL) {\n-\t\t\tpr_debug(\"Failed to get mem ctx for target pid\\n\");\n-\t\t\treturn -EFAULT;\n-\t\t}\n-\n-\t\tfiles = get_files_struct(current);\n-\t\tif (files == NULL) {\n-\t\t\tpr_debug(\"Failed to get files struct\\n\");\n-\t\t\treturn -EFAULT;\n-\t\t}\n-\n-\t\trcu_read_lock();\n-\t\tfile = fcheck_files(files, eventfd_copy.source_fd);\n-\t\tif (file) {\n-\t\t\tif (file->f_mode & FMODE_PATH ||\n-\t\t\t\t!atomic_long_inc_not_zero(&file->f_count))\n+\tif (copy_from_user(&eventfd_copy, argp,\n+\t\tsizeof(struct eventfd_copy)))\n+\t\treturn -EFAULT;\n+\n+\t/*\n+\t * Find the task struct for the target pid\n+\t */\n+\ttask_target =\n+\t\tpid_task(find_vpid(eventfd_copy.target_pid), PIDTYPE_PID);\n+\tif (task_target == NULL) {\n+\t\tpr_debug(\"Failed to get mem ctx for target pid\\n\");\n+\t\treturn -EFAULT;\n+\t}\n+\n+\tfiles = get_files_struct(current);\n+\tif (files == NULL) {\n+\t\tpr_debug(\"Failed to get files struct\\n\");\n+\t\treturn -EFAULT;\n+\t}\n+\n+\trcu_read_lock();\n+\tfile = fcheck_files(files, eventfd_copy.source_fd);\n+\tif (file) {\n+\t\tif (file->f_mode & FMODE_PATH ||\n+\t\t\t!atomic_long_inc_not_zero(&file->f_count))\n+\t\t\tfile = NULL;\n+\t}\n+\trcu_read_unlock();\n+\tput_files_struct(files);\n+\n+\tif (file == NULL) {\n+\t\tpr_debug(\"Failed to get file from source pid\\n\");\n+\t\treturn 0;\n+\t}\n+\n+\t/*\n+\t * Release the existing eventfd in the source process\n+\t */\n+\tspin_lock(&files->file_lock);\n+\tfput(file);\n+\tfilp_close(file, files);\n+\tfdt = files_fdtable(files);\n+\tfdt->fd[eventfd_copy.source_fd] = NULL;\n+\tspin_unlock(&files->file_lock);\n+\n+\t/*\n+\t * Find the file struct associated with the target fd.\n+\t */\n+\n+\tfiles = get_files_struct(task_target);\n+\tif (files == NULL) {\n+\t\tpr_debug(\"Failed to get files struct\\n\");\n+\t\treturn -EFAULT;\n+\t}\n+\n+\trcu_read_lock();\n+\tfile = fcheck_files(files, eventfd_copy.target_fd);\n+\tif (file) {\n+\t\tif (file->f_mode & FMODE_PATH ||\n+\t\t\t!atomic_long_inc_not_zero(&file->f_count))\n \t\t\t\tfile = NULL;\n-\t\t}\n-\t\trcu_read_unlock();\n-\t\tput_files_struct(files);\n-\n-\t\tif (file == NULL) {\n-\t\t\tpr_debug(\"Failed to get file from source pid\\n\");\n-\t\t\treturn 0;\n-\t\t}\n-\n-\t\t/*\n-\t\t * Release the existing eventfd in the source process\n-\t\t */\n-\t\tspin_lock(&files->file_lock);\n-\t\tfput(file);\n-\t\tfilp_close(file, files);\n-\t\tfdt = files_fdtable(files);\n-\t\tfdt->fd[eventfd_copy.source_fd] = NULL;\n-\t\tspin_unlock(&files->file_lock);\n-\n-\t\t/*\n-\t\t * Find the file struct associated with the target fd.\n-\t\t */\n-\n-\t\tfiles = get_files_struct(task_target);\n-\t\tif (files == NULL) {\n-\t\t\tpr_debug(\"Failed to get files struct\\n\");\n-\t\t\treturn -EFAULT;\n-\t\t}\n-\n-\t\trcu_read_lock();\n-\t\tfile = fcheck_files(files, eventfd_copy.target_fd);\n-\t\tif (file) {\n-\t\t\tif (file->f_mode & FMODE_PATH ||\n-\t\t\t\t!atomic_long_inc_not_zero(&file->f_count))\n-\t\t\t\t\tfile = NULL;\n-\t\t}\n-\t\trcu_read_unlock();\n-\t\tput_files_struct(files);\n-\n-\t\tif (file == NULL) {\n-\t\t\tpr_debug(\"Failed to get file from target pid\\n\");\n-\t\t\treturn 0;\n-\t\t}\n-\n-\t\t/*\n-\t\t * Install the file struct from the target process into the\n-\t\t * file desciptor of the source process,\n-\t\t */\n-\n-\t\tfd_install(eventfd_copy.source_fd, file);\n+\t}\n+\trcu_read_unlock();\n+\tput_files_struct(files);\n \n+\tif (file == NULL) {\n+\t\tpr_debug(\"Failed to get file from target pid\\n\");\n \t\treturn 0;\n+\t}\n+\n+\t/*\n+\t * Install the file struct from the target process into the\n+\t * file desciptor of the source process,\n+\t */\n+\n+\tfd_install(eventfd_copy.source_fd, file);\n+\n+\treturn 0;\n+}\n \n-\tdefault:\n-\t\treturn -ENOIOCTLCMD;\n+static long\n+eventfd_link_ioctl(struct file *f, unsigned int ioctl, unsigned long arg)\n+{\n+\tlong ret = -ENOIOCTLCMD;\n+\n+\tswitch (ioctl) {\n+\tcase EVENTFD_COPY:\n+\t\tret = eventfd_link_ioctl_copy(arg);\n+\t\tbreak;\n \t}\n+\n+\treturn ret;\n }\n \n static const struct file_operations eventfd_link_fops = {\n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "1/5"
    ]
}