An example is easy to understand so is below.
 Output is in Python config reader module format,
 just import of this output within a python script is enough.

 Useful for
   troubleshoot/debug,
   storage based on btrfs to render info on their bui/gui and
   further btrfs-progs could be very sleek if uses this.

[fsid: 763c600a-7af6-4b8a-a421-6611de307dbf]
        seed_fsid:              e962e198-ef98-4782-ae99-d0128c9f5c37
        fs_devs_addr:           ffff880046fb4400
        num_devices:            1
        open_devices:           1
        rw_devices:             1
        missing_devices:        0
        total_rw_devices:       1633799168
        total_devices:          3
        opened:                 1
        seeding:                0
        rotating:               1
        super_kobj_state:       1
        super_kobj_insysfs:     1
        device_kobj_state:      1
        device_kobj_insysfs:    1
        [[uuid: 762f7b41-419e-438a-8a58-8a90f6642c18]]
                dev_addr:       ffff880046990000
                device:         /dev/sdg
                devid:          3
                dev_root_fsid:  763c600a-7af6-4b8a-a421-6611de307dbf
                generation:     37
                total_bytes:    1633799168
                dev_totalbytes: 1633799168
                bytes_used:     234881024
                type:           0
                io_align:       4096
                io_width:       4096
                sector_size:    4096
                mode:           0x83
                writeable:      1
                in_fs_metadata: 1
                missing:        0
                can_discard:    0
                replace_tgtdev: 0
                active_pending: 0
                nobarriers:     0
                devstats_valid: 1
                bdev:           not_null
        [[seed_fsid: e962e198-ef98-4782-ae99-d0128c9f5c37]]
                sprout_fsid:            763c600a-7af6-4b8a-a421-6611de307dbf
                seed_fsid:              1c52f894-0ead-43d6-847a-d42359f78370
                fs_devs_addr:           ffff88004586a400
                num_devices:            1
                open_devices:           1
                rw_devices:             0
                missing_devices:        0
                total_rw_devices:       0
                total_devices:          2
                opened:                 1
                seeding:                1
                rotating:               1
                super_kobj_state:       1
                super_kobj_insysfs:     1
                device_kobj_state:      1
                device_kobj_insysfs:    1
                [[uuid: d064a43c-e9ce-42fb-9c01-140d2bdcd528]]
                        dev_addr:       ffff880046991400
                        device:         /dev/sdf
                        devid:          2
                        dev_root_fsid:  763c600a-7af6-4b8a-a421-6611de307dbf
                        generation:     27
                        total_bytes:    1633799168
                        dev_totalbytes: 1633799168
                        bytes_used:     167772160
                        type:           0
                        io_align:       4096
                        io_width:       4096
                        sector_size:    4096
                        mode:           0x81
                        writeable:      0
                        in_fs_metadata: 1
                        missing:        0
                        can_discard:    0
                        replace_tgtdev: 0
                        active_pending: 0
                        nobarriers:     0
                        devstats_valid: 0
                        bdev:           not_null
        [[seed_fsid: 1c52f894-0ead-43d6-847a-d42359f78370]]
                sprout_fsid:            e962e198-ef98-4782-ae99-d0128c9f5c37
                fs_devs_addr:           ffff88004586a000
                num_devices:            1
                open_devices:           1
                rw_devices:             0
                missing_devices:        0
                total_rw_devices:       0
                total_devices:          1
                opened:                 1
                seeding:                1
                rotating:               1
                super_kobj_state:       1
                super_kobj_insysfs:     1
                device_kobj_state:      1
                device_kobj_insysfs:    1
                [[uuid: 4c9b2e81-e4b9-474c-9462-cc2dcd6117d5]]
                        dev_addr:       ffff880046990800
                        device:         /dev/sde
                        devid:          1
                        dev_root_fsid:  763c600a-7af6-4b8a-a421-6611de307dbf
                        generation:     5
                        total_bytes:    1633796096
                        dev_totalbytes: 1633796096
                        bytes_used:     180092928
                        type:           0
                        io_align:       4096
                        io_width:       4096
                        sector_size:    4096
                        mode:           0x81
                        writeable:      0
                        in_fs_metadata: 1
                        missing:        0
                        can_discard:    0
                        replace_tgtdev: 0
                        active_pending: 0
                        nobarriers:     0
                        devstats_valid: 0
                        bdev:           not_null


V2: Added 3/3 to support for sysfs kobjects that was moved to fs_devices

Anand Jain (3):
  Btrfs: procfs-devlist: introduce procfs interface for the device list
  Btrfs: procfs-devlist: backport global rcu-string non support
  Btsfs: procfs-devlist: update the sysfs contents

 fs/btrfs/Makefile  |   2 +-
 fs/btrfs/ctree.h   |   4 ++
 fs/btrfs/procfs.c  | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/super.c   |   4 ++
 fs/btrfs/volumes.h |   1 +
 5 files changed, 163 insertions(+), 1 deletion(-)
 create mode 100644 fs/btrfs/procfs.c

-- 
2.0.0.153.g79dcccc

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to