cjd / mtpfs

Filesystem to mount MTP devices directly
GNU General Public License v3.0
62 stars 16 forks source link

Use storageid to access storageArea #9

Closed wking closed 8 years ago

wking commented 9 years ago

i is indexing playlist->tracks here, and we don't want to look in a sequential storage areas for each track.

I've also added a null-folder check. I'm not sure if -ENOENT is the right code for “we can't find the parent directory in the storage area that contains the child”, but it's the only non-success code that mtpfs_getattr_real returned before this commit. And returning anything is probably better than segfaulting when we try and dereference folder with folder->parent_id.

This PR is based on #5, but I can rebase it onto master if the reformatting in #5 isn't wanted.