fs/fuse/req_timeout.c

Source file repositories/reference/linux-study-clean/fs/fuse/req_timeout.c

File Facts

System
Linux kernel
Corpus path
fs/fuse/req_timeout.c
Extension
.c
Size
3964 bytes
Lines
149
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

fuse_fpq_processing_expired(fch, fpq->processing)) {
			spin_unlock(&fpq->lock);
			spin_unlock(&fch->lock);
			goto chan_abort;
		}

		spin_unlock(&fpq->lock);
	}
	spin_unlock(&fch->lock);

	if (fuse_uring_request_expired(fch))
		goto chan_abort;

out:
	queue_delayed_work(system_percpu_wq, &fch->timeout.work,
			   fuse_timeout_timer_freq);
	return;

chan_abort:
	fuse_chan_abort(fch, false);
}

static void set_request_timeout(struct fuse_chan *fch, unsigned int timeout)
{
	fch->timeout.req_timeout = secs_to_jiffies(timeout);
	INIT_DELAYED_WORK(&fch->timeout.work, fuse_check_timeout);
	queue_delayed_work(system_percpu_wq, &fch->timeout.work,
			   fuse_timeout_timer_freq);
}

void fuse_init_server_timeout(struct fuse_chan *fch, unsigned int timeout)
{
	if (!timeout && !fuse_max_req_timeout && !fuse_default_req_timeout)
		return;

	if (!timeout)
		timeout = fuse_default_req_timeout;

	if (fuse_max_req_timeout) {
		if (timeout)
			timeout = min(fuse_max_req_timeout, timeout);
		else
			timeout = fuse_max_req_timeout;
	}

	timeout = max(FUSE_TIMEOUT_TIMER_FREQ, timeout);

	set_request_timeout(fch, timeout);
}

Annotation

Implementation Notes