MCPcopy Create free account
hub / github.com/cvmfs/cvmfs / OpenFd

Method OpenFd

cvmfs/fd_table.h:76–88  ·  view source on GitHub ↗

* Registers fd with a currently unused number. If the table is full, * returns -ENFILE; */

Source from the content-addressed store, hash-verified

74 * returns -ENFILE;
75 */
76 int OpenFd(const HandleT &handle) {
77 if (handle == invalid_handle_)
78 return -EINVAL;
79 if (fd_pivot_ >= fd_index_.size())
80 return -ENFILE;
81
82 size_t const next_fd = fd_index_[fd_pivot_];
83 assert(next_fd < open_fds_.size());
84 assert(open_fds_[next_fd].handle == invalid_handle_);
85 open_fds_[next_fd] = FdWrapper(handle, fd_pivot_);
86 ++fd_pivot_;
87 return next_fd;
88 }
89
90 /**
91 * For invalid and unused numbers, the invalid handle is returned.

Callers 10

DoOpenMethod · 0.80
DoRestoreStateMethod · 0.80
OpenFromTxnMethod · 0.80
OpenMethod · 0.80
PlantFdMethod · 0.80
DupMethod · 0.80
OpenFromTxnMethod · 0.80
DoRestoreStateMethod · 0.80
AddFdMethod · 0.80
TEST_FFunction · 0.80

Calls 2

FdWrapperClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected