Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Copyright (C) 2012 Fusion-io  All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * Copyright (C) 2012 Intel Corp. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #ifndef BTRFS_RAID56_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #define BTRFS_RAID56_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) static inline int nr_parity_stripes(const struct map_lookup *map)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 	if (map->type & BTRFS_BLOCK_GROUP_RAID5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 		return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 	else if (map->type & BTRFS_BLOCK_GROUP_RAID6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 		return 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static inline int nr_data_stripes(const struct map_lookup *map)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 	return map->num_stripes - nr_parity_stripes(map);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define RAID5_P_STRIPE ((u64)-2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define RAID6_Q_STRIPE ((u64)-1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define is_parity_stripe(x) (((x) == RAID5_P_STRIPE) ||		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 			     ((x) == RAID6_Q_STRIPE))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct btrfs_raid_bio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct btrfs_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) int raid56_parity_recover(struct btrfs_fs_info *fs_info, struct bio *bio,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 			  struct btrfs_bio *bbio, u64 stripe_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 			  int mirror_num, int generic_io);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) int raid56_parity_write(struct btrfs_fs_info *fs_info, struct bio *bio,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 			       struct btrfs_bio *bbio, u64 stripe_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) void raid56_add_scrub_pages(struct btrfs_raid_bio *rbio, struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 			    u64 logical);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct btrfs_raid_bio *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) raid56_parity_alloc_scrub_rbio(struct btrfs_fs_info *fs_info, struct bio *bio,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 			       struct btrfs_bio *bbio, u64 stripe_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 			       struct btrfs_device *scrub_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 			       unsigned long *dbitmap, int stripe_nsectors);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) void raid56_parity_submit_scrub_rbio(struct btrfs_raid_bio *rbio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct btrfs_raid_bio *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) raid56_alloc_missing_rbio(struct btrfs_fs_info *fs_info, struct bio *bio,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 			  struct btrfs_bio *bbio, u64 length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) void raid56_submit_missing_rbio(struct btrfs_raid_bio *rbio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) void btrfs_free_stripe_hash_table(struct btrfs_fs_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif