Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull misc vfs updates from Al Viro:
"No common topic whatsoever in those, sorry"

* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fs: define inode flags using bit numbers
iov_iter: Move unnecessary inclusion of crypto/hash.h
dlmfs: clean up dlmfs_file_{read,write}() a bit

+45 -75
+1
arch/s390/lib/test_unwind.c
··· 9 9 #include <linux/kallsyms.h> 10 10 #include <linux/kthread.h> 11 11 #include <linux/module.h> 12 + #include <linux/slab.h> 12 13 #include <linux/string.h> 13 14 #include <linux/kprobes.h> 14 15 #include <linux/wait.h>
+1
drivers/dma/sf-pdma/sf-pdma.c
··· 20 20 #include <linux/mod_devicetable.h> 21 21 #include <linux/dma-mapping.h> 22 22 #include <linux/of.h> 23 + #include <linux/slab.h> 23 24 24 25 #include "sf-pdma.h" 25 26
+1
drivers/dma/st_fdma.c
··· 15 15 #include <linux/platform_device.h> 16 16 #include <linux/interrupt.h> 17 17 #include <linux/remoteproc.h> 18 + #include <linux/slab.h> 18 19 19 20 #include "st_fdma.h" 20 21
+1
drivers/dma/uniphier-xdmac.c
··· 12 12 #include <linux/of.h> 13 13 #include <linux/of_dma.h> 14 14 #include <linux/platform_device.h> 15 + #include <linux/slab.h> 15 16 16 17 #include "dmaengine.h" 17 18 #include "virt-dma.h"
+1
drivers/misc/uacce/uacce.c
··· 4 4 #include <linux/iommu.h> 5 5 #include <linux/module.h> 6 6 #include <linux/poll.h> 7 + #include <linux/slab.h> 7 8 #include <linux/uacce.h> 8 9 9 10 static struct class *uacce_class;
+1
drivers/mtd/mtdpstore.c
··· 7 7 #include <linux/pstore_blk.h> 8 8 #include <linux/mtd/mtd.h> 9 9 #include <linux/bitops.h> 10 + #include <linux/slab.h> 10 11 11 12 static struct mtdpstore_context { 12 13 int index;
+1
drivers/mtd/nand/raw/cadence-nand-controller.c
··· 17 17 #include <linux/mtd/rawnand.h> 18 18 #include <linux/of_device.h> 19 19 #include <linux/iopoll.h> 20 + #include <linux/slab.h> 20 21 21 22 /* 22 23 * HPNFC can work in 3 modes:
+1
drivers/remoteproc/qcom_q6v5_mss.c
··· 26 26 #include <linux/reset.h> 27 27 #include <linux/soc/qcom/mdt_loader.h> 28 28 #include <linux/iopoll.h> 29 + #include <linux/slab.h> 29 30 30 31 #include "remoteproc_internal.h" 31 32 #include "qcom_common.h"
+1
drivers/soc/qcom/pdr_interface.c
··· 5 5 6 6 #include <linux/kernel.h> 7 7 #include <linux/module.h> 8 + #include <linux/slab.h> 8 9 #include <linux/string.h> 9 10 #include <linux/workqueue.h> 10 11
+1
fs/btrfs/inode.c
··· 3 3 * Copyright (C) 2007 Oracle. All rights reserved. 4 4 */ 5 5 6 + #include <crypto/hash.h> 6 7 #include <linux/kernel.h> 7 8 #include <linux/bio.h> 8 9 #include <linux/buffer_head.h>
+8 -44
fs/ocfs2/dlmfs/dlmfs.c
··· 221 221 return event; 222 222 } 223 223 224 - static ssize_t dlmfs_file_read(struct file *filp, 224 + static ssize_t dlmfs_file_read(struct file *file, 225 225 char __user *buf, 226 226 size_t count, 227 227 loff_t *ppos) 228 228 { 229 - int bytes_left; 230 - ssize_t got; 231 - char *lvb_buf; 232 - struct inode *inode = file_inode(filp); 229 + char lvb[DLM_LVB_LEN]; 233 230 234 - mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 235 - inode->i_ino, count, *ppos); 236 - 237 - if (*ppos >= i_size_read(inode)) 231 + if (!user_dlm_read_lvb(file_inode(file), lvb)) 238 232 return 0; 239 233 240 - /* don't read past the lvb */ 241 - if (count > i_size_read(inode) - *ppos) 242 - count = i_size_read(inode) - *ppos; 243 - 244 - if (!count) 245 - return 0; 246 - 247 - lvb_buf = kmalloc(count, GFP_NOFS); 248 - if (!lvb_buf) 249 - return -ENOMEM; 250 - 251 - got = user_dlm_read_lvb(inode, lvb_buf, count); 252 - if (got) { 253 - BUG_ON(got != count); 254 - bytes_left = copy_to_user(buf, lvb_buf, count); 255 - count -= bytes_left; 256 - } else 257 - count = 0; 258 - 259 - kfree(lvb_buf); 260 - 261 - *ppos = *ppos + count; 262 - 263 - mlog(0, "read %zu bytes\n", count); 264 - return count; 234 + return simple_read_from_buffer(buf, count, ppos, lvb, sizeof(lvb)); 265 235 } 266 236 267 237 static ssize_t dlmfs_file_write(struct file *filp, ··· 239 269 size_t count, 240 270 loff_t *ppos) 241 271 { 272 + char lvb_buf[DLM_LVB_LEN]; 242 273 int bytes_left; 243 - char *lvb_buf; 244 274 struct inode *inode = file_inode(filp); 245 275 246 276 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 247 277 inode->i_ino, count, *ppos); 248 278 249 - if (*ppos >= i_size_read(inode)) 279 + if (*ppos >= DLM_LVB_LEN) 250 280 return -ENOSPC; 251 281 252 282 /* don't write past the lvb */ 253 - if (count > i_size_read(inode) - *ppos) 254 - count = i_size_read(inode) - *ppos; 283 + if (count > DLM_LVB_LEN - *ppos) 284 + count = DLM_LVB_LEN - *ppos; 255 285 256 286 if (!count) 257 287 return 0; 258 - 259 - lvb_buf = kmalloc(count, GFP_NOFS); 260 - if (!lvb_buf) 261 - return -ENOMEM; 262 288 263 289 bytes_left = copy_from_user(lvb_buf, buf, count); 264 290 count -= bytes_left; 265 291 if (count) 266 292 user_dlm_write_lvb(inode, lvb_buf, count); 267 - 268 - kfree(lvb_buf); 269 293 270 294 *ppos = *ppos + count; 271 295 mlog(0, "wrote %zu bytes\n", count);
+4 -8
fs/ocfs2/dlmfs/userdlm.c
··· 547 547 spin_unlock(&lockres->l_lock); 548 548 } 549 549 550 - ssize_t user_dlm_read_lvb(struct inode *inode, 551 - char *val, 552 - unsigned int len) 550 + bool user_dlm_read_lvb(struct inode *inode, char *val) 553 551 { 554 552 struct user_lock_res *lockres = &DLMFS_I(inode)->ip_lockres; 555 553 char *lvb; 556 - ssize_t ret = len; 557 - 558 - BUG_ON(len > DLM_LVB_LEN); 554 + bool ret = true; 559 555 560 556 spin_lock(&lockres->l_lock); 561 557 562 558 BUG_ON(lockres->l_level < DLM_LOCK_PR); 563 559 if (ocfs2_dlm_lvb_valid(&lockres->l_lksb)) { 564 560 lvb = ocfs2_dlm_lvb(&lockres->l_lksb); 565 - memcpy(val, lvb, len); 561 + memcpy(val, lvb, DLM_LVB_LEN); 566 562 } else 567 - ret = 0; 563 + ret = false; 568 564 569 565 spin_unlock(&lockres->l_lock); 570 566 return ret;
+1 -3
fs/ocfs2/dlmfs/userdlm.h
··· 66 66 void user_dlm_write_lvb(struct inode *inode, 67 67 const char *val, 68 68 unsigned int len); 69 - ssize_t user_dlm_read_lvb(struct inode *inode, 70 - char *val, 71 - unsigned int len); 69 + bool user_dlm_read_lvb(struct inode *inode, char *val); 72 70 struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name); 73 71 void user_dlm_unregister(struct ocfs2_cluster_connection *conn); 74 72 void user_dlm_set_locking_protocol(void);
+18 -18
include/linux/fs.h
··· 1946 1946 /* 1947 1947 * Inode flags - they have no relation to superblock flags now 1948 1948 */ 1949 - #define S_SYNC 1 /* Writes are synced at once */ 1950 - #define S_NOATIME 2 /* Do not update access times */ 1951 - #define S_APPEND 4 /* Append-only file */ 1952 - #define S_IMMUTABLE 8 /* Immutable file */ 1953 - #define S_DEAD 16 /* removed, but still open directory */ 1954 - #define S_NOQUOTA 32 /* Inode is not counted to quota */ 1955 - #define S_DIRSYNC 64 /* Directory modifications are synchronous */ 1956 - #define S_NOCMTIME 128 /* Do not update file c/mtime */ 1957 - #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ 1958 - #define S_PRIVATE 512 /* Inode is fs-internal */ 1959 - #define S_IMA 1024 /* Inode has an associated IMA struct */ 1960 - #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ 1961 - #define S_NOSEC 4096 /* no suid or xattr security attributes */ 1949 + #define S_SYNC (1 << 0) /* Writes are synced at once */ 1950 + #define S_NOATIME (1 << 1) /* Do not update access times */ 1951 + #define S_APPEND (1 << 2) /* Append-only file */ 1952 + #define S_IMMUTABLE (1 << 3) /* Immutable file */ 1953 + #define S_DEAD (1 << 4) /* removed, but still open directory */ 1954 + #define S_NOQUOTA (1 << 5) /* Inode is not counted to quota */ 1955 + #define S_DIRSYNC (1 << 6) /* Directory modifications are synchronous */ 1956 + #define S_NOCMTIME (1 << 7) /* Do not update file c/mtime */ 1957 + #define S_SWAPFILE (1 << 8) /* Do not truncate: swapon got its bmaps */ 1958 + #define S_PRIVATE (1 << 9) /* Inode is fs-internal */ 1959 + #define S_IMA (1 << 10) /* Inode has an associated IMA struct */ 1960 + #define S_AUTOMOUNT (1 << 11) /* Automount/referral quasi-directory */ 1961 + #define S_NOSEC (1 << 12) /* no suid or xattr security attributes */ 1962 1962 #ifdef CONFIG_FS_DAX 1963 - #define S_DAX 8192 /* Direct Access, avoiding the page cache */ 1963 + #define S_DAX (1 << 13) /* Direct Access, avoiding the page cache */ 1964 1964 #else 1965 - #define S_DAX 0 /* Make all the DAX code disappear */ 1965 + #define S_DAX 0 /* Make all the DAX code disappear */ 1966 1966 #endif 1967 - #define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */ 1968 - #define S_CASEFOLD 32768 /* Casefolded file */ 1969 - #define S_VERITY 65536 /* Verity file (using fs/verity/) */ 1967 + #define S_ENCRYPTED (1 << 14) /* Encrypted file (using fs/crypto/) */ 1968 + #define S_CASEFOLD (1 << 15) /* Casefolded file */ 1969 + #define S_VERITY (1 << 16) /* Verity file (using fs/verity/) */ 1970 1970 1971 1971 /* 1972 1972 * Note that nosuid etc flags are inode-specific: setting some file-system
+1
include/linux/skbuff.h
··· 238 238 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ 239 239 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 240 240 241 + struct ahash_request; 241 242 struct net_device; 242 243 struct scatterlist; 243 244 struct pipe_inode_info;
+1
include/linux/socket.h
··· 10 10 #include <linux/compiler.h> /* __user */ 11 11 #include <uapi/linux/socket.h> 12 12 13 + struct file; 13 14 struct pid; 14 15 struct cred; 15 16 struct socket;
-1
include/linux/uio.h
··· 7 7 8 8 #include <linux/kernel.h> 9 9 #include <linux/thread_info.h> 10 - #include <crypto/hash.h> 11 10 #include <uapi/linux/uio.h> 12 11 13 12 struct page;
+2 -1
lib/iov_iter.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 + #include <crypto/hash.h> 2 3 #include <linux/export.h> 3 4 #include <linux/bvec.h> 4 5 #include <linux/uio.h> ··· 1568 1567 size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp, 1569 1568 struct iov_iter *i) 1570 1569 { 1571 - #ifdef CONFIG_CRYPTO 1570 + #ifdef CONFIG_CRYPTO_HASH 1572 1571 struct ahash_request *hash = hashp; 1573 1572 struct scatterlist sg; 1574 1573 size_t copied;