From patchwork Sat Sep 9 17:15:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 811967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X//VWcUJ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xqLSm5cHkz9t1G for ; Sun, 10 Sep 2017 03:16:22 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B61AEC21EB1; Sat, 9 Sep 2017 17:16:17 +0000 (UTC) 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, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 90405C21C58; Sat, 9 Sep 2017 17:16:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B8385C21C58; Sat, 9 Sep 2017 17:16:13 +0000 (UTC) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by lists.denx.de (Postfix) with ESMTPS id 3949FC21C35 for ; Sat, 9 Sep 2017 17:16:13 +0000 (UTC) Received: by mail-qt0-f193.google.com with SMTP id 7so3291692qtz.3 for ; Sat, 09 Sep 2017 10:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=piQVCLLQ9GZRczPhhd2k8Th3G6fq8RQCZoeDjgKZaqY=; b=X//VWcUJxJXE4jiFJkC6FC+4xptPu5/GnBq0nDpZ38tD/v7/c9FL1jLANY1XzWhy1h 58tfFeuO44M3H7PccL0PxWq/h9AFFrWxXuDYZBP7Ua8L4WMzbM/DX37Lsyo5qRd1XDqJ RwRM2IMIBNnK4FhEZz2zUHR7Jj1d/buQf9aYbNW8OrmUmOITAukbZq1ws2H1s4sCYAB9 0/z3dEdaZMDfsiiaBXZVGYraf2XudhvNnDKdgVrEXBCJayg/K9skO74jhpXDenzJYOUQ eP3pwz5d7J5rnnHIrmhIJnPqImRNI8TdFlmp7MwIAtM+UdHAy3Uaqb0ArOKvitqokcjq 2yog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=piQVCLLQ9GZRczPhhd2k8Th3G6fq8RQCZoeDjgKZaqY=; b=b/s5RnRus1rRD1hSbAD2mBDWdKJwIw+wZRDmIc8noLXPz3AA0ELN44DAS6xh2Pjst/ GB3eQmMZQ9gWmc6z+hmz67FKdeODisd6wwlgVZ5vbwjmMU1DTM9umLxQmf5P5WLsNLdT I8qm54dlt6Zwwa8CuCsZRfAQNO7Gtxjhly2ZfcN8RAJntZXSVwIZQenSJ/+CcjuwmTsh Mh3b7m+axsk5jgXEI7hMyhQfTiqoGp+XnCR2eiF7caT3HwE3fT9tewsbSbI+E4pf8NHq IS/seEvVu3MbfA4YzW4KcE7bz4wfS/7Swt+YlvfSBL848aQ5jR6+oFBNlbcQ1BVCgzrg jIeA== X-Gm-Message-State: AHPjjUhevHLRLwtDFGG4PzUXUn1PvM7nBZuDJViSgWjr4iQiYbaO+Mfl VcbtZvCHt358jTtjhHA= X-Google-Smtp-Source: AOwi7QDriwveDmfpXvSgU64pTVnXclKRBYqwFwp9RaMU0wN9dNySxH3kozYyn3L/qufx6jk0Bhqu9A== X-Received: by 10.237.36.48 with SMTP id r45mr9108873qtc.119.1504977371625; Sat, 09 Sep 2017 10:16:11 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id v78sm3747166qkg.22.2017.09.09.10.16.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Sep 2017 10:16:10 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sat, 9 Sep 2017 13:15:51 -0400 Message-Id: <20170909171606.20029-1-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 MIME-Version: 1.0 Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH v3 0/9] fs/fat: cleanups + readdir implementation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Introduce directory traversal iterators, and implement fs_readdir() which is needed by EFI_LOADER. The part re-working fat.c to use the directory iterators itself is nearly a 2:1 negative diffstat, and a pretty big cleanup. I fixed one or two other small issues along the way. v2: fix a couple issues (partition is whole disk, and traversing ".." up to root directory) v3: mostly addition of comments plus cleaning up open-coded sector <-> cluster conversions, and some FAT32 fixes for large directories Rob Clark (9): fs/fat: split out helper to init fsdata fs/fat: introduce new director iterators fat/fs: convert to directory iterators fs: add fs_readdir() fs/fat: implement opendir/readdir/closedir fat/fs: remove a bunch of dead code fat/fs: move ls to generic implementation fs/fat: fix case for FAT shortnames fs/fat: Clean up open-coded sector <-> cluster conversions disk/part.c | 31 +- fs/fat/Makefile | 4 - fs/fat/fat.c | 1062 ++++++++++++++++++++++------------------------------ fs/fat/fat_write.c | 12 +- fs/fat/file.c | 183 --------- fs/fs.c | 137 ++++++- include/fat.h | 49 ++- include/fs.h | 67 ++++ include/part.h | 9 + 9 files changed, 700 insertions(+), 854 deletions(-) delete mode 100644 fs/fat/file.c