Commit graph

103 commits

Author SHA1 Message Date
Michael Sevakis
a56f1ca1ed Cleanup MV/MD macros a little.
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal
with function parameters. IF_MD/IF_MV are enough.

Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0
if not.

Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
2013-08-17 12:18:22 -04:00
Thomas Martitz
af7aaae478 Dircache: Don't expose struct dircache_entry and pointers into the cache, use IDs instead.
Only integer IDs are exposed from dircache with this. This way the cache is isolated from other modules.
This is needed for my buflib gsoc project.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30038 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 20:12:42 +00:00
Michael Sparmann
a5034bd244 Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29449 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 23:22:09 +00:00
Michael Sparmann
59c5e791a1 iPod Classic CE-ATA Support (Part 3 of 4: Introduce STORAGE_NEEDS_ALIGN, which ensures that no unaligned storage accesses are performed through file.c)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29447 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 22:47:33 +00:00
Michael Sparmann
751303c2ac iPod Classic CE-ATA Support (Part 1 of 4: Cacheline align some statically allocated sector buffers)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29444 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 22:44:30 +00:00
Frank Gevaerts
1db3dfdd75 Accept FS#11774 by Michael Hohmuth (with some own modifications to #ifdef conditions)
Unmount all filesystems before connecting USB. This ensures that all filehandles are closed, which avoids possible filesystem corruption



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28693 a1c6a512-1295-4272-9138-f99709370657
2010-11-28 15:22:51 +00:00
Michael Sparmann
01cdb6a21f Fix screendump on iPod Nano 2G by increasing the usb thread stack size and reducing the stack usage of FAT and storage functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28356 a1c6a512-1295-4272-9138-f99709370657
2010-10-25 12:36:57 +00:00
Thomas Martitz
6eaab4d004 Ged rid of uisimulator/common/io.c for android builds.
Use host's functions for file i/o directly (open(), close() ,etc.), not the sim_* variants.
Some dir functions need to be wrapped still because we need to cache the parents dir's path (host's dirent doesn't let us know).
For the same reason (incompatibility) with host's dirent) detach some members from Rockbox' dirent struct and put it into an extra one,
the values can be retrieved via the new dir_get_info().

Get rid of the sim_ prefix for sleep as well and change the signature to unix sleep().

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27968 a1c6a512-1295-4272-9138-f99709370657
2010-09-01 21:29:34 +00:00
Rafaël Carré
24aeac2a75 disk/file: Do not use & on arrays
it might be valid C but is confusing, and not consistent with the rest of file.c

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26191 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 12:59:12 +00:00
Thomas Martitz
0a1d7c28b7 Make open() posix compliant api-wise. A few calls (those with O_CREAT) need the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:13 +00:00
Thomas Martitz
c61e89c0ed Make creat() posix compliant API-wise. Shouldn't affect the core as it's wrapped via a static inline.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:04 +00:00
Amaury Pouly
839007872a FS#9409: fix rename which didn't close file handles on error and enventually cause cut/paste to fail between volumes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24134 a1c6a512-1295-4272-9138-f99709370657
2010-01-01 20:41:29 +00:00
Frank Gevaerts
5509372f03 Make read() and write() return -1/EISDIR on directories
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24106 a1c6a512-1295-4272-9138-f99709370657
2009-12-23 22:13:37 +00:00
Frank Gevaerts
e0263b166c only get the file pointer if fd is actually valid.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24105 a1c6a512-1295-4272-9138-f99709370657
2009-12-23 21:51:29 +00:00
Maurus Cuelenaere
d7d3bc248f Move strip_volume() to filefuncs.c and set properties.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23767 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 22:34:08 +00:00
Maurus Cuelenaere
eab70ca28c - Split off strip_volume() to a separate file
- fix some yellows

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23762 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 17:39:30 +00:00
Maurus Cuelenaere
d052ced874 Merge branch 'hotswap'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23759 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 16:57:30 +00:00
Nils Wallménius
3d4701a6e4 FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2009-07-14 13:57:45 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Nicolas Pennequin
357ffb3c46 Convert the whole codebase to UTF-8, except docs/COMMITTERS and tools/creative.c, which need checking.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17369 a1c6a512-1295-4272-9138-f99709370657
2008-05-05 10:32:46 +00:00
Miika Pekkarinen
d80246fac0 Committed the missing file to r16632.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16634 a1c6a512-1295-4272-9138-f99709370657
2008-03-11 19:52:07 +00:00
Peter D'Hoye
c04f497670 Let the FAT namecheck also look for trailing spaces, fixes FS #8560.
Only call the dircache rename function if the actual rename was ok.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16241 a1c6a512-1295-4272-9138-f99709370657
2008-02-07 22:15:13 +00:00
Peter D'Hoye
eb947cdde1 Another fix for file system issues when encountering disk full (like when recording)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15920 a1c6a512-1295-4272-9138-f99709370657
2007-12-13 23:36:22 +00:00
Peter D'Hoye
bae8f4c316 More code police...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15353 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 00:04:35 +00:00
Peter D'Hoye
85058f5d9c Fix FS #5852 by trying to properly close and update the recorded file, and give the FAT the correct file info. Add filehandle checks to some file functions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15072 a1c6a512-1295-4272-9138-f99709370657
2007-10-10 23:26:17 +00:00
Jonathan Gordon
e73f287b5a Fix FS#7679 - modifying files with dircahce enabled doesnt change the access time/date in dircache
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14580 a1c6a512-1295-4272-9138-f99709370657
2007-09-02 13:24:51 +00:00
Kevin Ferrare
011a325e32 Makes apps and plugins interract with directories using a posix-like api instead of calling dircache / simulator functions (no additionnal layer added, only a cosmetic change)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13943 a1c6a512-1295-4272-9138-f99709370657
2007-07-20 17:06:55 +00:00
Daniel Stenberg
5079812031 avoid declaring shadow 'rc' variables (-Wshadow!)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13270 a1c6a512-1295-4272-9138-f99709370657
2007-04-26 10:29:41 +00:00
Jens Arnold
67eb154146 Removed 'mode' parameter from creat(). It wasn't pure posix anyway, it was ignored on target and mixed into 'oflags' in the simulator. * Simplified io.c a bit by defining a dummy O_BINARY for OSes which don't have that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12179 a1c6a512-1295-4272-9138-f99709370657
2007-02-01 23:08:15 +00:00
Jens Arnold
ef3e129b65 Much simpler implementation of large virtual sector support, not needing larger sector buffers and not touching file.c at all. secmult is simply used to normalize all sector counts to 512-byte physical sectors. * Moved MAX_SECTOR_SIZE definition to config-*.h, and enabled it for iPod Video only. MAX_SECTOR_SIZE now only enables checking for alternate disk layouts due to sector size (as iPod Video G5.5 is presented as having 2048-byte _physical_ sectors to the PC). Large virtual sector support in fat.c is always enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11659 a1c6a512-1295-4272-9138-f99709370657
2006-12-04 21:37:22 +00:00
Miika Pekkarinen
ae66c2b9ee Add support (runtime detection) for 2048 bytes/sector filesystem.
Large sectors are enabled for iPod Video (including 5.5G) only. Might
still cause FS corruption (however, unlikely), so beware! Based on
FS#6169 by Robert Carboneau.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11651 a1c6a512-1295-4272-9138-f99709370657
2006-12-03 18:12:19 +00:00
Hardeep Sidhu
2436dbabe7 Update dircache startcluster at file close when writing. Fixes bug when creating small files (dircache startcluster remains 0 because fat write doesn't occur until close).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9950 a1c6a512-1295-4272-9138-f99709370657
2006-05-16 06:53:41 +00:00
Miika Pekkarinen
d489377d46 Fixed the file renaming/removing issue with dircache enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9649 a1c6a512-1295-4272-9138-f99709370657
2006-04-13 21:14:13 +00:00
Miika Pekkarinen
82f32e3f73 Do the dircache operation first to block properly when necessary.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9356 a1c6a512-1295-4272-9138-f99709370657
2006-03-30 10:20:44 +00:00
Miika Pekkarinen
2d93495df2 Boost open() performance on platforms with dircache. Tagcache initial
scanning now over 50% faster than before.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9306 a1c6a512-1295-4272-9138-f99709370657
2006-03-28 11:51:12 +00:00
Jens Arnold
7a0110eedd TAB policed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8887 a1c6a512-1295-4272-9138-f99709370657
2006-03-02 22:29:53 +00:00
Dan Everton
ccd0e7451d Change rename() to set errno to EXDEV if a rename is attempted across volumes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8883 a1c6a512-1295-4272-9138-f99709370657
2006-03-02 11:03:34 +00:00
Jens Arnold
a601fb8d19 More compact & straight-forward headbytes handling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8255 a1c6a512-1295-4272-9138-f99709370657
2005-12-17 12:17:11 +00:00
Miika Pekkarinen
a6a0c4b2d5 Now the file corruption bug when reading & writing the same file is
hopefully fully fixed.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8251 a1c6a512-1295-4272-9138-f99709370657
2005-12-16 20:44:41 +00:00
Miika Pekkarinen
d9dcb0fbcf Fixed a file system driver caching bug corrupting files on certain situations
(when reading and writing the same file).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8231 a1c6a512-1295-4272-9138-f99709370657
2005-12-13 16:11:00 +00:00
Miika Pekkarinen
ab78b04680 Implemented directory caching. No more waiting for disk to spin up while
browsing when cache is enabled (system -> disk -> enable directory
cache). Cache building on boot is transparent except the first boot.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7588 a1c6a512-1295-4272-9138-f99709370657
2005-10-07 17:38:05 +00:00
Jörg Hohensohn
dc7534bdb2 preparations for hotswapping MMC
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5701 a1c6a512-1295-4272-9138-f99709370657
2005-01-28 21:32:16 +00:00
Jean-Philippe Bernardy
cea551dd9c int -> long where needed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5643 a1c6a512-1295-4272-9138-f99709370657
2005-01-23 23:29:35 +00:00
Jörg Hohensohn
da84857631 prepared to mount multiple partitions into one logical file system (most useful for Ondio, internal memory + external MMC)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5514 a1c6a512-1295-4272-9138-f99709370657
2004-12-28 22:16:07 +00:00
Jens Arnold
f78524bf93 Bug fix: Do only flush the sector buffer after writing head bytes if it really needs to be. The old code did flush always, causing the huge slowdown of fprintf() and other places writing byte-wise
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5413 a1c6a512-1295-4272-9138-f99709370657
2004-11-17 02:34:17 +00:00
Jörg Hohensohn
85c91a3b8e void* can't be offset, gcc should not allows this
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5147 a1c6a512-1295-4272-9138-f99709370657
2004-10-01 19:45:51 +00:00
Jens Arnold
8537e2d12a Bug fix: open() now handles O_TRUNC correctly (this was the real cause for the .playlist_control corruption)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5048 a1c6a512-1295-4272-9138-f99709370657
2004-09-06 23:33:21 +00:00
Linus Nielsen Feltzing
e0e0140f4e Bug fix: renaming a directory could cause a name clash. New feature: rename() can now move files/directories as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5008 a1c6a512-1295-4272-9138-f99709370657
2004-08-22 11:28:24 +00:00
Jens Arnold
f68e13c5b4 The pathname argument for open() is declared const, so copy it has to be copied
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4894 a1c6a512-1295-4272-9138-f99709370657
2004-07-19 21:08:44 +00:00
Linus Nielsen Feltzing
b8beff39e9 No need to call fat_truncate() to delete the file, fat_remove() frees all clusters anyway
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4508 a1c6a512-1295-4272-9138-f99709370657
2004-04-16 08:54:13 +00:00