Quantcast

Tell if a fuse write call is for writing the last chunk

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Tell if a fuse write call is for writing the last chunk

Yue Li
When writing a large file, the write function gets call multiple times
to write each chunks. I'm wondering is there any way to tell if a call
to the write is for writing the last piece of the chunks?

Best,

Yue


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tell if a fuse write call is for writing the last chunk

Michael Theall-2

Hi Yue,

No, there's no way to know. The best you can rely on is when the user's application uses fsync(2). My filesystem buffers writes until the buffer size is reached or 0.1s have elapsed since the last write callback. Then I flush to the backing filesystem.

Regards,
Michael Theall


On Sat, Feb 4, 2017, 21:47 Yue Li <[hidden email]> wrote:
When writing a large file, the write function gets call multiple times
to write each chunks. I'm wondering is there any way to tell if a call
to the write is for writing the last piece of the chunks?

Best,

Yue


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tell if a fuse write call is for writing the last chunk

Yue Li


On Feb 4, 2017, at 8:05 PM, Michael Theall <[hidden email]> wrote:

Hi Yue,

No, there's no way to know. The best you can rely on is when the user's application uses fsync(2). My filesystem buffers writes until the buffer size is reached or 0.1s have elapsed since the last write callback. Then I flush to the backing filesystem.

I see. This makes sense, I will use this approach, thanks Michael!

Best,

Yue

Regards,
Michael Theall


On Sat, Feb 4, 2017, 21:47 Yue Li <[hidden email]> wrote:
When writing a large file, the write function gets call multiple times
to write each chunks. I'm wondering is there any way to tell if a call
to the write is for writing the last piece of the chunks?

Best,

Yue


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
Loading...