bpf: Fix a BTF_ID_LIST bug with CONFIG_DEBUG_INFO_BTF not set
[platform/kernel/linux-starfive.git] / include / linux / fs.h
index e654435..6b115bc 100644 (file)
@@ -2089,6 +2089,14 @@ struct dir_context {
  */
 #define REMAP_FILE_ADVISORY            (REMAP_FILE_CAN_SHORTEN)
 
+/*
+ * These flags control the behavior of vfs_copy_file_range().
+ * They are not available to the user via syscall.
+ *
+ * COPY_FILE_SPLICE: call splice direct instead of fs clone/copy ops
+ */
+#define COPY_FILE_SPLICE               (1 << 0)
+
 struct iov_iter;
 struct io_uring_cmd;
 
@@ -3485,7 +3493,7 @@ void simple_transaction_set(struct file *file, size_t n);
  * All attributes contain a text representation of a numeric value
  * that are accessed with the get() and set() functions.
  */
-#define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt)           \
+#define DEFINE_SIMPLE_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, __is_signed)      \
 static int __fops ## _open(struct inode *inode, struct file *file)     \
 {                                                                      \
        __simple_attr_check_format(__fmt, 0ull);                        \
@@ -3496,10 +3504,16 @@ static const struct file_operations __fops = {                          \
        .open    = __fops ## _open,                                     \
        .release = simple_attr_release,                                 \
        .read    = simple_attr_read,                                    \
-       .write   = simple_attr_write,                                   \
+       .write   = (__is_signed) ? simple_attr_write_signed : simple_attr_write,        \
        .llseek  = generic_file_llseek,                                 \
 }
 
+#define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt)           \
+       DEFINE_SIMPLE_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, false)
+
+#define DEFINE_SIMPLE_ATTRIBUTE_SIGNED(__fops, __get, __set, __fmt)    \
+       DEFINE_SIMPLE_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, true)
+
 static inline __printf(1, 2)
 void __simple_attr_check_format(const char *fmt, ...)
 {
@@ -3514,6 +3528,8 @@ ssize_t simple_attr_read(struct file *file, char __user *buf,
                         size_t len, loff_t *ppos);
 ssize_t simple_attr_write(struct file *file, const char __user *buf,
                          size_t len, loff_t *ppos);
+ssize_t simple_attr_write_signed(struct file *file, const char __user *buf,
+                                size_t len, loff_t *ppos);
 
 struct ctl_table;
 int __init list_bdev_fs_names(char *buf, size_t size);