Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#7457 - Hiding dircache behind a posix API

Attached to Project: Rockbox
Opened by Kévin Ferrare (TiMiD) - Friday, 20 July 2007, 09:48 GMT+2
Last edited by Peter D'Hoye (petur) - Saturday, 21 July 2007, 00:34 GMT+2
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

Hi,

I made this patch with which presents dircache (and normal dir api for targets without it) as a standard posix api.

This avoids confusion in app code, so that devs won't mistake and use the dircache-disabled api when dircache is enabled, saving some disks spins
   posix_dircache.diff (29 KiB)
 apps/playlist.c                   |    1 
 apps/tree.c                       |   10 ++--
 apps/plugins/doom/rockdoom.c      |    8 +--
 apps/plugins/doom/rockmacros.h    |   11 ----
 apps/plugins/rockboy/rockmacros.h |   13 -----
 apps/plugins/rockboy/rockboy.c    |    6 +-
 apps/plugins/rockpaint.c          |   22 ++++-----
 apps/plugins/properties.c         |   53 ----------------------
 apps/filetree.c                   |   21 ++++-----
 apps/tagcache.c                   |   24 +++++-----
 apps/plugin.c                     |   17 ++-----
 apps/plugin.h                     |   23 +++------
 firmware/include/dircache.h       |   26 ++++-------
 firmware/include/dir.h            |   88 +++++++++-----------------------------
 firmware/SOURCES                  |    2 
 firmware/common/disk.c            |    1 
 firmware/common/dircache.c        |   48 +++++++++++++-------
 firmware/common/file.c            |   28 ++++++------
 18 files changed, 138 insertions(+), 264 deletions(-)

This task depends upon

Closed by  Peter D'Hoye (petur)
Saturday, 21 July 2007, 00:34 GMT+2
Reason for closing:  Accepted
Comment by Kévin Ferrare (TiMiD) - Friday, 20 July 2007, 11:48 GMT+2
forgot to add the dir.h file.
Patch and add that file to firmware/include
   dir.h (1.5 KiB)
Comment by Kévin Ferrare (TiMiD) - Friday, 20 July 2007, 18:15 GMT+2
Apply the patch, ignore the "File firmware/common/dir.c is not empty after patch, as expected" error and remove firmware/common/dir.c

works here
   posix_dircache.diff (50.6 KiB)
 apps/playlist.c                   |    1 
 apps/tree.c                       |   10 -
 apps/plugins/doom/rockdoom.c      |    8 
 apps/plugins/doom/rockmacros.h    |   11 -
 apps/plugins/rockboy/rockmacros.h |   13 -
 apps/plugins/rockboy/rockboy.c    |    6 
 apps/plugins/rockpaint.c          |   22 +-
 apps/plugins/properties.c         |   53 ------
 apps/tagcache.c                   |   24 +-
 apps/filetree.c                   |   21 +-
 apps/plugin.c                     |   17 -
 apps/plugin.h                     |   23 --
 firmware/SOURCES                  |    2 
 firmware/include/dircache.h       |   26 +-
 firmware/include/dir_uncached.h   |   91 ++++++++++
 firmware/include/dir.h            |   88 ++--------
 firmware/common/disk.c            |    4 
 firmware/common/dircache.c        |   48 +++--
 firmware/common/dir_uncached.c    |  322 ++++++++++++++++++++++++++++++++++++
 firmware/common/dir.c             |  334 --------------------------------------
 firmware/common/file.c            |   28 +--
 21 files changed, 553 insertions(+), 599 deletions(-)

Comment by Michael Sevakis (MikeS) - Friday, 20 July 2007, 21:04 GMT+2
I have never looked into the details of dircache and frankly I think it should work through the normal file APIs without any awareness by the caller of those APIs that it's even there or not. Is that the intent here? It's the impression I get from a quick scan of the patch.

Loading...