Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811969/?format=api
{ "id": 811969, "url": "http://patchwork.ozlabs.org/api/patches/811969/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170909171606.20029-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": "<20170909171606.20029-6-robdclark@gmail.com>", "list_archive_url": null, "date": "2017-09-09T17:15:56", "name": "[U-Boot,v3,5/9] fs/fat: implement opendir/readdir/closedir", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "4f54a56f788aaf58579ffbb9dfd5c7e8b208ea3e", "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/20170909171606.20029-6-robdclark@gmail.com/mbox/", "series": [ { "id": 2355, "url": "http://patchwork.ozlabs.org/api/series/2355/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2355", "date": "2017-09-09T17:15:51", "name": "fs/fat: cleanups + readdir implementation", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/2355/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811969/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811969/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=\"n+lkT5oE\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqLVV1xNkz9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 03:17:54 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid E07C3C21EDC; Sat, 9 Sep 2017 17:17:24 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 15E14C21E0C;\n\tSat, 9 Sep 2017 17:17:07 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 18BE9C21E92; Sat, 9 Sep 2017 17:16:46 +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 D1A06C21E99\n\tfor <u-boot@lists.denx.de>; Sat, 9 Sep 2017 17:16:42 +0000 (UTC)", "by mail-qt0-f196.google.com with SMTP id l25so380199qtf.2\n\tfor <u-boot@lists.denx.de>; Sat, 09 Sep 2017 10:16:42 -0700 (PDT)", "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tr48sm3160472qte.81.2017.09.09.10.16.40\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 09 Sep 2017 10:16:40 -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\t:mime-version:content-transfer-encoding;\n\tbh=JQFBMriCF8kpLl5pw7gQ935N+34SJvcfPBpLESISXgc=;\n\tb=n+lkT5oE8xIR2+0kIXrJdBpsMPPLaeGYEQTu/uav0OLWhYpNyiodNLigFHYDmxtlfv\n\t8AGu+GLffXmtYXporaKgRl96+WjMaCdQdScbesgAWlEONGnHnXP8d647Q5eJoRCGbCkk\n\tPj/N0ZvoRO/UtQVY0vU80tpGZmqQjSdcTY45b7NpTCT5I+H4fNr+VVTuDharD3uWkfeo\n\t3K6lwryIo6kqf4nMn5eokcLUXxudw7dIMWZDY3brO+S6Sq3eBz+tKKz6zTa6EGNwKMpx\n\tHVFrf4UzcFB5LIVEaDEN1o2ItDHCT4kjLhGtsgNNUwz6z9PEmvCqg2VfB4u/Reqbigc0\n\tOwHQ==", "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:mime-version:content-transfer-encoding;\n\tbh=JQFBMriCF8kpLl5pw7gQ935N+34SJvcfPBpLESISXgc=;\n\tb=eZ4+/NVrLQ7fjeuDwLXNYTKpkw23wQZky9NLv2U8W/O1ZD8TCCbe0aePLSd99e+wOv\n\tlWh5uH3do0Vw3mC3/Xv806y0ZwxT2tbL8SNAeWuKaNfHX+HYfHW1T9/ABMiWZeog4/4G\n\tNjuOdtH/X6SYYjsfaHvcJAzDvL5wfzPOWwiuX/H/h4+BtnJD51dTjYCAZMu/itxirspF\n\thH/48rs/oA8GwWXkvsbaCgui3bfIuotHC1V+CqaPAq1IfEzVTRpQ/QovHk5tbUUgrIg2\n\txR7wN2PBHTLV2Z9Pu7CjaC+CH+6MfXz3N+7nFXlrQrtcev+DExi86D+6rNLsXtL8xwdS\n\tsTCA==", "X-Gm-Message-State": "AHPjjUjkes6fJYf+JiRYnpeFrwoM+TvgclK7abmsYlFj7n2UH3u6Y0/L\n\tA/tjF/xk3fE+hu0dG3Q=", "X-Google-Smtp-Source": "AOwi7QC0UJgOy6PL+uo/Het+6RGft+Ib0mdD+Svol7m6GY2xxUvzJBqVcfarOXt0N8NernL8Ha3sxA==", "X-Received": "by 10.200.17.136 with SMTP id d8mr8992585qtj.26.1504977401592;\n\tSat, 09 Sep 2017 10:16:41 -0700 (PDT)", "From": "Rob Clark <robdclark@gmail.com>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Date": "Sat, 9 Sep 2017 13:15:56 -0400", "Message-Id": "<20170909171606.20029-6-robdclark@gmail.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170909171606.20029-1-robdclark@gmail.com>", "References": "<20170909171606.20029-1-robdclark@gmail.com>", "MIME-Version": "1.0", "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>", "Subject": "[U-Boot] [PATCH v3 5/9] 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>", "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>\nReviewed-by: Łukasz Majewski <lukma@denx.de>\n---\n fs/fat/fat.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 61 insertions(+)", "diff": "diff --git a/fs/fat/fat.c b/fs/fat/fat.c\nindex bbba7947ee..82ddb7eab1 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@@ -1146,6 +1147,66 @@ int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,\n \treturn ret;\n }\n \n+typedef struct {\n+\tstruct fs_dir_stream parent;\n+\tstruct fs_dirent dirent;\n+\tfsdata fsdata;\n+\tfat_itr itr;\n+} fat_dir;\n+\n+int fat_opendir(const char *filename, struct fs_dir_stream **dirsp)\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*dirsp = (struct fs_dir_stream *)dir;\n+\treturn 0;\n+\n+fail:\n+\tfree(dir);\n+\treturn ret;\n+}\n+\n+int fat_readdir(struct fs_dir_stream *dirs, struct fs_dirent **dentp)\n+{\n+\tfat_dir *dir = (fat_dir *)dirs;\n+\tstruct fs_dirent *dent = &dir->dirent;\n+\n+\tif (!fat_itr_next(&dir->itr))\n+\t\treturn -ENOENT;\n+\n+\tmemset(dent, 0, sizeof(*dent));\n+\tstrcpy(dent->name, dir->itr.name);\n+\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+\t*dentp = dent;\n+\n+\treturn 0;\n+}\n+\n+void fat_closedir(struct fs_dir_stream *dirs)\n+{\n+\tfat_dir *dir = (fat_dir *)dirs;\n+\tfree(dir);\n+}\n+\n void fat_close(void)\n {\n }\n", "prefixes": [ "U-Boot", "v3", "5/9" ] }