@@ -321,69 +321,6 @@ static inline void bio_next_folio(struct folio_iter *fi, struct bio *bio)
321321#define bio_for_each_folio_all (fi , bio ) \
322322 for (bio_first_folio(&fi, bio, 0); fi.folio; bio_next_folio(&fi, bio))
323323
324- enum bip_flags {
325- BIP_BLOCK_INTEGRITY = 1 << 0 , /* block layer owns integrity data */
326- BIP_MAPPED_INTEGRITY = 1 << 1 , /* ref tag has been remapped */
327- BIP_CTRL_NOCHECK = 1 << 2 , /* disable HBA integrity checking */
328- BIP_DISK_NOCHECK = 1 << 3 , /* disable disk integrity checking */
329- BIP_IP_CHECKSUM = 1 << 4 , /* IP checksum */
330- BIP_INTEGRITY_USER = 1 << 5 , /* Integrity payload is user address */
331- BIP_COPY_USER = 1 << 6 , /* Kernel bounce buffer in use */
332- };
333-
334- /*
335- * bio integrity payload
336- */
337- struct bio_integrity_payload {
338- struct bio * bip_bio ; /* parent bio */
339-
340- struct bvec_iter bip_iter ;
341-
342- unsigned short bip_vcnt ; /* # of integrity bio_vecs */
343- unsigned short bip_max_vcnt ; /* integrity bio_vec slots */
344- unsigned short bip_flags ; /* control flags */
345-
346- struct bvec_iter bio_iter ; /* for rewinding parent bio */
347-
348- struct work_struct bip_work ; /* I/O completion */
349-
350- struct bio_vec * bip_vec ;
351- struct bio_vec bip_inline_vecs [];/* embedded bvec array */
352- };
353-
354- #if defined(CONFIG_BLK_DEV_INTEGRITY )
355-
356- static inline struct bio_integrity_payload * bio_integrity (struct bio * bio )
357- {
358- if (bio -> bi_opf & REQ_INTEGRITY )
359- return bio -> bi_integrity ;
360-
361- return NULL ;
362- }
363-
364- static inline bool bio_integrity_flagged (struct bio * bio , enum bip_flags flag )
365- {
366- struct bio_integrity_payload * bip = bio_integrity (bio );
367-
368- if (bip )
369- return bip -> bip_flags & flag ;
370-
371- return false;
372- }
373-
374- static inline sector_t bip_get_seed (struct bio_integrity_payload * bip )
375- {
376- return bip -> bip_iter .bi_sector ;
377- }
378-
379- static inline void bip_set_seed (struct bio_integrity_payload * bip ,
380- sector_t seed )
381- {
382- bip -> bip_iter .bi_sector = seed ;
383- }
384-
385- #endif /* CONFIG_BLK_DEV_INTEGRITY */
386-
387324void bio_trim (struct bio * bio , sector_t offset , sector_t size );
388325extern struct bio * bio_split (struct bio * bio , int sectors ,
389326 gfp_t gfp , struct bio_set * bs );
@@ -721,99 +658,6 @@ static inline bool bioset_initialized(struct bio_set *bs)
721658 return bs -> bio_slab != NULL ;
722659}
723660
724- #if defined(CONFIG_BLK_DEV_INTEGRITY )
725-
726- #define bip_for_each_vec (bvl , bip , iter ) \
727- for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter)
728-
729- #define bio_for_each_integrity_vec (_bvl , _bio , _iter ) \
730- for_each_bio(_bio) \
731- bip_for_each_vec(_bvl, _bio->bi_integrity, _iter)
732-
733- int bio_integrity_map_user (struct bio * bio , void __user * ubuf , ssize_t len , u32 seed );
734- void bio_integrity_unmap_free_user (struct bio * bio );
735- extern struct bio_integrity_payload * bio_integrity_alloc (struct bio * , gfp_t , unsigned int );
736- extern int bio_integrity_add_page (struct bio * , struct page * , unsigned int , unsigned int );
737- extern bool bio_integrity_prep (struct bio * );
738- extern void bio_integrity_advance (struct bio * , unsigned int );
739- extern void bio_integrity_trim (struct bio * );
740- extern int bio_integrity_clone (struct bio * , struct bio * , gfp_t );
741- extern int bioset_integrity_create (struct bio_set * , int );
742- extern void bioset_integrity_free (struct bio_set * );
743- extern void bio_integrity_init (void );
744-
745- #else /* CONFIG_BLK_DEV_INTEGRITY */
746-
747- static inline void * bio_integrity (struct bio * bio )
748- {
749- return NULL ;
750- }
751-
752- static inline int bioset_integrity_create (struct bio_set * bs , int pool_size )
753- {
754- return 0 ;
755- }
756-
757- static inline void bioset_integrity_free (struct bio_set * bs )
758- {
759- return ;
760- }
761-
762- static inline bool bio_integrity_prep (struct bio * bio )
763- {
764- return true;
765- }
766-
767- static inline int bio_integrity_clone (struct bio * bio , struct bio * bio_src ,
768- gfp_t gfp_mask )
769- {
770- return 0 ;
771- }
772-
773- static inline void bio_integrity_advance (struct bio * bio ,
774- unsigned int bytes_done )
775- {
776- return ;
777- }
778-
779- static inline void bio_integrity_trim (struct bio * bio )
780- {
781- return ;
782- }
783-
784- static inline void bio_integrity_init (void )
785- {
786- return ;
787- }
788-
789- static inline bool bio_integrity_flagged (struct bio * bio , enum bip_flags flag )
790- {
791- return false;
792- }
793-
794- static inline void * bio_integrity_alloc (struct bio * bio , gfp_t gfp ,
795- unsigned int nr )
796- {
797- return ERR_PTR (- EINVAL );
798- }
799-
800- static inline int bio_integrity_add_page (struct bio * bio , struct page * page ,
801- unsigned int len , unsigned int offset )
802- {
803- return 0 ;
804- }
805-
806- static inline int bio_integrity_map_user (struct bio * bio , void __user * ubuf ,
807- ssize_t len , u32 seed )
808- {
809- return - EINVAL ;
810- }
811- static inline void bio_integrity_unmap_free_user (struct bio * bio )
812- {
813- }
814-
815- #endif /* CONFIG_BLK_DEV_INTEGRITY */
816-
817661/*
818662 * Mark a bio as polled. Note that for async polled IO, the caller must
819663 * expect -EWOULDBLOCK if we cannot allocate a request (or other resources).
0 commit comments