On Dec 30, 3:01 pm, Fab <[email protected]> wrote: > All, > First of all, I apologize if this topic has been discussed already, > but I did my best to try to find references to similar issues, with no > luck.
It has been discussed recently. http://groups.google.com/group/macfuse/browse_thread/thread/55ddc7978ac65cab/ > > The problem: I have a test application that behaves differently when I > run it on my Mac vs. Linux. The test application simply open a file > with attributes O_WRONLY | O_CREAT, then write a string "Hello World', > then call again another write() this time with "Merry Christmas", then > finally close the file. > > On Mac I see two callbacks to write (correct here...): the first one > for a buffer containing "Hello World\0", the second time, for a buffer > containing "Hello World\0Merry Christmas\0" (this doesn't seem to be > right...). So you aren't really talking about the test application, but the user- space file system, which sees different write callbacks on Linux and Mac OS X, right? > When I run the same test on Linux the write() calls are correct: the > first one for the buffer "Hello World\0", the second one for the > buffer "Merry Christmas\0". > > Is this something related to OSX? Why isn't working on Mac? > Any idea? Read my replies to the thread I referenced above. It is working on the Mac, unless the file system client (your test application that issues the write calls) sees things differently. How the operating system/ file system slices up the I/O and how it schedules it are implementation details of the platform. Now, the write callbacks that you are talking about, they aren't in _direct_ response to a write() system call. The write system call in the kernel eventually leads to the cluster layer (again, see the aforementioned thread), which will call the file system's "strategy" routine. The user-space file system doesn't know (nor needs to know) about strategy routines and such, so it will see a simplified write callback. This shouldn't lead you to believe though that every write() system call will be passed as is to the user-space file system. Please realize/remember that MacFUSE != Linux FUSE and Mac OS X != Linux. This isn't just a pedantic aside. MacFUSE does offer you the FUSE API on the Mac, but the kernel file system's implementation has nothing to do with Linux's. OS X's VFS is also extremely different from Linux's. The FUSE API portion of MacFUSE wants to make sure that you can write file systems with _similar_ functionality on Mac OS X and Linux. However, it doesn't mean you'll see the exact same invocations of the API callbacks, etc. Amit --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MacFUSE" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/macfuse?hl=en -~----------~----~----~----~------~----~------~--~---
