Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/include/linux/uio.h

    r679 r772  
    44#define _LINUX_UIO_H
    55
    6 enum {
    7         ITER_IOVEC = 0,
    8         ITER_KVEC = 2,
    9         ITER_BVEC = 4,
     6#include <linux/types.h>
     7
     8enum iter_type {
     9        /* iter types */
     10        ITER_IOVEC,
     11        ITER_KVEC,
     12        ITER_BVEC,
     13        ITER_XARRAY,
     14        ITER_DISCARD,
     15        ITER_UBUF,
     16};
     17
     18#define ITER_SOURCE     1       // == WRITE
     19#define ITER_DEST       0       // == READ
     20
     21struct kvec {
     22        void *iov_base; /* and that should *never* hold a userland pointer */
     23        size_t iov_len;
    1024};
    1125
     
    2034
    2135struct iov_iter {
    22         int type;
    23         size_t iov_offset;
    24         size_t count;
     36        u8 iter_type;
     37        bool copy_mc;
     38        bool nofault;
     39        bool data_source;
     40        bool user_backed;
     41        union {
     42                /*
     43                 * This really should be a const, but we cannot do that without
     44                 * also modifying any of the zero-filling iter init functions.
     45                 * Leave it non-const for now, but it should be treated as such.
     46                 */
     47                struct iovec __ubuf_iovec;
     48                struct {
     49                        union {
     50                                /* use iter_iov() to get the current vec */
     51                                const struct iovec *__iov;
     52                                void __user *ubuf;
     53                        };
     54                        size_t count;
     55                };
     56        };
    2557        union {
    2658                const struct iovec *iov;
     
    3365static inline bool iter_is_iovec(const struct iov_iter *i)
    3466{
    35         return !(i->type & (ITER_BVEC | ITER_KVEC));
     67        return !(i->iter_type & (ITER_BVEC | ITER_KVEC));
    3668}
    3769
     70static inline const struct iovec *iter_iov(const struct iov_iter *iter)
     71{
     72        if (iter->iter_type == ITER_UBUF)
     73                return (const struct iovec *) &iter->__ubuf_iovec;
     74        return iter->__iov;
     75}
     76int import_ubuf(int type, void __user *buf, size_t len, struct iov_iter *i);
     77
    3878#endif /* _LINUX_UIO_H */
Note: See TracChangeset for help on using the changeset viewer.