drivers/md/bcache/sysfs.h

Source file repositories/reference/linux-study-clean/drivers/md/bcache/sysfs.h

File Facts

System
Linux kernel
Corpus path
drivers/md/bcache/sysfs.h
Extension
.h
Size
3853 bytes
Lines
143
Domain
Driver Families
Bucket
drivers/md
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!ret) {						\
			var = v;					\
			return size;					\
		}							\
		return ret;						\
	}								\
} while (0)

#define strtoul_or_return(cp)						\
({									\
	unsigned long _v;						\
	int _r = kstrtoul(cp, 10, &_v);					\
	if (_r)								\
		return _r;						\
	_v;								\
})

#define strtoi_h_or_return(cp, v)					\
do {									\
	int _r = strtoi_h(cp, &v);					\
	if (_r)								\
		return _r;						\
} while (0)

#define sysfs_hatoi(file, var)						\
do {									\
	if (attr == &sysfs_ ## file)					\
		return strtoi_h(buf, &var) ?: (ssize_t) size;		\
} while (0)

#endif  /* _BCACHE_SYSFS_H_ */

Annotation

Implementation Notes