get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49577,
    "url": "http://patches.dpdk.org/api/patches/49577/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/ed6e20b3f60e2927de4cb098ae8e50385081a7de.1547120005.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<ed6e20b3f60e2927de4cb098ae8e50385081a7de.1547120005.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/ed6e20b3f60e2927de4cb098ae8e50385081a7de.1547120005.git.anatoly.burakov@intel.com",
    "date": "2019-01-10T11:34:08",
    "name": "eal/bsdapp: don't clean up files at startup",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "71aec4e66eb8193350d77192237c5542f6c254f0",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/ed6e20b3f60e2927de4cb098ae8e50385081a7de.1547120005.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 3087,
            "url": "http://patches.dpdk.org/api/series/3087/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3087",
            "date": "2019-01-10T11:34:08",
            "name": "eal/bsdapp: don't clean up files at startup",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3087/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/49577/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/49577/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D61B31B610;\n\tThu, 10 Jan 2019 12:34:16 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 6A2251B5A8;\n\tThu, 10 Jan 2019 12:34:15 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Jan 2019 03:34:14 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 10 Jan 2019 03:34:13 -0800",
            "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tx0ABYCUQ010521; Thu, 10 Jan 2019 11:34:12 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id x0ABYC4H026066;\n\tThu, 10 Jan 2019 11:34:12 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id x0ABY83P026054;\n\tThu, 10 Jan 2019 11:34:08 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,461,1539673200\"; d=\"scan'208\";a=\"117034533\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>, thomas@monjalon.net,\n\tstable@dpdk.org",
        "Date": "Thu, 10 Jan 2019 11:34:08 +0000",
        "Message-Id": "<ed6e20b3f60e2927de4cb098ae8e50385081a7de.1547120005.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH] eal/bsdapp: don't clean up files at startup",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "On FreeBSD, closing the file descriptor drops the lock even if the\nfile descriptor was mmap'ed. This leads to the cleanup at the end\nof EAL init to remove fbarray files that are still in use by the\nprocess itself.\n\nHowever, instead of working around this issue, we can take advantage\nof the fact that FreeBSD doesn't really create any per-process\nfiles in the first place, so no cleanup is actually needed.\n\nFixes: 0a529578f162 (\"eal: clean up unused files on initialization\")\nCc: stable@dpdk.org\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/bsdapp/eal/eal.c | 84 ++-------------------------------\n 1 file changed, 3 insertions(+), 81 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex c8e0da097..a6e573933 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -3,8 +3,6 @@\n  * Copyright(c) 2014 6WIND S.A.\n  */\n \n-#include <dirent.h>\n-#include <fnmatch.h>\n #include <stdio.h>\n #include <stdlib.h>\n #include <stdint.h>\n@@ -146,86 +144,10 @@ eal_create_runtime_dir(void)\n int\n eal_clean_runtime_dir(void)\n {\n-\tDIR *dir;\n-\tstruct dirent *dirent;\n-\tint dir_fd, fd, lck_result;\n-\tstatic const char * const filters[] = {\n-\t\t\"fbarray_*\",\n-\t\t\"mp_socket_*\"\n-\t};\n-\n-\t/* open directory */\n-\tdir = opendir(runtime_dir);\n-\tif (!dir) {\n-\t\tRTE_LOG(ERR, EAL, \"Unable to open runtime directory %s\\n\",\n-\t\t\t\truntime_dir);\n-\t\tgoto error;\n-\t}\n-\tdir_fd = dirfd(dir);\n-\n-\t/* lock the directory before doing anything, to avoid races */\n-\tif (flock(dir_fd, LOCK_EX) < 0) {\n-\t\tRTE_LOG(ERR, EAL, \"Unable to lock runtime directory %s\\n\",\n-\t\t\truntime_dir);\n-\t\tgoto error;\n-\t}\n-\n-\tdirent = readdir(dir);\n-\tif (!dirent) {\n-\t\tRTE_LOG(ERR, EAL, \"Unable to read runtime directory %s\\n\",\n-\t\t\t\truntime_dir);\n-\t\tgoto error;\n-\t}\n-\n-\twhile (dirent != NULL) {\n-\t\tunsigned int f_idx;\n-\t\tbool skip = true;\n-\n-\t\t/* skip files that don't match the patterns */\n-\t\tfor (f_idx = 0; f_idx < RTE_DIM(filters); f_idx++) {\n-\t\t\tconst char *filter = filters[f_idx];\n-\n-\t\t\tif (fnmatch(filter, dirent->d_name, 0) == 0) {\n-\t\t\t\tskip = false;\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\t\tif (skip) {\n-\t\t\tdirent = readdir(dir);\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\t/* try and lock the file */\n-\t\tfd = openat(dir_fd, dirent->d_name, O_RDONLY);\n-\n-\t\t/* skip to next file */\n-\t\tif (fd == -1) {\n-\t\t\tdirent = readdir(dir);\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\t/* non-blocking lock */\n-\t\tlck_result = flock(fd, LOCK_EX | LOCK_NB);\n-\n-\t\t/* if lock succeeds, remove the file */\n-\t\tif (lck_result != -1)\n-\t\t\tunlinkat(dir_fd, dirent->d_name, 0);\n-\t\tclose(fd);\n-\t\tdirent = readdir(dir);\n-\t}\n-\n-\t/* closedir closes dir_fd and drops the lock */\n-\tclosedir(dir);\n+\t/* FreeBSD doesn't need this implemented for now, because, unlike Linux,\n+\t * FreeBSD doesn't create per-process files, so no need to clean up.\n+\t */\n \treturn 0;\n-\n-error:\n-\tif (dir)\n-\t\tclosedir(dir);\n-\n-\tRTE_LOG(ERR, EAL, \"Error while clearing runtime dir: %s\\n\",\n-\t\tstrerror(errno));\n-\n-\treturn -1;\n }\n \n \n",
    "prefixes": []
}