File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2140,6 +2140,18 @@ static ssize_t btrfs_devinfo_error_stats_show(struct kobject *kobj,
21402140}
21412141BTRFS_ATTR (devid , error_stats , btrfs_devinfo_error_stats_show );
21422142
2143+ #ifdef CONFIG_BTRFS_ALLOCATOR_HINTS
2144+ static ssize_t btrfs_devinfo_type_show (struct kobject * kobj ,
2145+ struct kobj_attribute * a , char * buf )
2146+ {
2147+ struct btrfs_device * device = container_of (kobj , struct btrfs_device ,
2148+ devid_kobj );
2149+
2150+ return scnprintf (buf , PAGE_SIZE , "0x%08llx\n" , device -> type );
2151+ }
2152+ BTRFS_ATTR (devid , type , btrfs_devinfo_type_show );
2153+ #endif
2154+
21432155/*
21442156 * Information about one device.
21452157 *
@@ -2153,6 +2165,9 @@ static struct attribute *devid_attrs[] = {
21532165 BTRFS_ATTR_PTR (devid , replace_target ),
21542166 BTRFS_ATTR_PTR (devid , scrub_speed_max ),
21552167 BTRFS_ATTR_PTR (devid , writeable ),
2168+ #ifdef CONFIG_BTRFS_ALLOCATOR_HINTS
2169+ BTRFS_ATTR_PTR (devid , type ),
2170+ #endif
21562171 NULL
21572172};
21582173ATTRIBUTE_GROUPS (devid );
You can’t perform that action at this time.
0 commit comments