/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_IF_LINK_H #define _LINUX_IF_LINK_H #include /* We don't want this structure exposed to user space */ struct ifla_vf_stats { __u64 rx_packets; __u64 tx_packets; __u64 rx_bytes; __u64 tx_bytes; __u64 broadcast; __u64 multicast; __u64 rx_dropped; __u64 tx_dropped; }; struct ifla_vf_info { __u32 vf; __u8 mac[32]; __u32 vlan; __u32 qos; __u32 spoofchk; __u32 linkstate; __u32 min_tx_rate; __u32 max_tx_rate; __u32 rss_query_en; __u32 trusted; __be16 vlan_proto; }; #endif /* _LINUX_IF_LINK_H */ 0de711814c42fb088f6d31901502c711a'/> urn:sha1:322cbb50de711814c42fb088f6d31901502c711a There is no good reason to keep genhd.h separate from the main blkdev.h header that includes it. So fold the contents of genhd.h into blkdev.h and remove genhd.h entirely. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20220124093913.742411-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> block: drop unused includes in <linux/genhd.h> 2021-10-18T12:17:02Z Christoph Hellwig hch@lst.de 2021-09-20T12:33:25Z urn:sha1:b81e0c2372e65e5627864ba034433b64b2fc73f5 Drop various include not actually used in genhd.h itself, and move the remaning includes closer together. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20210920123328.1399408-15-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> block: switch partition lookup to use struct block_device 2020-12-01T21:53:40Z Christoph Hellwig hch@lst.de 2020-11-24T08:36:54Z urn:sha1:8446fe9255be821cb38ffd306d7e8edc4b9ea662 Use struct block_device to lookup partitions on a disk. This removes all usage of struct hd_struct from the I/O path. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Coly Li <colyli@suse.de> [bcache] Acked-by: Chao Yu <yuchao0@huawei.com> [f2fs] Signed-off-by: Jens Axboe <axboe@kernel.dk> block: allocate struct hd_struct as part of struct bdev_inode 2020-12-01T21:53:40Z Christoph Hellwig hch@lst.de 2020-11-26T17:47:17Z urn:sha1:cb8432d650fe3be58bb962bc8e602dc405510327 Allocate hd_struct together with struct block_device to pre-load the lifetime rule changes in preparation of merging the two structures. Note that part0 was previously embedded into struct gendisk, but is a separate allocation now, and already points to the block_device instead of the hd_struct. The lifetime of struct gendisk is still controlled by the struct device embedded in the part0 hd_struct. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> block: move disk stat accounting to struct block_device 2020-12-01T21:53:40Z Christoph Hellwig hch@lst.de 2020-11-24T08:34:00Z urn:sha1:15e3d2c5cd53298272e59ad9072d3468f9dd3781 Move the dkstats and stamp field to struct block_device in preparation of killing struct hd_struct. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> block: use __this_cpu_add() instead of access by smp_processor_id() 2020-05-27T11:21:23Z Konstantin Khlebnikov khlebnikov@yandex-team.ru 2020-05-27T05:24:18Z urn:sha1:b2d76adbc0828e0f108567973bcc500ed1abc139 Most architectures have fast path to access percpu for current cpu. The required preempt_disable() is provided by part_stat_lock(). [hch: rebased] Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> block: remove rcu_read_lock() from part_stat_lock() 2020-05-27T11:21:23Z Konstantin Khlebnikov khlebnikov@yandex-team.ru 2020-05-27T05:24:17Z urn:sha1:8ab1d40a646e753adb6814642432a093d93dbf47 The RCU lock is required only in disk_map_sector_rcu() to lookup the partition. After that request holds reference to related hd_struct. Replace get_cpu() with preempt_disable() - returned cpu index is unused. [hch: rebased] Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> block: always use a percpu variable for disk stats 2020-05-27T11:21:23Z Christoph Hellwig hch@lst.de 2020-05-27T05:24:14Z urn:sha1:58d4f14fc30ac26288cfed74d7e566921c22cf59 percpu variables have a perfectly fine working stub implementation for UP kernels, so use that. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Jens Axboe <axboe@kernel.dk> block: move the part_stat* helpers from genhd.h to a new header 2020-03-25T15:50:09Z Christoph Hellwig hch@lst.de 2020-03-25T15:48:42Z urn:sha1:c6a564ffadc9105880329710164ee493f0de103c These macros are just used by a few files. Move them out of genhd.h, which is included everywhere into a new standalone header. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>