fs/smb/server/stats.h

Source file repositories/reference/linux-study-clean/fs/smb/server/stats.h

File Facts

System
Linux kernel
Corpus path
fs/smb/server/stats.h
Extension
.h
Size
1884 bytes
Lines
74
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

struct ksmbd_counters {
	struct percpu_counter	counters[KSMBD_COUNTER_MAX];
};

static inline void ksmbd_counter_inc(int type)
{
	percpu_counter_inc(&ksmbd_counters.counters[type]);
}

static inline void ksmbd_counter_dec(int type)
{
	percpu_counter_dec(&ksmbd_counters.counters[type]);
}

static inline void ksmbd_counter_add(int type, s64 value)
{
	percpu_counter_add(&ksmbd_counters.counters[type], value);
}

static inline void ksmbd_counter_sub(int type, s64 value)
{
	percpu_counter_sub(&ksmbd_counters.counters[type], value);
}

static inline void ksmbd_counter_inc_reqs(unsigned int cmd)
{
	if (cmd < KSMBD_COUNTER_MAX_REQS)
		percpu_counter_inc(&ksmbd_counters.counters[KSMBD_COUNTER_FIRST_REQ + cmd]);
}

static inline s64 ksmbd_counter_sum(int type)
{
	return percpu_counter_sum_positive(&ksmbd_counters.counters[type]);
}
#else

static inline void ksmbd_counter_inc(int type) {}
static inline void ksmbd_counter_dec(int type) {}
static inline void ksmbd_counter_add(int type, s64 value) {}
static inline void ksmbd_counter_sub(int type, s64 value) {}
static inline void ksmbd_counter_inc_reqs(unsigned int cmd) {}
static inline s64 ksmbd_counter_sum(int type) { return 0; }
#endif

#endif

Annotation

Implementation Notes