search for: cpu_to_le

Displaying 11 results from an estimated 11 matches for "cpu_to_le".

2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
...irtio##bits val) \ +{ \ + if (little_endian) \ + return le##bits##_to_cpu((__force __le##bits)val); \ + else \ + return (__force u##bits)val; \ +} \ +static inline __virtio##bits __cpu_to_virtio##bits(bool little_endian, u##bits val) \ +{ \ + if (little_endian) \ + return (__force __virtio##bits)cpu_to_le##bits(val); \ + else \ + return val; \ +} + +__DEFINE_VIRTIO_XX_TO_CPU(16) +__DEFINE_VIRTIO_XX_TO_CPU(32) +__DEFINE_VIRTIO_XX_TO_CPU(64) + +#endif /* _LINUX_VIRTIO_BYTEORDER */ diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..d38d3c2 100644 --- a/include/li...
2014 Oct 22
2
[PATCH RFC v3 01/16] virtio: memory access APIs
...irtio##bits val) \ +{ \ + if (little_endian) \ + return le##bits##_to_cpu((__force __le##bits)val); \ + else \ + return (__force u##bits)val; \ +} \ +static inline __virtio##bits __cpu_to_virtio##bits(bool little_endian, u##bits val) \ +{ \ + if (little_endian) \ + return (__force __virtio##bits)cpu_to_le##bits(val); \ + else \ + return val; \ +} + +__DEFINE_VIRTIO_XX_TO_CPU(16) +__DEFINE_VIRTIO_XX_TO_CPU(32) +__DEFINE_VIRTIO_XX_TO_CPU(64) + +#endif /* _LINUX_VIRTIO_BYTEORDER */ diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..d38d3c2 100644 --- a/include/li...
2014 Oct 23
0
[PATCH RFC v3 01/16] virtio: memory access APIs
...ian) \ > + return le##bits##_to_cpu((__force __le##bits)val); \ > + else \ > + return (__force u##bits)val; \ > +} \ > +static inline __virtio##bits __cpu_to_virtio##bits(bool little_endian, u##bits val) \ > +{ \ > + if (little_endian) \ > + return (__force __virtio##bits)cpu_to_le##bits(val); \ > + else \ > + return val; \ > +} > + > +__DEFINE_VIRTIO_XX_TO_CPU(16) > +__DEFINE_VIRTIO_XX_TO_CPU(32) > +__DEFINE_VIRTIO_XX_TO_CPU(64) ...although I'm still not too happy with macro-generated helpers. > + > +#endif /* _LINUX_VIRTIO_BYTEORDER */ &gt...
2014 Oct 21
2
[PATCH RFC] virtio 1.0 vring endian-ness
..._virtio##bits val) \ +{ \ + if (little_endian) \ + return le##bits##_to_cpu((__force __le##bits)val); \ + else \ + return (__force u##bits)val; \ +} \ +static inline __virtio##bits cpu_to_virtio##bits(bool little_endian, u##bits val) \ +{ \ + if (little_endian) \ + return (__force __virtio##bits)cpu_to_le##bits(val); \ + else \ + return val; \ +} + +DEFINE_VIRTIO_XX_TO_CPU(16) +DEFINE_VIRTIO_XX_TO_CPU(32) +DEFINE_VIRTIO_XX_TO_CPU(64) + struct virtio_device; struct virtqueue; diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index a99f9b7..744cee1 100644 --- a/incl...
2014 Oct 21
2
[PATCH RFC] virtio 1.0 vring endian-ness
..._virtio##bits val) \ +{ \ + if (little_endian) \ + return le##bits##_to_cpu((__force __le##bits)val); \ + else \ + return (__force u##bits)val; \ +} \ +static inline __virtio##bits cpu_to_virtio##bits(bool little_endian, u##bits val) \ +{ \ + if (little_endian) \ + return (__force __virtio##bits)cpu_to_le##bits(val); \ + else \ + return val; \ +} + +DEFINE_VIRTIO_XX_TO_CPU(16) +DEFINE_VIRTIO_XX_TO_CPU(32) +DEFINE_VIRTIO_XX_TO_CPU(64) + struct virtio_device; struct virtqueue; diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index a99f9b7..744cee1 100644 --- a/incl...
2014 Oct 22
0
[PATCH RFC] virtio 1.0 vring endian-ness
...ndian) \ > + return le##bits##_to_cpu((__force __le##bits)val); \ > + else \ > + return (__force u##bits)val; \ > +} \ > +static inline __virtio##bits cpu_to_virtio##bits(bool little_endian, u##bits val) \ > +{ \ > + if (little_endian) \ > + return (__force __virtio##bits)cpu_to_le##bits(val); \ > + else \ > + return val; \ > +} > + > +DEFINE_VIRTIO_XX_TO_CPU(16) > +DEFINE_VIRTIO_XX_TO_CPU(32) > +DEFINE_VIRTIO_XX_TO_CPU(64) > + I'm usually not very fond of creating functions via macros like that as it makes it hard to grep for them. > struct...
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
virtio 1.0 makes all memory structures LE, so we need APIs to conditionally do a byteswap on BE architectures. To make it easier to check code statically, add virtio specific types for multi-byte integers in memory. Add low level wrappers that do a byteswap conditionally, these will be useful e.g. for vhost. Add high level wrappers that will (in the future) query device endian-ness and act
2014 Oct 22
2
[PATCH RFC v2 01/16] virtio: memory access APIs
virtio 1.0 makes all memory structures LE, so we need APIs to conditionally do a byteswap on BE architectures. To make it easier to check code statically, add virtio specific types for multi-byte integers in memory. Add low level wrappers that do a byteswap conditionally, these will be useful e.g. for vhost. Add high level wrappers that will (in the future) query device endian-ness and act
2013 Dec 16
6
[PATCH 0/3] Send: minor cleanups, add RO checks
First two patches are trivial cleanups that I''ve spotted while reading send.c, can be applied independently. The third patch contains the important bits, safety checks that the subvolumes involved in send do not accidentally lose the RO status. I haven''t seen this documented anywhere that this is mandatory, implied from how I assume send works. Please let me know if this is
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi, The following patches add support for ext4 and btrfs to PV-GRUB. These patches are taken nearly verbatim from those provided by Fedora and Gentoo. We''ve been using these patches for the PV-GRUB images available in EC2 for some time now with no problems. Changes from v1: - Makefile has been changed to check the exit code from patch - The btrfs patch has been rebased to apply
2012 Dec 18
0
[PATCH] [RFC] Btrfs: Subpagesize blocksize (WIP).
...\ } \ static inline void btrfs_set_##name(struct extent_buffer *eb, \ u##bits val) \ { \ - type *p = page_address(eb->pages[0]); \ + type *p; \ + \ + p = page_address(eb->pages[0]) + (eb->start & (PAGE_SIZE - 1)); \ p->member = cpu_to_le##bits(val); \ } diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f633af8..00b80b7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -373,6 +373,24 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root, WAIT_COMPLETE, btree_get_exten...