fs/nilfs2/sysfs.h

Source file repositories/reference/linux-study-clean/fs/nilfs2/sysfs.h

File Facts

System
Linux kernel
Corpus path
fs/nilfs2/sysfs.h
Extension
.h
Size
5326 bytes
Lines
168
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 nilfs_sysfs_dev_subgroups {
	/* /sys/fs/<nilfs>/<device>/superblock */
	struct kobject sg_superblock_kobj;
	struct completion sg_superblock_kobj_unregister;

	/* /sys/fs/<nilfs>/<device>/segctor */
	struct kobject sg_segctor_kobj;
	struct completion sg_segctor_kobj_unregister;

	/* /sys/fs/<nilfs>/<device>/mounted_snapshots */
	struct kobject sg_mounted_snapshots_kobj;
	struct completion sg_mounted_snapshots_kobj_unregister;

	/* /sys/fs/<nilfs>/<device>/checkpoints */
	struct kobject sg_checkpoints_kobj;
	struct completion sg_checkpoints_kobj_unregister;

	/* /sys/fs/<nilfs>/<device>/segments */
	struct kobject sg_segments_kobj;
	struct completion sg_segments_kobj_unregister;
};

#define NILFS_KOBJ_ATTR_STRUCT(name) \
struct nilfs_##name##_attr { \
	struct attribute attr; \
	ssize_t (*show)(struct kobject *, struct kobj_attribute *, \
			char *); \
	ssize_t (*store)(struct kobject *, struct kobj_attribute *, \
			 const char *, size_t); \
}

NILFS_KOBJ_ATTR_STRUCT(feature);

#define NILFS_DEV_ATTR_STRUCT(name) \
struct nilfs_##name##_attr { \
	struct attribute attr; \
	ssize_t (*show)(struct nilfs_##name##_attr *, struct the_nilfs *, \
			char *); \
	ssize_t (*store)(struct nilfs_##name##_attr *, struct the_nilfs *, \
			 const char *, size_t); \
}

NILFS_DEV_ATTR_STRUCT(dev);
NILFS_DEV_ATTR_STRUCT(segments);
NILFS_DEV_ATTR_STRUCT(mounted_snapshots);
NILFS_DEV_ATTR_STRUCT(checkpoints);
NILFS_DEV_ATTR_STRUCT(superblock);
NILFS_DEV_ATTR_STRUCT(segctor);

#define NILFS_CP_ATTR_STRUCT(name) \
struct nilfs_##name##_attr { \
	struct attribute attr; \
	ssize_t (*show)(struct nilfs_##name##_attr *, struct nilfs_root *, \
			char *); \
	ssize_t (*store)(struct nilfs_##name##_attr *, struct nilfs_root *, \
			 const char *, size_t); \
}

NILFS_CP_ATTR_STRUCT(snapshot);

#define NILFS_ATTR(type, name, mode, show, store) \
	static struct nilfs_##type##_attr nilfs_##type##_attr_##name = \
		__ATTR(name, mode, show, store)

#define NILFS_INFO_ATTR(type, name) \
	NILFS_ATTR(type, name, 0444, NULL, NULL)
#define NILFS_RO_ATTR(type, name) \
	NILFS_ATTR(type, name, 0444, nilfs_##type##_##name##_show, NULL)
#define NILFS_RW_ATTR(type, name) \
	NILFS_ATTR(type, name, 0644, \
		    nilfs_##type##_##name##_show, \
		    nilfs_##type##_##name##_store)

#define NILFS_FEATURE_INFO_ATTR(name) \
	NILFS_INFO_ATTR(feature, name)
#define NILFS_FEATURE_RO_ATTR(name) \
	NILFS_RO_ATTR(feature, name)
#define NILFS_FEATURE_RW_ATTR(name) \
	NILFS_RW_ATTR(feature, name)

#define NILFS_DEV_INFO_ATTR(name) \
	NILFS_INFO_ATTR(dev, name)
#define NILFS_DEV_RO_ATTR(name) \
	NILFS_RO_ATTR(dev, name)
#define NILFS_DEV_RW_ATTR(name) \
	NILFS_RW_ATTR(dev, name)

#define NILFS_SEGMENTS_RO_ATTR(name) \
	NILFS_RO_ATTR(segments, name)
#define NILFS_SEGMENTS_RW_ATTR(name) \

Annotation

Implementation Notes