(trying again with most of the history removed -- it hit a mailing list size limit)
The same code that calculates the maximum file size runs on all file systems -- local or not -- as soon as a file system is seen. My theory is the same as it was before: > On Apr 3, 2017, at 10:30 AM, Jim Luther <luthe...@apple.com > <mailto:luthe...@apple.com>> wrote: > > Once a file system is mounted, the kernel sends out a VQ_MOUNT kernel event > and that's what causes the kNotifyVFSMount BSD notification to be sent. At > that time, file systems must be ready to respond to requests correctly. If > they don't, they have a bug. You could test my theory by writing a program that: • listens for kNotifyVFSMount BSD notifications (see man 3 notify and the notify.h and notify_keys.h headers) • when it gets the kNotifyVFSMount notification, call getmntinfo(3) to get the array of statfs structures for each currently mounted file system. • finds your file system in the array and pass its path (f_mntonname) to the getMaxFileSize() function and see what it does. If the statfs struct from getmntinfo() for your file system doesn't look correct, check to make sure your file system's data for the vfs_statfs callback is initialized before your file system's vfs_mount callback returns. One way to do that is to have your file system's vfs_mount code call your file system's vfs_statfs callback (that's the approach I took in the WebDAV file system long ago when I wrote it). If getattrlist() fails or returns the wrong value, check the code for your file system's vfs_getattr callback to make sure it is prepared to handle requests before your file system's vfs_mount callback returns. Look at where the vfs_getattr callback handles f_capabilities. Also, you can add _PC_FILESIZEBITS support to your file system's vnop_pathconf callback so that pathconf() with _PC_FILESIZEBITS will return a more exact value. VOL_CAP_FMT_2TB_FILESIZE is the "big dumb hammer" fallback if we cannot get a value from pathconf(). - Jim > On Apr 12, 2017, at 1:27 PM, Scott Talbert <s...@techie.net > <mailto:s...@techie.net>> wrote: > > OK, we have found something interesting. When we mount our filesystem with > the MNT_LOCAL flag, the NSURLVolumeMaximumFileSizeKey starts reporting > correctly. > > Do you have any thoughts on why it works only with MNT_LOCAL? Using > MNT_LOCAL might be a workaround for us, but I'm not sure of the implications > of doing so as our filesystem is actually remote. How do AFP, NFS, SMB, etc. > do it, as they don't have the local flag set? > > Scott
_______________________________________________ Do not post admin requests to the list. They will be ignored. Filesystem-dev mailing list (Filesystem-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/filesystem-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com