RFR: 8229872: (fs) Increase buffer size used with getmntent

Alan Bateman Alan.Bateman at oracle.com
Wed Aug 21 05:39:58 UTC 2019


On 20/08/2019 20:31, Vladimir Kempik wrote:
> Hello
>
> after reading manpage for getline I think I have found some elegant solution - to let getline manage size of buffer.
>
> Please review v2 of patch here http://cr.openjdk.java.net/~vkempik/8229872/webrev.02/
>
> I’m still worried about syncing maxlinelen and linebuffer between Java_sun_nio_fs_LinuxNativeDispatcher_setmntent0 and Java_sun_nio_fs_LinuxNativeDispatcher_getmntent, if they are run from different threads.
>
Finding the longest line to size the buffer seems a good approach to 
try. The way to do that is to add a getline and rewind to 
UnixNativeDispatcher and augment LinuxNativeDispatcher.getmntent to take 
a buffer size. Once you have those primitives then you can use them in 
LinuxFileStore.getMountEntries.

-Alan


More information about the nio-dev mailing list