New fd assign method
GekkoFS client could use another method of fd assignations using kernel fds.
- Idea:
- When a new fd is needed get from opening a real file (i.e., /dev/null)
- Remove the fd_protecting code
- Details:
- It could be done with an environment variable, so we can select the implementation
- Test should be redo, as some of them expects 10000 fd result (we should avoid this check as it is implementation dependent)
- We should identify or create tests that doesn't work with one or the other method.
Some testing have been done in branch https://storage.bsc.es/gitlab/hpc/gekkofs/-/tree/rnou/fd_prop1
OpenFileMap::safe_generate_fd_idx_()
if (CTX->protect_fds()) {
fd = generate_fd_idx();
}
else {
fd = syscall_no_intercept(
SYS_open, "/dev/null",
O_RDWR, S_IRUSR | S_IWUSR);
}