What do you mean by user input?
On Thu, 11 Aug 2011 11:36:55 +0200, B.Vinai Kumar <vinaibangala2001@xxxxxxxxx> wrote:
To know the completion, user has to send 'Eject' command for this mass storage device.
Well... a lot depends on what you are trying to accomplish and what's your use case. If you want user to be able to plug your device to any computer, copy a file and get this file processed then that's not easily achievable. If you want to use specialised client program on the host side, you can always send the eject command. Also note, that if processing file means changing it, you CANNOT do it until host unmounts the file system (which again, you can say for sure that happened only after host disconnects or sends eject command).
Can we know from which LBA offset the data will get stored on a disk? How is this calculated?
Like Sergei wrote, this is dependent on file system. What's more, there is likely not a single LBA offset since the file can be saved in chunks on different parts of the medium (if you guarantee that each time the file system is clean this may become unlikely but it is a possibility). To do what you want, you'd have to actually implement code that can read the file system and update on-the-fly stored state while blocks on medium are modified. This would let you figure out when writing a file has ended, but as you might have guessed, it's probably not an easy task.
is there any thing through which we can differentiate between control data(meta data) and actual data(which we are interested) by seeing the SCSI command?
What do you mean by control data? Parsing SCSI commands gets you SCSI commands and “control data” and the actual data, and that's what file storage gadget and mass storage gadget both do (they need to understand SCSI commands to work). -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michal "mina86" Nazarewicz (o o) ooo +-----<email/xmpp: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo-- -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html