If you want to reduce the syscall count, then calling statfs() for each file is 
not strictly necessary.  If you are calling the ioctl(LL_IOC_LOV_SETSTRIPE) 
then this is virtually guaranteed to fail on anything but Lustre (both because 
the ioctl number isn't assigned to anything else in the kernel, and because the 
data passed should be validated by anything else using the ioctl).

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel High Performance Data Division

On 2016/05/04, 13:09, "John Bauer" 
<[email protected]<mailto:[email protected]>> wrote:


Andreas,

Thanks again for the reply.  I will have a look at this and see if I can fit it 
into my library.  Having a look at the code for llapi_file_open at 
review.whamcloud.com it seems the most important error to check is that the 
file is on a Lustre file system.  I will make the check by calling statfs ( 
after the file is opened/created ) and checking 
fsinfo.f_type==LUSTRE_SUPER_MAGIC.

John

On 5/3/2016 2:43 PM, Dilger, Andreas wrote:

You can open files with O_LOV_DELAY_CREATE to delay layout assignment, and then 
use ioctl(fd, LL_IOC_LOV_SETSTRIPE, lum) to specify the striping afterward, but 
this misses a lot of the error checking and other layout handling in 
llapi_file_open() and friends.

We haven't had a request for llapi_fd_set_stripe() and/or llapi_layout_fd_set() 
or similar, but I can see that this would be useful.  Could you please file an 
improvement request for this in Jira.

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel High Performance Data Division

On 2016/05/03, 06:23, "John Bauer" 
<[email protected]<mailto:[email protected]><mailto:[email protected]><mailto:[email protected]>>
 wrote:


Has any there been any discussion as to allowing a user to modify the striping 
of a file until the first extent is made?  There are a lot of opens that can 
not be easily replaced with llapi_file_open(), such as openat() family, 
mkstemp() family, and fopen() family.

It seems that it should be feasible to change the file's striping even after 
the file is created but not written to.

It would be really handy to have a function llapi_fd_set_stripe( int fd, ... ) 
to set the striping for a file that has been opened but not written to.  I have 
gotten past my immediate need for setting the striping of a file opened with 
fopen64() by doing the llapi_file_open() and then using the resulting fd in 
fdopen().  But this approach is not applicable to all listed above.


Thanks, John

--
I/O Doctors, LLC
507-766-0378
[email protected]<mailto:[email protected]><mailto:[email protected]><mailto:[email protected]>


--
I/O Doctors, LLC
507-766-0378
[email protected]<mailto:[email protected]>
_______________________________________________
lustre-discuss mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org

Reply via email to