struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker,
const char *path, int flags, mode_t *mode)
{
struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker,
const char *path, int flags, mode_t *mode)
{
if (tracker->count.suspendable.active > 0) {
ret = fd_tracker_suspend_handles(tracker, 1);
if (ret) {
if (tracker->count.suspendable.active > 0) {
ret = fd_tracker_suspend_handles(tracker, 1);
if (ret) {
*/
WARN("Cannot open file system handle, too many unsuspendable file descriptors are opened (%u)",
tracker->count.unsuspendable);
*/
WARN("Cannot open file system handle, too many unsuspendable file descriptors are opened (%u)",
tracker->count.unsuspendable);
ret = pthread_mutex_init(&handle->lock, NULL);
if (ret) {
PERROR("Failed to initialize handle mutex while creating fs handle");
ret = pthread_mutex_init(&handle->lock, NULL);
if (ret) {
PERROR("Failed to initialize handle mutex while creating fs handle");
}
if (fstat(handle->fd, &fd_stat)) {
PERROR("Failed to retrieve file descriptor inode while creating fs handle, fstat() returned");
}
if (fstat(handle->fd, &fd_stat)) {
PERROR("Failed to retrieve file descriptor inode while creating fs handle, fstat() returned");
}
handle->ino = fd_stat.st_ino;
fd_tracker_track(tracker, handle);
}
handle->ino = fd_stat.st_ino;
fd_tracker_track(tracker, handle);