diff options
author | Mike Lockwood <lockwood@android.com> | 2011-04-21 17:05:55 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2011-04-22 07:11:20 -0700 |
commit | 7d77dcfadd7fb637ed2c3aef5bb3990dd0a67dc0 (patch) | |
tree | ca352d0fe548618385cef862a764ad33c4d0c1db /media/mtp/mtp.h | |
parent | 88a90ab588f11d1ffaf08e178232359c6d8d03eb (diff) | |
download | frameworks_av-7d77dcfadd7fb637ed2c3aef5bb3990dd0a67dc0.zip frameworks_av-7d77dcfadd7fb637ed2c3aef5bb3990dd0a67dc0.tar.gz frameworks_av-7d77dcfadd7fb637ed2c3aef5bb3990dd0a67dc0.tar.bz2 |
MTP: Add extended operations to support in-place editing of files
MTP does not support partial writes of files (the entire file must be transferred at once).
This makes it impossible to implement a FUSE file system for MTP
with acceptable performance.
To fix this problem, this change adds extended MTP operations to allow
partial writes to files:
SendPartialObject - allows writing a subset of a file, or appending to the end of a file
TruncateObject - allows changing the size of a file
BeginEditObject - must be called before using SendPartialObject and TruncateObject
EndEditObject - commits changes to a file after it has been edited with SendPartialObject or TruncateObject
We also add GetPartialObject64, which is the same as GetPartialObject
but has a 64 bit offset rather than 32.
Change-Id: I4b110748b97ae05cdc8aab02ecdbbbeb263f7840
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp/mtp.h')
-rw-r--r-- | media/mtp/mtp.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/media/mtp/mtp.h b/media/mtp/mtp.h index 8bc2e22..d270df5 100644 --- a/media/mtp/mtp.h +++ b/media/mtp/mtp.h @@ -391,6 +391,19 @@ #define MTP_OPERATION_SET_OBJECT_REFERENCES 0x9811 #define MTP_OPERATION_SKIP 0x9820 +// Android extensions for direct file IO + +// Same as GetPartialObject, but with 64 bit offset +#define MTP_OPERATION_GET_PARTIAL_OBJECT_64 0x95C1 +// Same as GetPartialObject64, but copying host to device +#define MTP_OPERATION_SEND_PARTIAL_OBJECT 0x95C2 +// Truncates file to 64 bit length +#define MTP_OPERATION_TRUNCATE_OBJECT 0x95C3 +// Must be called before using SendPartialObject and TruncateObject +#define MTP_OPERATION_BEGIN_EDIT_OBJECT 0x95C4 +// Called to commit changes made by SendPartialObject and TruncateObject +#define MTP_OPERATION_END_EDIT_OBJECT 0x95C5 + // MTP Response Codes #define MTP_RESPONSE_UNDEFINED 0x2000 #define MTP_RESPONSE_OK 0x2001 |