vm_fault_t conversion, for real
Subsystems (83)
Hi all,
this series tries to actually turn vm_fault_t into a type that can be typechecked and checks the fallout instead of sprinkling random annotations without context.
The first one fixes a real bug in orangefs, the second and third fix mismatched existing vm_fault_t annotations on the same function, the fourth removes an unused export that was in the chain. The remainder until the last one do some not quite trivial conversions, and the last one does the trivial mass annotation and flips vm_fault_t to a __bitwise unsigned int - the unsigned means we also get plain compiler type checking for the new ->fault signature even without sparse.
This has survived an x86 allyesconfig build, and got a SUCCESS from the buildbot that I don't really trust - I'm pretty sure there are bits and pieces hiding in other architectures that it hasn't caught up to.
The sparse annotations are manuall verified for the core MM code and a few other interesting bits (e.g. DAX and the x86 fault code)
The series is against linux-next as of 2018/05/15 to make sure any annotations in subsystem trees are picked up.
PATCH 1/14 orangefs: don't return errno values from ->fault
--- fs/orangefs/file.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
fs/orangefs/file.c +4 -6
@@ -528,18 +528,16 @@ static long orangefs_ioctl(struct file *file, unsigned int cmd, unsigned long arreturn ret; } -static int orangefs_fault (struct vm_fault *vmf) +static vm_fault_t orangefs_fault (struct vm_fault *vmf) {struct file *file = vmf->vma->vm_file;int rc; - rc =orangefs_inode_getattr (file->f_mapping->host,0 ,1 , -STATX_SIZE ); -if (rc == -ESTALE ) - rc = -EIO ; + + rc =orangefs_inode_getattr (file->f_mapping->host,0 ,1 ,STATX_SIZE );if (rc) {gossip_err ("%s: orangefs_inode_getattr failed, " "rc:%d:.\n" , __func__, rc); -return rc; +return VM_FAULT_SIGBUS ; }return filemap_fault (vmf); }
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Matthew Wilcox
maintainerRe: [PATCH 01/14] orangefs: don't return errno values from ->fault
fs/orangefs/file.c static long orangefs_ioctl(struct file *file, unsigned int cmd, unsigned long ar · line 540
Quoted 6 lines · Christoph Hellwig
fs/orangefs/file.c +2
-1+ rc =orangefs_inode_getattr (file->f_mapping->host,0 ,1 ,STATX_SIZE );if (rc) {gossip_err ("%s: orangefs_inode_getattr failed, " "rc:%d:.\n" , __func__, rc); -return rc; +return VM_FAULT_SIGBUS ;
Nope. orangefs_inode_getattr can return -ENOMEM.
Quoted 6 lines
fs/orangefs/file.c +0
-0}return filemap_fault (vmf); }Signature · 1 line
2.17.0
PATCH 2/14 fs: make the filemap_page_mkwrite prototype consistent
In reply to Christoph Hellwig!CONFIG_MMU version didn't agree with the rest of the kernel..
--- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/filemap.c +1 -1
@@ -2748,7 +2748,7 @@ int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma) return generic_file_mmap(file, vma); }#else -int filemap_page_mkwrite (struct vm_fault *vmf) +vm_fault_t filemap_page_mkwrite (struct vm_fault *vmf) {return -ENOSYS ; }
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/14 dax: make the dax_iomap_fault prototype consistent
In reply to Christoph Hellwig--- include/linux/dax.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/dax.h +1 -1
@@ -183,7 +183,7 @@ void dax_flush(struct dax_device *dax_dev, void *addr, size_t size);ssize_t dax_iomap_rw (struct kiocb *iocb,struct iov_iter *iter,const struct iomap_ops *ops); -int dax_iomap_fault (struct vm_fault *vmf,enum page_entry_size pe_size, +vm_fault_t dax_iomap_fault (struct vm_fault *vmf,enum page_entry_size pe_size,pfn_t *pfnp,int *errp,const struct iomap_ops *ops);vm_fault_t dax_finish_sync_fault (struct vm_fault *vmf,enum page_entry_size pe_size,pfn_t pfn);
Signature · 1 line
2.17.0
PATCH 4/14 mm: remove the unused device_private_entry_fault export
In reply to Christoph Hellwig--- kernel/memremap.c | 1 - 1 file changed, 1 deletion(-)
kernel/memremap.c +0 -1
@@ -65,7 +65,6 @@ int device_private_entry_fault(struct vm_area_struct *vma,*/ return page->pgmap->page_fault(vma, addr, page, flags, pmdp); } -EXPORT_SYMBOL (device_private_entry_fault);#endif /* CONFIG_DEVICE_PRIVATE */ static void pgmap_radix_release (struct resource *res,unsigned long end_pgoff)
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/14 ceph: untangle ceph_filemap_fault
In reply to Christoph HellwigStreamline the code to have a somewhat natural flow, and separate the errno values from the VM_FAULT_* values.
--- fs/ceph/addr.c | 100 +++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 49 deletions(-)
fs/ceph/addr.c +51 -49
@@ -1428,15 +1428,18 @@ static void ceph_restore_sigs(sigset_t *oldset)/* * vm ops */ -static int ceph_filemap_fault (struct vm_fault *vmf) +static vm_fault_t ceph_filemap_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct inode *inode =file_inode (vma->vm_file); +struct address_space *mapping = inode->i_mapping;struct ceph_inode_info *ci =ceph_inode (inode);struct ceph_file_info *fi = vma->vm_file->private_data; -struct page *pinned_page =NULL ; +struct page *pinned_page =NULL , *page;loff_t off = vmf->pgoff <<PAGE_SHIFT ; -int want, got, ret; +int want, got, err =0 ; +vm_fault_t ret =0 ; +bool did_fault = false;sigset_t oldset;ceph_block_sigs (&oldset);
@@ -1449,9 +1452,9 @@ static int ceph_filemap_fault(struct vm_fault *vmf) want =CEPH_CAP_FILE_CACHE ; got =0 ; - ret =ceph_get_caps (ci,CEPH_CAP_FILE_RD , want,-1 , &got, &pinned_page); -if (ret <0 ) - goto out_restore; + err =ceph_get_caps (ci,CEPH_CAP_FILE_RD , want,-1 , &got, &pinned_page); +if (err <0 ) + goto out_errno;dout ("filemap_fault %p %llu~%zd got cap refs on %s\n" , inode, off, (size_t )PAGE_SIZE ,ceph_cap_string (got));
@@ -1462,8 +1465,8 @@ static int ceph_filemap_fault(struct vm_fault *vmf)ceph_add_rw_context (fi, &rw_ctx); ret =filemap_fault (vmf);ceph_del_rw_context (fi, &rw_ctx); - }else - ret = -EAGAIN ; + did_fault = true; + }dout ("filemap_fault %p %llu~%zd dropping cap refs on %s ret %d\n" , inode, off, (size_t )PAGE_SIZE ,ceph_cap_string (got), ret);
@@ -1471,57 +1474,55 @@ static int ceph_filemap_fault(struct vm_fault *vmf)put_page (pinned_page);ceph_put_cap_refs (ci, got); -if (ret != -EAGAIN ) +if (did_fault) goto out_restore;/* read inline data */ if (off >=PAGE_SIZE ) {/* does not support inline data > PAGE_SIZE */ ret =VM_FAULT_SIGBUS ; + goto out_restore; + } + + page =find_or_create_page (mapping,0 , +mapping_gfp_constraint (mapping, ~__GFP_FS)); +if (!page) { + ret =VM_FAULT_OOM ; + goto out_inline; + } + + err =__ceph_do_getattr (inode, page,CEPH_STAT_CAP_INLINE_DATA , true); +if (err <0 || off >=i_size_read (inode)) { +unlock_page (page); +put_page (page); +if (err <0 ) + goto out_errno; + ret =VM_FAULT_SIGBUS ; }else { -int ret1; -struct address_space *mapping = inode->i_mapping; -struct page *page =find_or_create_page (mapping,0 , -mapping_gfp_constraint (mapping, - ~__GFP_FS)); -if (!page) { - ret =VM_FAULT_OOM ; - goto out_inline; - } - ret1 =__ceph_do_getattr (inode, page, -CEPH_STAT_CAP_INLINE_DATA , true); -if (ret1 <0 || off >=i_size_read (inode)) { -unlock_page (page); -put_page (page); -if (ret1 <0 ) - ret = ret1; -else - ret =VM_FAULT_SIGBUS ; - goto out_inline; - } -if (ret1 <PAGE_SIZE ) -zero_user_segment (page, ret1,PAGE_SIZE ); +if (err <PAGE_SIZE ) +zero_user_segment (page, err,PAGE_SIZE );else flush_dcache_page (page);SetPageUptodate (page); vmf->page = page; ret =VM_FAULT_MAJOR |VM_FAULT_LOCKED ; -out_inline: -dout ("filemap_fault %p %llu~%zd read inline data ret %d\n" , - inode, off, (size_t )PAGE_SIZE , ret); } + +out_inline: +dout ("filemap_fault %p %llu~%zd read inline data ret %d\n" , + inode, off, (size_t )PAGE_SIZE , ret); out_restore:ceph_restore_sigs (&oldset); -if (ret <0 ) - ret = (ret == -ENOMEM ) ?VM_FAULT_OOM :VM_FAULT_SIGBUS ; -return ret; +out_errno: + ret = (err == -ENOMEM ) ?VM_FAULT_OOM :VM_FAULT_SIGBUS ; + goto out_restore; }/* * Reuse write_begin here for simplicity. */ -static int ceph_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t ceph_page_mkwrite (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct inode *inode =file_inode (vma->vm_file);
@@ -1532,7 +1533,8 @@ static int ceph_page_mkwrite(struct vm_fault *vmf)loff_t off =page_offset (page);loff_t size =i_size_read (inode);size_t len; -int want, got, ret; +int want, got, err =0 ; +vm_fault_t ret =0 ;sigset_t oldset; prealloc_cf =ceph_alloc_cap_flush ();
@@ -1547,10 +1549,10 @@ static int ceph_page_mkwrite(struct vm_fault *vmf)lock_page (page); locked_page = page; } - ret =ceph_uninline_data (vma->vm_file, locked_page); + err =ceph_uninline_data (vma->vm_file, locked_page);if (locked_page)unlock_page (locked_page); -if (ret <0 ) +if (err <0 ) goto out_free; }
@@ -1567,9 +1569,9 @@ static int ceph_page_mkwrite(struct vm_fault *vmf) want =CEPH_CAP_FILE_BUFFER ; got =0 ; - ret =ceph_get_caps (ci,CEPH_CAP_FILE_WR , want, off + len, + err =ceph_get_caps (ci,CEPH_CAP_FILE_WR , want, off + len, &got,NULL ); -if (ret <0 ) +if (err <0 ) goto out_free; dout("page_mkwrite %p %llu~%zd got cap refs on %s\n",
@@ -1587,13 +1589,13 @@ static int ceph_page_mkwrite(struct vm_fault *vmf)break ; } - ret =ceph_update_writeable_page (vma->vm_file, off, len, page); -if (ret >=0 ) { + err =ceph_update_writeable_page (vma->vm_file, off, len, page); +if (err >=0 ) {/* success. we'll keep the page locked. */ set_page_dirty (page); ret =VM_FAULT_LOCKED ; } - }while (ret == -EAGAIN ); + }while (err == -EAGAIN );if (ret ==VM_FAULT_LOCKED || ci->i_inline_version !=CEPH_INLINE_NONE ) {
@@ -1608,13 +1610,13 @@ static int ceph_page_mkwrite(struct vm_fault *vmf) }dout ("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %d\n" , - inode, off, len,ceph_cap_string (got), ret); + inode, off, len,ceph_cap_string (got), err);ceph_put_cap_refs (ci, got); out_free:ceph_restore_sigs (&oldset);ceph_free_cap_flush (prealloc_cf); -if (ret <0 ) - ret = (ret == -ENOMEM ) ?VM_FAULT_OOM :VM_FAULT_SIGBUS ; +if (err <0 ) + ret = (err == -ENOMEM ) ?VM_FAULT_OOM :VM_FAULT_SIGBUS ;return ret; }
Signature · 1 line
2.17.0
PATCH 6/14 btrfs: separate errno from VM_FAULT_* values
In reply to Christoph Hellwig--- fs/btrfs/ctree.h | 2 +- fs/btrfs/inode.c | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-)
fs/btrfs/ctree.h +1 -1
@@ -3203,7 +3203,7 @@ int btrfs_merge_bio_hook(struct page *page, unsigned long offset, size_t size, struct bio *bio, unsigned long bio_flags);void btrfs_set_range_writeback (void *private_data,u64 start,u64 end); -int btrfs_page_mkwrite (struct vm_fault *vmf); +vm_fault_t btrfs_page_mkwrite (struct vm_fault *vmf);int btrfs_readpage (struct file *file,struct page *page);void btrfs_evict_inode (struct inode *inode);int btrfs_write_inode (struct inode *inode,struct writeback_control *wbc);
fs/btrfs/inode.c +10 -9
@@ -8824,7 +8824,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset,* beyond EOF, then the page is guaranteed safe against truncation until we * unlock the page. */ -int btrfs_page_mkwrite (struct vm_fault *vmf) +vm_fault_t btrfs_page_mkwrite (struct vm_fault *vmf) {struct page *page = vmf->page;struct inode *inode =file_inode (vmf->vma->vm_file);
@@ -8836,7 +8836,8 @@ int btrfs_page_mkwrite(struct vm_fault *vmf)char *kaddr;unsigned long zero_start;loff_t size; -int ret; +vm_fault_t ret; +int err;int reserved =0 ;u64 reserved_space;u64 page_start;
@@ -8858,14 +8859,14 @@ int btrfs_page_mkwrite(struct vm_fault *vmf)* end up waiting indefinitely to get a lock on the page currently * being processed by btrfs_page_mkwrite() function. */ - ret =btrfs_delalloc_reserve_space (inode, &data_reserved, page_start, + err =btrfs_delalloc_reserve_space (inode, &data_reserved, page_start, reserved_space); -if (!ret) { - ret =file_update_time (vmf->vma->vm_file); +if (!err) { + err =file_update_time (vmf->vma->vm_file); reserved =1 ; } -if (ret) { -if (ret == -ENOMEM ) +if (err) { +if (err == -ENOMEM ) ret =VM_FAULT_OOM ;else /* -ENOSPC, -EIO, etc */ ret =VM_FAULT_SIGBUS ;
@@ -8927,9 +8928,9 @@ int btrfs_page_mkwrite(struct vm_fault *vmf)EXTENT_DO_ACCOUNTING |EXTENT_DEFRAG , 0, 0, &cached_state); - ret =btrfs_set_extent_delalloc (inode, page_start, end,0 , + err =btrfs_set_extent_delalloc (inode, page_start, end,0 , &cached_state,0 ); -if (ret) { +if (err) {unlock_extent_cached (io_tree, page_start, page_end, &cached_state); ret =VM_FAULT_SIGBUS ;
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/14] btrfs: separate errno from VM_FAULT_* values
Quoted 1 line · Christoph Hellwig
Signed-off-by Christoph Hellwig <[email protected]>
I can add it to the btrfs queue now, unless you need the patch for the rest of the series.
PATCH 7/14 ext4: separate errno from VM_FAULT_* values
In reply to Christoph Hellwig--- fs/ext4/ext4.h | 4 ++-- fs/ext4/inode.c | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-)
fs/ext4/ext4.h +2 -2
@@ -2463,8 +2463,8 @@ extern int ext4_writepage_trans_blocks(struct inode *);extern int ext4_chunk_trans_blocks (struct inode *,int nrblocks);extern int ext4_zero_partial_blocks (handle_t *handle,struct inode *inode,loff_t lstart,loff_t lend); -extern int ext4_page_mkwrite (struct vm_fault *vmf); -extern int ext4_filemap_fault (struct vm_fault *vmf); +extern vm_fault_t ext4_page_mkwrite (struct vm_fault *vmf); +extern vm_fault_t ext4_filemap_fault (struct vm_fault *vmf);extern qsize_t *ext4_get_reserved_space (struct inode *inode);extern int ext4_get_projid (struct inode *inode,kprojid_t *projid); extern void ext4_da_update_reserve_space(struct inode *inode,
fs/ext4/inode.c +15 -15
@@ -6106,27 +6106,27 @@ static int ext4_bh_unmapped(handle_t *handle, struct buffer_head *bh)return !buffer_mapped (bh); } -int ext4_page_mkwrite (struct vm_fault *vmf) +vm_fault_t ext4_page_mkwrite (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct page *page = vmf->page;loff_t size;unsigned long len; -int ret; +vm_fault_t ret;struct file *file = vma->vm_file;struct inode *inode =file_inode (file);struct address_space *mapping = inode->i_mapping;handle_t *handle;get_block_t *get_block; -int retries =0 ; +int retries =0 , err;sb_start_pagefault (inode->i_sb);file_update_time (vma->vm_file);down_read (&EXT4_I (inode)->i_mmap_sem); - ret =ext4_convert_inline_data (inode); -if (ret) + err =ext4_convert_inline_data (inode); +if (err) goto out_ret;/* Delalloc case is easy... */
@@ -6134,9 +6134,9 @@ int ext4_page_mkwrite(struct vm_fault *vmf) !ext4_should_journal_data(inode) && !ext4_nonda_switch(inode->i_sb)) {do { - ret =block_page_mkwrite (vma, vmf, + err =block_page_mkwrite (vma, vmf, ext4_da_get_block_prep); - }while (ret == -ENOSPC && + }while (err == -ENOSPC &&ext4_should_retry_alloc (inode->i_sb, &retries)); goto out_ret; }
@@ -6181,8 +6181,8 @@ int ext4_page_mkwrite(struct vm_fault *vmf) ret =VM_FAULT_SIGBUS ; goto out; } - ret =block_page_mkwrite (vma, vmf, get_block); -if (!ret &&ext4_should_journal_data (inode)) { + err =block_page_mkwrite (vma, vmf, get_block); +if (!err &&ext4_should_journal_data (inode)) {if (ext4_walk_page_buffers (handle,page_buffers (page),0 ,PAGE_SIZE ,NULL , do_journal_get_write_access)) {unlock_page (page);
@@ -6193,24 +6193,24 @@ int ext4_page_mkwrite(struct vm_fault *vmf)ext4_set_inode_state (inode,EXT4_STATE_JDATA ); }ext4_journal_stop (handle); -if (ret == -ENOSPC &&ext4_should_retry_alloc (inode->i_sb, &retries)) +if (err == -ENOSPC &&ext4_should_retry_alloc (inode->i_sb, &retries)) goto retry_alloc; out_ret: - ret =block_page_mkwrite_return (ret); + ret =block_page_mkwrite_return (err); out:up_read (&EXT4_I (inode)->i_mmap_sem);sb_end_pagefault (inode->i_sb);return ret; } -int ext4_filemap_fault (struct vm_fault *vmf) +vm_fault_t ext4_filemap_fault (struct vm_fault *vmf) {struct inode *inode =file_inode (vmf->vma->vm_file); -int err; +vm_fault_t ret;down_read (&EXT4_I (inode)->i_mmap_sem); - err =filemap_fault (vmf); + ret =filemap_fault (vmf);up_read (&EXT4_I (inode)->i_mmap_sem); -return err; +return ret; }
Signature · 1 line
2.17.0
PATCH 8/14 ocfs2: separate errno from VM_FAULT_* values
In reply to Christoph Hellwig--- fs/ocfs2/mmap.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-)
fs/ocfs2/mmap.c +19 -17
@@ -44,11 +44,11 @@#include "ocfs2_trace.h" -static int ocfs2_fault (struct vm_fault *vmf) +static vm_fault_t ocfs2_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;sigset_t oldset; -int ret; +vm_fault_t ret;ocfs2_block_signals (&oldset); ret =filemap_fault (vmf);
@@ -59,10 +59,10 @@ static int ocfs2_fault(struct vm_fault *vmf)return ret; } -static int __ocfs2_page_mkwrite (struct file *file,struct buffer_head *di_bh, -struct page *page) +static vm_fault_t __ocfs2_page_mkwrite (struct file *file, +struct buffer_head *di_bh,struct page *page) { -int ret =VM_FAULT_NOPAGE ; +vm_fault_t ret =VM_FAULT_NOPAGE ;struct inode *inode =file_inode (file);struct address_space *mapping = inode->i_mapping;loff_t pos =page_offset (page);
@@ -71,6 +71,7 @@ static int __ocfs2_page_mkwrite(struct file *file, struct buffer_head *di_bh,struct page *locked_page =NULL ;void *fsdata;loff_t size =i_size_read (inode); +int err; last_index = (size -1 ) >>PAGE_SHIFT ;
@@ -105,12 +106,12 @@ static int __ocfs2_page_mkwrite(struct file *file, struct buffer_head *di_bh,if (page->index == last_index) len = ((size -1 ) & ~PAGE_MASK ) +1 ; - ret =ocfs2_write_begin_nolock (mapping, pos, len,OCFS2_WRITE_MMAP , + err =ocfs2_write_begin_nolock (mapping, pos, len,OCFS2_WRITE_MMAP , &locked_page, &fsdata, di_bh, page); -if (ret) { -if (ret != -ENOSPC ) -mlog_errno (ret); -if (ret == -ENOMEM ) +if (err) { +if (err != -ENOSPC ) +mlog_errno (err); +if (err == -ENOMEM ) ret =VM_FAULT_OOM ;else ret =VM_FAULT_SIGBUS ;
@@ -121,20 +122,21 @@ static int __ocfs2_page_mkwrite(struct file *file, struct buffer_head *di_bh, ret =VM_FAULT_NOPAGE ; goto out; } - ret =ocfs2_write_end_nolock (mapping, pos, len, len, fsdata); -BUG_ON (ret != len); + err =ocfs2_write_end_nolock (mapping, pos, len, len, fsdata); +BUG_ON (err != len); ret =VM_FAULT_LOCKED ; out:return ret; } -static int ocfs2_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t ocfs2_page_mkwrite (struct vm_fault *vmf) {struct page *page = vmf->page;struct inode *inode =file_inode (vmf->vma->vm_file);struct buffer_head *di_bh =NULL ;sigset_t oldset; -int ret; +vm_fault_t ret =0 ; +int err;sb_start_pagefault (inode->i_sb);ocfs2_block_signals (&oldset);
@@ -144,10 +146,10 @@ static int ocfs2_page_mkwrite(struct vm_fault *vmf)* node. Taking the data lock will also ensure that we don't * attempt page truncation as part of a downconvert. */ - ret =ocfs2_inode_lock (inode, &di_bh,1 ); -if (ret <0 ) { + err =ocfs2_inode_lock (inode, &di_bh,1 ); +if (err <0 ) {mlog_errno (ret); -if (ret == -ENOMEM ) +if (err == -ENOMEM ) ret =VM_FAULT_OOM ;else ret =VM_FAULT_SIGBUS ;
Signature · 1 line
2.17.0
PATCH 9/14 ubifs: separate errno from VM_FAULT_* values
In reply to Christoph Hellwig--- fs/ubifs/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/ubifs/file.c +4 -3
@@ -1513,7 +1513,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)* mmap()d file has taken write protection fault and is being made writable. * UBIFS must ensure page is budgeted for. */ -static int ubifs_vm_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t ubifs_vm_page_mkwrite (struct vm_fault *vmf) {struct page *page = vmf->page;struct inode *inode =file_inode (vmf->vma->vm_file);
@@ -1521,6 +1521,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)struct timespec now =current_time (inode);struct ubifs_budget_req req = { .new_page =1 };int err, update_time; +vm_fault_t ret =0 ;dbg_gen ("ino %lu, pg %lu, i_size %lld" , inode->i_ino, page->index,i_size_read (inode));
@@ -1601,8 +1602,8 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)unlock_page (page);ubifs_release_budget (c, &req);if (err) - err =VM_FAULT_SIGBUS ; -return err; + ret =VM_FAULT_SIGBUS ; +return ret; }static const struct vm_operations_struct ubifs_file_vm_ops = {
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 10/14 vgem: separate errno from VM_FAULT_* values
In reply to Christoph HellwigAnd streamline the code in vgem_fault with early returns so that it is a little bit more readable.
--- drivers/gpu/drm/vgem/vgem_drv.c | 51 +++++++++++++++------------------ 1 file changed, 23 insertions(+), 28 deletions(-)
drivers/gpu/drm/vgem/vgem_drv.c +23 -28
@@ -61,12 +61,13 @@ static void vgem_gem_free_object(struct drm_gem_object *obj)kfree (vgem_obj); } -static int vgem_gem_fault (struct vm_fault *vmf) +static vm_fault_t vgem_gem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_vgem_gem_object *obj = vma->vm_private_data;/* We don't use vmf->pgoff since that has the fake offset */ unsigned long vaddr = vmf->address; +struct page *page;int ret;loff_t num_pages;pgoff_t page_offset;
@@ -85,35 +86,29 @@ static int vgem_gem_fault(struct vm_fault *vmf) ret =0 ; }mutex_unlock (&obj->pages_lock); -if (ret) { -struct page *page; - - page =shmem_read_mapping_page ( -file_inode (obj->base.filp)->i_mapping, - page_offset); -if (!IS_ERR (page)) { - vmf->page = page; - ret =0 ; - }else switch (PTR_ERR (page)) { -case -ENOSPC : -case -ENOMEM : - ret =VM_FAULT_OOM ; -break ; -case -EBUSY : - ret =VM_FAULT_RETRY ; -break ; -case -EFAULT : -case -EINVAL : - ret =VM_FAULT_SIGBUS ; -break ; -default : -WARN_ON (PTR_ERR (page)); - ret =VM_FAULT_SIGBUS ; -break ; - } +if (!ret) +return 0 ; + + page =shmem_read_mapping_page (file_inode (obj->base.filp)->i_mapping, + page_offset); +if (!IS_ERR (page)) { + vmf->page = page; +return 0 ; + } +switch (PTR_ERR (page)) { +case -ENOSPC : +case -ENOMEM : +return VM_FAULT_OOM ; +case -EBUSY : +return VM_FAULT_RETRY ; +case -EFAULT : +case -EINVAL : +return VM_FAULT_SIGBUS ; +default : +WARN_ON (PTR_ERR (page)); +return VM_FAULT_SIGBUS ; } -return ret; }static const struct vm_operations_struct vgem_gem_vm_ops = {
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/14] vgem: separate errno from VM_FAULT_* values
Quoted 71 lines · Christoph Hellwig
And streamline the code in
vgem_faultwith early returns so that it is a little bit more readable.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/gpu/drm/vgem/vgem_drv.c | 51 +++++++++++++++------------------ 1 file changed, 23 insertions(+), 28 deletions(-)drivers/gpu/drm/vgem/vgem_drv.c +15
-27@@ -61,12 +61,13 @@ static void vgem_gem_free_object(struct drm_gem_object *obj)kfree (vgem_obj); } -static int vgem_gem_fault (struct vm_fault *vmf) +static vm_fault_t vgem_gem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_vgem_gem_object *obj = vma->vm_private_data;/* We don't use vmf->pgoff since that has the fake offset */ unsigned long vaddr = vmf->address; +struct page *page;int ret;loff_t num_pages;pgoff_t page_offset;@@ -85,35 +86,29 @@ static int vgem_gem_fault(struct vm_fault *vmf) ret =0 ; }mutex_unlock (&obj->pages_lock); -if (ret) { -struct page *page; - - page =shmem_read_mapping_page ( -file_inode (obj->base.filp)->i_mapping, - page_offset); -if (!IS_ERR (page)) { - vmf->page = page; - ret =0 ; - }else switch (PTR_ERR (page)) { -case -ENOSPC : -case -ENOMEM : - ret =VM_FAULT_OOM ; -break ; -case -EBUSY : - ret =VM_FAULT_RETRY ; -break ; -case -EFAULT : -case -EINVAL : - ret =VM_FAULT_SIGBUS ; -break ; -default : -WARN_ON (PTR_ERR (page)); - ret =VM_FAULT_SIGBUS ; -break ; - } +if (!ret) +return 0 ; + + page =shmem_read_mapping_page (file_inode (obj->base.filp)->i_mapping, + page_offset); +if (!IS_ERR (page)) { + vmf->page = page; +return 0 ; + } +switch (PTR_ERR (page)) { +case -ENOSPC : +case -ENOMEM : +return VM_FAULT_OOM ;
drivers/gpu/drm/vgem/vgem_drv.c static int vgem_gem_fault(struct vm_fault *vmf) · line 116
Quoted 10 lines
drivers/gpu/drm/vgem/vgem_drv.c +8
-1+case -EBUSY : +return VM_FAULT_RETRY ; +case -EFAULT : +case -EINVAL : +return VM_FAULT_SIGBUS ; +default : +WARN_ON (PTR_ERR (page)); +return VM_FAULT_SIGBUS ; } -return ret;
Want me to merge this through drm-misc or plan to pick it up yourself? -Daniel
Quoted 6 lines
drivers/gpu/drm/vgem/vgem_drv.c +0
-0}static const struct vm_operations_struct vgem_gem_vm_ops = {Signature · 1 line
2.17.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/14] vgem: separate errno from VM_FAULT_* values
Quoted 3 lines · Daniel Vetter
Reviewed-by Daniel Vetter <[email protected]>Want me to merge this through drm-misc or plan to pick it up yourself?
For now I just want a honest discussion if people really actually want the vm_fault_t change with the whole picture in place.
Matthew Wilcox
maintainerRe: [PATCH 10/14] vgem: separate errno from VM_FAULT_* values
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines · Daniel Vetter
Reviewed-by Daniel Vetter <[email protected]>Want me to merge this through drm-misc or plan to pick it up yourself?
For now I just want a honest discussion if people really actually want the
vm_fault_tchange with the whole picture in place.
That discussion already happened on the -mm mailing list. And again at LSFMM. Both times the answer was yes.
PATCH 11/14 ttm: separate errno from VM_FAULT_* values
In reply to Christoph Hellwig--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 42 +++++++++++++++++---------------- 1 file changed, 22 insertions(+), 20 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +22 -20
@@ -43,10 +43,11 @@#define TTM_BO_VM_NUM_PREFAULT 16 -static int ttm_bo_vm_fault_idle (struct ttm_buffer_object *bo, +static vm_fault_t ttm_bo_vm_fault_idle (struct ttm_buffer_object *bo,struct vm_fault *vmf) { -int ret =0 ; +vm_fault_t ret =0 ; +int err =0 ;if (likely (!bo->moving)) goto out_unlock;
@@ -77,8 +78,8 @@ static int ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,/* * Ordinary wait. */ - ret =dma_fence_wait (bo->moving, true); -if (unlikely (ret !=0 )) { + err =dma_fence_wait (bo->moving, true); +if (unlikely (err !=0 )) { ret = (ret != -ERESTARTSYS ) ?VM_FAULT_SIGBUS :VM_FAULT_NOPAGE ; goto out_unlock;
@@ -104,7 +105,7 @@ static unsigned long ttm_bo_io_mem_pfn(struct ttm_buffer_object *bo, + page_offset; } -static int ttm_bo_vm_fault (struct vm_fault *vmf) +static vm_fault_t ttm_bo_vm_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma; struct ttm_buffer_object *bo = (struct ttm_buffer_object *)
@@ -115,7 +116,8 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf)unsigned long pfn;struct ttm_tt *ttm =NULL ;struct page *page; -int ret; +vm_fault_t ret; +int err;int i;unsigned long address = vmf->address; struct ttm_mem_type_manager *man =
@@ -128,9 +130,9 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf)* for reserve, and if it fails, retry the fault after waiting * for the buffer to become unreserved. */ - ret =ttm_bo_reserve (bo, true, true,NULL ); -if (unlikely (ret !=0 )) { -if (ret != -EBUSY ) + err =ttm_bo_reserve (bo, true, true,NULL ); +if (unlikely (err !=0 )) { +if (err != -EBUSY )return VM_FAULT_NOPAGE ;if (vmf->flags &FAULT_FLAG_ALLOW_RETRY ) {
@@ -162,8 +164,8 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf) }if (bdev->driver->fault_reserve_notify) { - ret = bdev->driver->fault_reserve_notify (bo); -switch (ret) { + err = bdev->driver->fault_reserve_notify (bo); +switch (err) {case 0 :break ;case -EBUSY :
@@ -191,13 +193,13 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf) goto out_unlock; } - ret =ttm_mem_io_lock (man, true); -if (unlikely (ret !=0 )) { + err =ttm_mem_io_lock (man, true); +if (unlikely (err !=0 )) { ret =VM_FAULT_NOPAGE ; goto out_unlock; } - ret =ttm_mem_io_reserve_vm (bo); -if (unlikely (ret !=0 )) { + err =ttm_mem_io_reserve_vm (bo); +if (unlikely (err !=0 )) { ret =VM_FAULT_SIGBUS ; goto out_io_unlock; }
@@ -265,21 +267,21 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf) }if (vma->vm_flags &VM_MIXEDMAP ) - ret =vm_insert_mixed (&cvma, address, + err =vm_insert_mixed (&cvma, address,__pfn_to_pfn_t (pfn,PFN_DEV ));else - ret =vm_insert_pfn (&cvma, address, pfn); + err =vm_insert_pfn (&cvma, address, pfn);/* * Somebody beat us to this PTE or prefaulting to * an already populated PTE, or prefaulting error. */ -if (unlikely ((ret == -EBUSY ) || (ret !=0 && i >0 ))) +if (unlikely ((err == -EBUSY ) || (err !=0 && i >0 )))break ; -else if (unlikely (ret !=0 )) { +else if (unlikely (err !=0 )) { ret = - (ret == -ENOMEM ) ?VM_FAULT_OOM :VM_FAULT_SIGBUS ; + (err == -ENOMEM ) ?VM_FAULT_OOM :VM_FAULT_SIGBUS ; goto out_io_unlock; }
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 12/14 lustre: separate errno from VM_FAULT_* values
In reply to Christoph Hellwig--- .../staging/lustre/lustre/llite/llite_mmap.c | 37 +++++++------------ .../lustre/lustre/llite/vvp_internal.h | 2 +- 2 files changed, 14 insertions(+), 25 deletions(-)
drivers/staging/lustre/lustre/llite/llite_mmap.c +13 -24
@@ -231,23 +231,18 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,return result; } -static inline int to_fault_error (int result) +static inline vm_fault_t to_fault_error (int result) {switch (result) {case 0 : - result =VM_FAULT_LOCKED ; -break ; +return VM_FAULT_LOCKED ;case -EFAULT : - result =VM_FAULT_NOPAGE ; -break ; +return VM_FAULT_NOPAGE ;case -ENOMEM : - result =VM_FAULT_OOM ; -break ; +return VM_FAULT_OOM ;default : - result =VM_FAULT_SIGBUS ; -break ; +return VM_FAULT_SIGBUS ; } -return result; }/**
@@ -261,7 +256,7 @@ static inline int to_fault_error(int result)* \retval VM_FAULT_ERROR on general error * \retval NOPAGE_OOM not have memory for allocate new page */ -static int ll_fault0 (struct vm_area_struct *vma,struct vm_fault *vmf) +static vm_fault_t ll_fault0 (struct vm_area_struct *vma,struct vm_fault *vmf) {struct lu_env *env;struct cl_io *io;
@@ -269,7 +264,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)struct page *vmpage;unsigned long ra_flags;int result =0 ; -int fault_ret =0 ; +vm_fault_t fault_ret =0 ;u16 refcheck; env =cl_env_get (&refcheck);
@@ -323,7 +318,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)return fault_ret; } -static int ll_fault (struct vm_fault *vmf) +static vm_fault_t ll_fault (struct vm_fault *vmf) {int count =0 ;bool printed = false;
@@ -364,7 +359,7 @@ static int ll_fault(struct vm_fault *vmf)return result; } -static int ll_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t ll_page_mkwrite (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;int count =0 ;
@@ -390,22 +385,16 @@ static int ll_page_mkwrite(struct vm_fault *vmf)switch (result) {case 0 :LASSERT (PageLocked (vmf->page)); - result =VM_FAULT_LOCKED ; -break ; +return VM_FAULT_LOCKED ;case -ENODATA :case -EAGAIN :case -EFAULT : - result =VM_FAULT_NOPAGE ; -break ; +return VM_FAULT_NOPAGE ;case -ENOMEM : - result =VM_FAULT_OOM ; -break ; +return VM_FAULT_OOM ;default : - result =VM_FAULT_SIGBUS ; -break ; +return VM_FAULT_SIGBUS ; } - -return result; }/**
drivers/staging/lustre/lustre/llite/vvp_internal.h +1 -1
@@ -83,7 +83,7 @@ struct vvp_io {/** * fault API used bitflags for return code. */ -unsigned int ft_flags; +vm_fault_t ft_flags;/** * check that flags are from filemap_fault */
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 13/14 mm: move arch specific VM_FAULT_* flags to mm.h
In reply to Christoph HellwigVarious architectures define their own internal flags. Not sure a public header like mm.h is a good place, but keeping them inside the arch code with possible conflicts also seems like a bad idea. Maybe we just need to stop overloading the value instead.
--- arch/arm/mm/fault.c | 3 --- arch/arm64/mm/fault.c | 3 --- arch/s390/mm/fault.c | 6 ------ arch/unicore32/mm/fault.c | 3 --- include/linux/mm.h | 7 +++++++ 5 files changed, 7 insertions(+), 15 deletions(-)
arch/arm/mm/fault.c +0 -3
@@ -201,9 +201,6 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) }#ifdef CONFIG_MMU -#define VM_FAULT_BADMAP 0x010000 -#define VM_FAULT_BADACCESS 0x020000 -/* * Check that the permissions on the VMA allow for the fault which occurred. * If we encountered a write fault, we must have write permission, otherwise
arch/arm64/mm/fault.c +0 -3
@@ -318,9 +318,6 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re } } -#define VM_FAULT_BADMAP 0x010000 -#define VM_FAULT_BADACCESS 0x020000 -static int __do_page_fault (struct mm_struct *mm,unsigned long addr,unsigned int mm_flags,unsigned long vm_flags,struct task_struct *tsk)
arch/s390/mm/fault.c +0 -6
@@ -44,12 +44,6 @@#define __SUBCODE_MASK 0x0600#define __PF_RES_FIELD 0x8000000000000000ULL -#define VM_FAULT_BADCONTEXT 0x010000 -#define VM_FAULT_BADMAP 0x020000 -#define VM_FAULT_BADACCESS 0x040000 -#define VM_FAULT_SIGNAL 0x080000 -#define VM_FAULT_PFAULT 0x100000 -enum fault_type {KERNEL_FAULT ,USER_FAULT ,
arch/unicore32/mm/fault.c +0 -3
@@ -148,9 +148,6 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)__do_kernel_fault (mm, addr, fsr, regs); } -#define VM_FAULT_BADMAP 0x010000 -#define VM_FAULT_BADACCESS 0x020000 -/* * Check that the permissions on the VMA allow for the fault which occurred. * If we encountered a write fault, we must have write permission, otherwise
include/linux/mm.h +7 -0
@@ -1250,6 +1250,13 @@ static inline void clear_page_pfmemalloc(struct page *page)* and needs fsync() to complete (for * synchronous page faults in DAX) */ +/* Only for use in architecture specific page fault handling: */ +#define VM_FAULT_BADMAP 0x010000 +#define VM_FAULT_BADACCESS 0x020000 +#define VM_FAULT_BADCONTEXT 0x040000 +#define VM_FAULT_SIGNAL 0x080000 +#define VM_FAULT_PFAULT 0x100000 +#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \ VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE | \ VM_FAULT_FALLBACK)
Signature · 1 line
2.17.0
PATCH 14/14 mm: turn on vm_fault_t type checking
In reply to Christoph HellwigSwitch vm_fault_t to point to an unsigned int with __bіtwise annotations. This both catches any old ->fault or ->page_mkwrite instance with plain compiler type checking, as well as finding more intricate problems with sparse.
--- arch/alpha/mm/fault.c | 2 +- arch/arc/mm/fault.c | 3 +- arch/arm/mm/fault.c | 5 +- arch/arm64/mm/fault.c | 7 +- arch/hexagon/mm/vm_fault.c | 2 +- arch/ia64/mm/fault.c | 2 +- arch/m68k/mm/fault.c | 2 +- arch/microblaze/mm/fault.c | 2 +- arch/mips/mm/fault.c | 2 +- arch/nds32/mm/fault.c | 2 +- arch/nios2/mm/fault.c | 2 +- arch/openrisc/mm/fault.c | 2 +- arch/parisc/mm/fault.c | 2 +- arch/powerpc/include/asm/copro.h | 2 +- arch/powerpc/mm/copro_fault.c | 2 +- arch/powerpc/mm/fault.c | 10 +-- arch/powerpc/platforms/cell/spufs/fault.c | 2 +- arch/riscv/mm/fault.c | 3 +- arch/s390/kernel/vdso.c | 2 +- arch/s390/mm/fault.c | 2 +- arch/sh/mm/fault.c | 2 +- arch/sparc/mm/fault_32.c | 4 +- arch/sparc/mm/fault_64.c | 3 +- arch/um/kernel/trap.c | 2 +- arch/unicore32/mm/fault.c | 10 +-- arch/x86/entry/vdso/vma.c | 4 +- arch/x86/mm/fault.c | 11 +-- arch/xtensa/mm/fault.c | 2 +- drivers/dax/device.c | 21 +++--- drivers/gpu/drm/drm_vm.c | 10 +-- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.h | 2 +- drivers/gpu/drm/gma500/framebuffer.c | 6 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/psb_drv.h | 2 +- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gem.c | 21 ++---- drivers/gpu/drm/msm/msm_drv.h | 2 +- drivers/gpu/drm/msm/msm_gem.c | 2 +- drivers/gpu/drm/qxl/qxl_ttm.c | 4 +- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- drivers/gpu/drm/udl/udl_drv.h | 2 +- drivers/gpu/drm/udl/udl_gem.c | 2 +- drivers/gpu/drm/vc4/vc4_bo.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- drivers/hwtracing/intel_th/msu.c | 2 +- drivers/iommu/amd_iommu_v2.c | 2 +- drivers/iommu/intel-svm.c | 3 +- drivers/misc/cxl/fault.c | 2 +- drivers/misc/ocxl/context.c | 6 +- drivers/misc/ocxl/link.c | 2 +- drivers/misc/ocxl/sysfs.c | 2 +- drivers/scsi/cxlflash/superpipe.c | 4 +- drivers/staging/ncpfs/mmap.c | 2 +- drivers/xen/privcmd.c | 2 +- fs/9p/vfs_file.c | 2 +- fs/afs/internal.h | 2 +- fs/afs/write.c | 2 +- fs/f2fs/file.c | 10 +-- fs/fuse/file.c | 2 +- fs/gfs2/file.c | 2 +- fs/iomap.c | 2 +- fs/nfs/file.c | 4 +- fs/nilfs2/file.c | 2 +- fs/proc/vmcore.c | 2 +- fs/userfaultfd.c | 4 +- fs/xfs/xfs_file.c | 12 ++-- include/linux/huge_mm.h | 13 ++-- include/linux/hugetlb.h | 2 +- include/linux/iomap.h | 4 +- include/linux/mm.h | 67 +++++++++-------- include/linux/mm_types.h | 5 +- include/linux/oom.h | 2 +- include/linux/swapops.h | 4 +- include/linux/userfaultfd_k.h | 5 +- ipc/shm.c | 2 +- kernel/events/core.c | 4 +- mm/gup.c | 7 +- mm/hmm.c | 2 +- mm/huge_memory.c | 29 ++++---- mm/hugetlb.c | 25 +++---- mm/internal.h | 2 +- mm/khugepaged.c | 3 +- mm/ksm.c | 2 +- mm/memory.c | 88 ++++++++++++----------- mm/mmap.c | 4 +- mm/shmem.c | 9 +-- samples/vfio-mdev/mbochs.c | 4 +- virt/kvm/kvm_main.c | 2 +- 91 files changed, 285 insertions(+), 259 deletions(-)
arch/alpha/mm/fault.c +1 -1
@@ -88,7 +88,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,struct mm_struct *mm = current->mm;const struct exception_table_entry *fixup;int fault, si_code =SEGV_MAPERR ; -unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; +vm_fault_t flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;/* As of EV6, a load into $31/$f31 is a prefetch, and never faults (or is suppressed by the PALcode). Support that for older CPUs
arch/arc/mm/fault.c +2 -1
@@ -66,7 +66,8 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)struct task_struct *tsk = current;struct mm_struct *mm = tsk->mm;siginfo_t info; -int fault, ret; +vm_fault_t fault; +int ret;int write = regs->ecr_cause &ECR_C_PROTV_STORE ;/* ST/EX */ unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;
arch/arm/mm/fault.c +3 -2
@@ -218,7 +218,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)return vma->vm_flags & mask ? false : true; } -static int __kprobes +static vm_fault_t __kprobes __do_page_fault (struct mm_struct *mm,unsigned long addr,unsigned int fsr,unsigned int flags,struct task_struct *tsk) {
@@ -258,7 +258,8 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) {struct task_struct *tsk;struct mm_struct *mm; -int fault, sig, code; +vm_fault_t fault; +int sig, code;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;if (notify_page_fault (regs, fsr))
arch/arm64/mm/fault.c +4 -3
@@ -318,7 +318,7 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re } } -static int __do_page_fault (struct mm_struct *mm,unsigned long addr, +static vm_fault_t __do_page_fault (struct mm_struct *mm,unsigned long addr,unsigned int mm_flags,unsigned long vm_flags,struct task_struct *tsk) {
@@ -366,7 +366,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,struct task_struct *tsk;struct mm_struct *mm;struct siginfo si; -int fault, major =0 ; +vm_fault_t fault; +int major =0 ;unsigned long vm_flags =VM_READ |VM_WRITE ;unsigned int mm_flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;
@@ -430,7 +431,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, } fault =__do_page_fault (mm, addr, mm_flags, vm_flags, tsk); - major |= fault &VM_FAULT_MAJOR ; + major |= !!(fault &VM_FAULT_MAJOR );if (fault &VM_FAULT_RETRY ) {/*
arch/hexagon/mm/vm_fault.c +1 -1
@@ -52,7 +52,7 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)struct mm_struct *mm = current->mm;int si_signo;int si_code =SEGV_MAPERR ; -int fault; +vm_fault_t fault;const struct exception_table_entry *fixup;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;
arch/ia64/mm/fault.c +1 -1
@@ -86,7 +86,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *restruct vm_area_struct *vma, *prev_vma;struct mm_struct *mm = current->mm;unsigned long mask; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; mask = ((((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT)
arch/m68k/mm/fault.c +1 -1
@@ -70,7 +70,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address, {struct mm_struct *mm = current->mm;struct vm_area_struct * vma; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; pr_debug("do page fault:\nregs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n",
arch/microblaze/mm/fault.c +1 -1
@@ -90,7 +90,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,struct mm_struct *mm = current->mm;int code =SEGV_MAPERR ;int is_write = error_code &ESR_S ; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; regs->ear = address;
arch/mips/mm/fault.c +1 -1
@@ -43,7 +43,7 @@ static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long write,struct mm_struct *mm = tsk->mm;const int field =sizeof (unsigned long ) *2 ;int si_code; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
arch/nds32/mm/fault.c +1 -1
@@ -73,7 +73,7 @@ void do_page_fault(unsigned long entry, unsigned long addr,struct mm_struct *mm;struct vm_area_struct *vma;int si_code; -int fault; +vm_fault_t fault;unsigned int mask =VM_READ |VM_WRITE |VM_EXEC ;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;
arch/nios2/mm/fault.c +1 -1
@@ -47,7 +47,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long cause,struct task_struct *tsk = current;struct mm_struct *mm = tsk->mm;int code =SEGV_MAPERR ; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; cause >>=2 ;
arch/openrisc/mm/fault.c +1 -1
@@ -53,7 +53,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,struct mm_struct *mm;struct vm_area_struct *vma;int si_code; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; tsk = current;
arch/parisc/mm/fault.c +1 -1
@@ -262,7 +262,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,struct task_struct *tsk;struct mm_struct *mm;unsigned long acc_type; -int fault =0 ; +vm_fault_t fault =0 ;unsigned int flags;if (faulthandler_disabled ())
arch/powerpc/include/asm/copro.h +1 -1
@@ -16,7 +16,7 @@ struct copro_slb };int copro_handle_mm_fault (struct mm_struct *mm,unsigned long ea, -unsigned long dsisr,unsigned *flt); +unsigned long dsisr,vm_fault_t *flt);int copro_calculate_slb (struct mm_struct *mm,u64 ea,struct copro_slb *slb);
arch/powerpc/mm/copro_fault.c +1 -1
@@ -34,7 +34,7 @@* to handle fortunately. */ int copro_handle_mm_fault (struct mm_struct *mm,unsigned long ea, -unsigned long dsisr,unsigned *flt) +unsigned long dsisr,vm_fault_t *flt) {struct vm_area_struct *vma;unsigned long is_write;
arch/powerpc/mm/fault.c +6 -4
@@ -159,7 +159,7 @@ static noinline int bad_access(struct pt_regs *regs, unsigned long address) }static int do_sigbus (struct pt_regs *regs,unsigned long address, -unsigned int fault) +vm_fault_t fault) {siginfo_t info;unsigned int lsb =0 ;
@@ -190,7 +190,8 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,return 0 ; } -static int mm_fault_error (struct pt_regs *regs,unsigned long addr,int fault) +static int mm_fault_error (struct pt_regs *regs,unsigned long addr, +vm_fault_t fault) {/* * Kernel page fault interrupted by SIGKILL. We have no reason to
@@ -403,7 +404,8 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,int is_exec =TRAP (regs) ==0x400 ;int is_user =user_mode (regs);int is_write =page_fault_is_write (error_code); -int fault, major =0 ; +vm_fault_t fault; +int major =0 ;bool store_update_sp = false;if (notify_page_fault (regs))
@@ -537,7 +539,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, }#endif /* CONFIG_PPC_MEM_KEYS */ - major |= fault &VM_FAULT_MAJOR ; + major |= !!(fault &VM_FAULT_MAJOR );/* * Handle the retry right now, the mmap_sem has been released in that
arch/powerpc/platforms/cell/spufs/fault.c +1 -1
@@ -111,7 +111,7 @@ int spufs_handle_class1(struct spu_context *ctx) {u64 ea, dsisr, access;unsigned long flags; -unsigned flt =0 ; +vm_fault_t flt =0 ;int ret;/*
arch/riscv/mm/fault.c +2 -1
@@ -41,7 +41,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs)struct mm_struct *mm;unsigned long addr, cause;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; -int fault, code =SEGV_MAPERR ; +int code =SEGV_MAPERR ; +vm_fault_t fault; cause = regs->scause; addr = regs->sbadaddr;
arch/s390/kernel/vdso.c +1 -1
@@ -47,7 +47,7 @@ static struct page **vdso64_pagelist;*/ unsigned int __read_mostly vdso_enabled =1 ; -static int vdso_fault (const struct vm_special_mapping *sm, +static vm_fault_t vdso_fault (const struct vm_special_mapping *sm,struct vm_area_struct *vma,struct vm_fault *vmf) {struct page **vdso_pagelist;
arch/s390/mm/fault.c +1 -1
@@ -405,7 +405,7 @@ static inline int do_exception(struct pt_regs *regs, int access)unsigned long trans_exc_code;unsigned long address;unsigned int flags; -int fault; +vm_fault_t fault; tsk = current;/*
arch/sh/mm/fault.c +1 -1
@@ -396,7 +396,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,struct task_struct *tsk;struct mm_struct *mm;struct vm_area_struct * vma; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; tsk = current;
arch/sparc/mm/fault_32.c +2 -2
@@ -165,8 +165,8 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,struct mm_struct *mm = tsk->mm;unsigned int fixup;unsigned long g2; -int from_user = !(regs->psr &PSR_PS ); -int fault, code; +int from_user = !(regs->psr &PSR_PS ), code; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;if (text_fault)
arch/sparc/mm/fault_64.c +2 -1
@@ -278,7 +278,8 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)struct mm_struct *mm = current->mm;struct vm_area_struct *vma;unsigned int insn =0 ; -int si_code, fault_code, fault; +int si_code, fault_code; +vm_fault_t fault;unsigned long address, mm_rss;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;
arch/um/kernel/trap.c +1 -1
@@ -72,7 +72,7 @@ int handle_page_fault(unsigned long address, unsigned long ip, } do { - int fault; + vm_fault_t fault; fault = handle_mm_fault(vma, address, flags);
arch/unicore32/mm/fault.c +5 -5
@@ -165,8 +165,8 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)return vma->vm_flags & mask ? false : true; } -static int __do_pf (struct mm_struct *mm,unsigned long addr,unsigned int fsr, -unsigned int flags,struct task_struct *tsk) +static vm_fault_t __do_pf (struct mm_struct *mm,unsigned long addr, +unsigned int fsr,unsigned int flags,struct task_struct *tsk) {struct vm_area_struct *vma;int fault;
@@ -192,8 +192,7 @@ static int __do_pf(struct mm_struct *mm, unsigned long addr, unsigned int fsr,* If for any reason at all we couldn't handle the fault, make * sure we exit gracefully rather than endlessly redo the fault. */ - fault =handle_mm_fault (vma, addr &PAGE_MASK , flags); -return fault; +return handle_mm_fault (vma, addr &PAGE_MASK , flags); check_stack:if (vma->vm_flags &VM_GROWSDOWN && !expand_stack (vma, addr))
@@ -206,7 +205,8 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) {struct task_struct *tsk;struct mm_struct *mm; -int fault, sig, code; +int sig, code; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; tsk = current;
arch/x86/entry/vdso/vma.c +2 -2
@@ -39,7 +39,7 @@ void __init init_vdso_image(const struct vdso_image *image)struct linux_binprm ; -static int vdso_fault (const struct vm_special_mapping *sm, +static vm_fault_t vdso_fault (const struct vm_special_mapping *sm,struct vm_area_struct *vma,struct vm_fault *vmf) {const struct vdso_image *image = vma->vm_mm->context.vdso_image;
@@ -84,7 +84,7 @@ static int vdso_mremap(const struct vm_special_mapping *sm,return 0 ; } -static int vvar_fault (const struct vm_special_mapping *sm, +static vm_fault_t vvar_fault (const struct vm_special_mapping *sm,struct vm_area_struct *vma,struct vm_fault *vmf) {const struct vdso_image *image = vma->vm_mm->context.vdso_image;
arch/x86/mm/fault.c +6 -5
@@ -204,7 +204,7 @@ static void fill_sig_info_pkey(int si_signo, int si_code, siginfo_t *info,static void force_sig_info_fault (int si_signo,int si_code,unsigned long address, -struct task_struct *tsk,u32 *pkey,int fault) +struct task_struct *tsk,u32 *pkey,vm_fault_t fault) {unsigned lsb =0 ;siginfo_t info;
@@ -976,7 +976,7 @@ bad_area_access_error(struct pt_regs *regs, unsigned long error_code,static void do_sigbus (struct pt_regs *regs,unsigned long error_code,unsigned long address, -u32 *pkey,unsigned int fault) +u32 *pkey,vm_fault_t fault) {struct task_struct *tsk = current;int code =BUS_ADRERR ;
@@ -1008,7 +1008,7 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, static noinline voidmm_fault_error (struct pt_regs *regs,unsigned long error_code, -unsigned long address,u32 *pkey,unsigned int fault) +unsigned long address,u32 *pkey,vm_fault_t fault) {if (fatal_signal_pending (current) && !(error_code &X86_PF_USER )) {no_context (regs, error_code, address,0 ,0 );
@@ -1222,7 +1222,8 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,struct vm_area_struct *vma;struct task_struct *tsk;struct mm_struct *mm; -int fault, major =0 ; +int major =0 ; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ;u32 pkey;
@@ -1401,7 +1402,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,*/ pkey =vma_pkey (vma); fault =handle_mm_fault (vma, address, flags); - major |= fault &VM_FAULT_MAJOR ; + major |= !!(fault &VM_FAULT_MAJOR );/* * If we need to retry the mmap_sem has already been released,
arch/xtensa/mm/fault.c +1 -1
@@ -42,7 +42,7 @@ void do_page_fault(struct pt_regs *regs)int code;int is_write, is_exec; -int fault; +vm_fault_t fault;unsigned int flags =FAULT_FLAG_ALLOW_RETRY |FAULT_FLAG_KILLABLE ; code =SEGV_MAPERR ;
drivers/dax/device.c +13 -8
@@ -244,11 +244,12 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,return -1 ; } -static int __dev_dax_pte_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pte_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {struct device *dev = &dev_dax->dev;struct dax_region *dax_region; -int rc =VM_FAULT_SIGBUS ; +vm_fault_t rc =VM_FAULT_SIGBUS ;phys_addr_t phys;pfn_t pfn;unsigned int fault_size =PAGE_SIZE ;
@@ -284,7 +285,8 @@ static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf)return VM_FAULT_NOPAGE ; } -static int __dev_dax_pmd_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pmd_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {unsigned long pmd_addr = vmf->address &PMD_MASK ;struct device *dev = &dev_dax->dev;
@@ -334,7 +336,8 @@ static int __dev_dax_pmd_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) }#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD -static int __dev_dax_pud_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pud_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {unsigned long pud_addr = vmf->address &PUD_MASK ;struct device *dev = &dev_dax->dev;
@@ -384,16 +387,18 @@ static int __dev_dax_pud_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) vmf->flags & FAULT_FLAG_WRITE); }#else -static int __dev_dax_pud_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pud_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {return VM_FAULT_FALLBACK ; }#endif /* !CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ -static int dev_dax_huge_fault (struct vm_fault *vmf, +static vm_fault_t dev_dax_huge_fault (struct vm_fault *vmf,enum page_entry_size pe_size) { -int rc, id; +vm_fault_t rc; +int id;struct file *filp = vmf->vma->vm_file;struct dev_dax *dev_dax = filp->private_data;
@@ -420,7 +425,7 @@ static int dev_dax_huge_fault(struct vm_fault *vmf,return rc; } -static int dev_dax_fault (struct vm_fault *vmf) +static vm_fault_t dev_dax_fault (struct vm_fault *vmf) {return dev_dax_huge_fault (vmf,PE_SIZE_PTE ); }
drivers/gpu/drm/drm_vm.c +5 -5
@@ -100,7 +100,7 @@ static pgprot_t drm_dma_prot(uint32_t map_type, struct vm_area_struct *vma)* map, get the page, increment the use count and return it. */ #if IS_ENABLED (CONFIG_AGP ) -static int drm_vm_fault (struct vm_fault *vmf) +static vm_fault_t drm_vm_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_file *priv = vma->vm_file->private_data;
@@ -173,7 +173,7 @@ static int drm_vm_fault(struct vm_fault *vmf) return VM_FAULT_SIGBUS; /* Disallow mremap */ }#else -static int drm_vm_fault (struct vm_fault *vmf) +static vm_fault_t drm_vm_fault (struct vm_fault *vmf) {return VM_FAULT_SIGBUS ; }
@@ -189,7 +189,7 @@ static int drm_vm_fault(struct vm_fault *vmf)* Get the mapping, find the real physical page to map, get the page, and * return it. */ -static int drm_vm_shm_fault (struct vm_fault *vmf) +static vm_fault_t drm_vm_shm_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_local_map *map = vma->vm_private_data;
@@ -291,7 +291,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)* * Determine the page number from the page offset and get it from drm_device_dma::pagelist. */ -static int drm_vm_dma_fault (struct vm_fault *vmf) +static vm_fault_t drm_vm_dma_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_file *priv = vma->vm_file->private_data;
@@ -326,7 +326,7 @@ static int drm_vm_dma_fault(struct vm_fault *vmf)* * Determine the map offset from the page offset and get it from drm_sg_mem::pagelist. */ -static int drm_vm_sg_fault (struct vm_fault *vmf) +static vm_fault_t drm_vm_sg_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_local_map *map = vma->vm_private_data;
drivers/gpu/drm/etnaviv/etnaviv_drv.h +1 -1
@@ -64,7 +64,7 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data, struct drm_file *file);int etnaviv_gem_mmap (struct file *filp,struct vm_area_struct *vma); -int etnaviv_gem_fault (struct vm_fault *vmf); +vm_fault_t etnaviv_gem_fault (struct vm_fault *vmf);int etnaviv_gem_mmap_offset (struct drm_gem_object *obj,u64 *offset);struct sg_table *etnaviv_gem_prime_get_sg_table (struct drm_gem_object *obj);void *etnaviv_gem_prime_vmap (struct drm_gem_object *obj);
drivers/gpu/drm/etnaviv/etnaviv_gem.c +1 -1
@@ -180,7 +180,7 @@ int etnaviv_gem_mmap(struct file *filp, struct vm_area_struct *vma)return obj->ops->mmap (obj, vma); } -int etnaviv_gem_fault (struct vm_fault *vmf) +vm_fault_t etnaviv_gem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_gem_object *obj = vma->vm_private_data;
drivers/gpu/drm/exynos/exynos_drm_gem.c +1 -1
@@ -431,7 +431,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,return 0 ; } -int exynos_drm_gem_fault (struct vm_fault *vmf) +vm_fault_t exynos_drm_gem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_gem_object *obj = vma->vm_private_data;
drivers/gpu/drm/exynos/exynos_drm_gem.h +1 -1
@@ -111,7 +111,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_mode_create_dumb *args);/* page fault handler and mmap fault address(virtual) to physical memory. */ -int exynos_drm_gem_fault (struct vm_fault *vmf); +vm_fault_t exynos_drm_gem_fault (struct vm_fault *vmf);/* set vm_flags and we can change the vm attribute to other one at here. */ int exynos_drm_gem_mmap (struct file *filp,struct vm_area_struct *vma);
drivers/gpu/drm/gma500/framebuffer.c +3 -3
@@ -111,7 +111,7 @@ static int psbfb_pan(struct fb_var_screeninfo *var, struct fb_info *info)return 0 ; } -static int psbfb_vm_fault (struct vm_fault *vmf) +static vm_fault_t psbfb_vm_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct psb_framebuffer *psbfb = vma->vm_private_data;
@@ -138,8 +138,8 @@ static int psbfb_vm_fault(struct vm_fault *vmf)if (unlikely ((ret == -EBUSY ) || (ret !=0 && i >0 )))break ;else if (unlikely (ret !=0 )) { - ret = (ret == -ENOMEM ) ?VM_FAULT_OOM :VM_FAULT_SIGBUS ; -return ret; +return (ret == -ENOMEM ) ? +VM_FAULT_OOM :VM_FAULT_SIGBUS ; } address +=PAGE_SIZE ; phys_addr +=PAGE_SIZE ;
drivers/gpu/drm/gma500/gem.c +1 -1
@@ -134,7 +134,7 @@ int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,* vma->vm_private_data points to the GEM object that is backing this * mapping. */ -int psb_gem_fault (struct vm_fault *vmf) +vm_fault_t psb_gem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_gem_object *obj;
drivers/gpu/drm/gma500/psb_drv.h +1 -1
@@ -749,7 +749,7 @@ extern int psb_gem_get_aperture(struct drm_device *dev, void *data, struct drm_file *file);extern int psb_gem_dumb_create (struct drm_file *file,struct drm_device *dev,struct drm_mode_create_dumb *args); -extern int psb_gem_fault (struct vm_fault *vmf); +extern vm_fault_t psb_gem_fault (struct vm_fault *vmf);/* psb_device.c */ extern const struct psb_ops psb_chip_ops;
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -3169,7 +3169,7 @@ int i915_gem_wait_for_idle(struct drm_i915_private *dev_priv, unsigned int flags);int __must_check i915_gem_suspend (struct drm_i915_private *dev_priv);void i915_gem_resume (struct drm_i915_private *dev_priv); -int i915_gem_fault (struct vm_fault *vmf); +vm_fault_t i915_gem_fault (struct vm_fault *vmf); int i915_gem_object_wait(struct drm_i915_gem_object *obj, unsigned int flags, long timeout,
drivers/gpu/drm/i915/i915_gem.c +7 -14
@@ -1991,7 +1991,7 @@ compute_partial_view(struct drm_i915_gem_object *obj,* The current feature set supported by i915_gem_fault() and thus GTT mmaps * is exposed via I915_PARAM_MMAP_GTT_VERSION (see i915_gem_mmap_gtt_version). */ -int i915_gem_fault (struct vm_fault *vmf) +vm_fault_t i915_gem_fault (struct vm_fault *vmf) {#define MIN_CHUNK_PAGES ((1 << 20) >> PAGE_SHIFT)/* 1 MiB */ struct vm_area_struct *area = vmf->vma;
@@ -2108,10 +2108,8 @@ int i915_gem_fault(struct vm_fault *vmf)* fail). But any other -EIO isn't ours (e.g. swap in failure) * and so needs to be reported. */ -if (!i915_terminally_wedged (&dev_priv->gpu_error)) { - ret =VM_FAULT_SIGBUS ; -break ; - } +if (!i915_terminally_wedged (&dev_priv->gpu_error)) +return VM_FAULT_SIGBUS ;case -EAGAIN :/* * EAGAIN means the gpu is hung and we'll wait for the error
@@ -2126,21 +2124,16 @@ int i915_gem_fault(struct vm_fault *vmf)* EBUSY is ok: this just means that another thread * already did the job. */ - ret =VM_FAULT_NOPAGE ; -break ; +return VM_FAULT_NOPAGE ;case -ENOMEM : - ret =VM_FAULT_OOM ; -break ; +return VM_FAULT_OOM ;case -ENOSPC :case -EFAULT : - ret =VM_FAULT_SIGBUS ; -break ; +return VM_FAULT_SIGBUS ;default :WARN_ONCE (ret,"unhandled error in i915_gem_fault: %i\n" , ret); - ret =VM_FAULT_SIGBUS ; -break ; +return VM_FAULT_SIGBUS ; } -return ret; }static void __i915_gem_object_release_mmap (struct drm_i915_gem_object *obj)
drivers/gpu/drm/msm/msm_drv.h +1 -1
@@ -184,7 +184,7 @@ void msm_gem_shrinker_cleanup(struct drm_device *dev);int msm_gem_mmap_obj (struct drm_gem_object *obj,struct vm_area_struct *vma);int msm_gem_mmap (struct file *filp,struct vm_area_struct *vma); -int msm_gem_fault (struct vm_fault *vmf); +vm_fault_t msm_gem_fault (struct vm_fault *vmf);uint64_t msm_gem_mmap_offset (struct drm_gem_object *obj);int msm_gem_get_iova (struct drm_gem_object *obj,struct msm_gem_address_space *aspace,uint64_t *iova);
drivers/gpu/drm/msm/msm_gem.c +1 -1
@@ -219,7 +219,7 @@ int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma)return msm_gem_mmap_obj (vma->vm_private_data, vma); } -int msm_gem_fault (struct vm_fault *vmf) +vm_fault_t msm_gem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_gem_object *obj = vma->vm_private_data;
drivers/gpu/drm/qxl/qxl_ttm.c +2 -2
@@ -105,10 +105,10 @@ static void qxl_ttm_global_fini(struct qxl_device *qdev)static struct vm_operations_struct qxl_ttm_vm_ops;static const struct vm_operations_struct *ttm_vm_ops; -static int qxl_ttm_fault (struct vm_fault *vmf) +static vm_fault_t qxl_ttm_fault (struct vm_fault *vmf) {struct ttm_buffer_object *bo; -int r; +vm_fault_t r; bo = (struct ttm_buffer_object *)vmf->vma->vm_private_data;if (bo ==NULL )
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
@@ -947,7 +947,7 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)static struct vm_operations_struct radeon_ttm_vm_ops;static const struct vm_operations_struct *ttm_vm_ops =NULL ; -static int radeon_ttm_fault (struct vm_fault *vmf) +static vm_fault_t radeon_ttm_fault (struct vm_fault *vmf) {struct ttm_buffer_object *bo;struct radeon_device *rdev;
drivers/gpu/drm/udl/udl_drv.h +1 -1
@@ -136,7 +136,7 @@ void udl_gem_put_pages(struct udl_gem_object *obj);int udl_gem_vmap (struct udl_gem_object *obj);void udl_gem_vunmap (struct udl_gem_object *obj);int udl_drm_gem_mmap (struct file *filp,struct vm_area_struct *vma); -int udl_gem_fault (struct vm_fault *vmf); +vm_fault_t udl_gem_fault (struct vm_fault *vmf);int udl_handle_damage (struct udl_framebuffer *fb,int x,int y,int width,int height);
drivers/gpu/drm/udl/udl_gem.c +1 -1
@@ -100,7 +100,7 @@ int udl_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)return ret; } -int udl_gem_fault (struct vm_fault *vmf) +vm_fault_t udl_gem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct udl_gem_object *obj =to_udl_bo (vma->vm_private_data);
drivers/gpu/drm/vc4/vc4_bo.c +1 -1
@@ -721,7 +721,7 @@ vc4_prime_export(struct drm_device *dev, struct drm_gem_object *obj, int flags)return dmabuf; } -int vc4_fault (struct vm_fault *vmf) +vm_fault_t vc4_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct drm_gem_object *obj = vma->vm_private_data;
drivers/gpu/drm/vc4/vc4_drv.h +1 -1
@@ -673,7 +673,7 @@ int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv);int vc4_label_bo_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); -int vc4_fault (struct vm_fault *vmf); +vm_fault_t vc4_fault (struct vm_fault *vmf);int vc4_mmap (struct file *filp,struct vm_area_struct *vma);struct reservation_object *vc4_prime_res_obj (struct drm_gem_object *obj);int vc4_prime_mmap (struct drm_gem_object *obj,struct vm_area_struct *vma);
drivers/hwtracing/intel_th/msu.c +1 -1
@@ -1182,7 +1182,7 @@ static void msc_mmap_close(struct vm_area_struct *vma)mutex_unlock (&msc->buf_mutex); } -static int msc_mmap_fault (struct vm_fault *vmf) +static vm_fault_t msc_mmap_fault (struct vm_fault *vmf) {struct msc_iter *iter = vmf->vma->vm_file->private_data;struct msc *msc = iter->msc;
drivers/iommu/amd_iommu_v2.c +1 -1
@@ -508,7 +508,7 @@ static void do_fault(struct work_struct *work) { struct fault *fault = container_of(work, struct fault, work);struct vm_area_struct *vma; -int ret =VM_FAULT_ERROR ; +vm_fault_t ret =VM_FAULT_ERROR ;unsigned int flags =0 ;struct mm_struct *mm;u64 address;
drivers/iommu/intel-svm.c +2 -1
@@ -594,7 +594,8 @@ static irqreturn_t prq_event_thread(int irq, void *d)struct vm_area_struct *vma;struct page_req_dsc *req;struct qi_desc resp; -int ret, result; +int result; +vm_fault_t ret;u64 address; handled =1 ;
drivers/misc/cxl/fault.c +1 -1
@@ -134,7 +134,7 @@ static int cxl_handle_segment_miss(struct cxl_context *ctx,int cxl_handle_mm_fault (struct mm_struct *mm,u64 dsisr,u64 dar) { -unsigned flt =0 ; +vm_fault_t flt =0 ;int result;unsigned long access, flags, inv_flags =0 ;
drivers/misc/ocxl/context.c +3 -3
@@ -83,7 +83,7 @@ int ocxl_context_attach(struct ocxl_context *ctx, u64 amr)return rc; } -static int map_afu_irq (struct vm_area_struct *vma,unsigned long address, +static vm_fault_t map_afu_irq (struct vm_area_struct *vma,unsigned long address,u64 offset,struct ocxl_context *ctx) {u64 trigger_addr;
@@ -96,7 +96,7 @@ static int map_afu_irq(struct vm_area_struct *vma, unsigned long address,return VM_FAULT_NOPAGE ; } -static int map_pp_mmio (struct vm_area_struct *vma,unsigned long address, +static vm_fault_t map_pp_mmio (struct vm_area_struct *vma,unsigned long address,u64 offset,struct ocxl_context *ctx) {u64 pp_mmio_addr;
@@ -123,7 +123,7 @@ static int map_pp_mmio(struct vm_area_struct *vma, unsigned long address,return VM_FAULT_NOPAGE ; } -static int ocxl_mmap_fault (struct vm_fault *vmf) +static vm_fault_t ocxl_mmap_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct ocxl_context *ctx = vma->vm_file->private_data;
drivers/misc/ocxl/link.c +1 -1
@@ -126,7 +126,7 @@ static void ack_irq(struct spa *spa, enum xsl_response r)static void xsl_fault_handler_bh (struct work_struct *fault_work) { -unsigned int flt =0 ; +vm_fault_t flt =0 ;unsigned long access, flags, inv_flags =0 ;enum xsl_response r; struct xsl_fault *fault = container_of(fault_work, struct xsl_fault,
drivers/misc/ocxl/sysfs.c +1 -1
@@ -64,7 +64,7 @@ static ssize_t global_mmio_read(struct file *filp, struct kobject *kobj,return count; } -static int global_mmio_fault (struct vm_fault *vmf) +static vm_fault_t global_mmio_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct ocxl_afu *afu = vma->vm_private_data;
drivers/scsi/cxlflash/superpipe.c +2 -2
@@ -1101,7 +1101,7 @@ static struct page *get_err_page(struct cxlflash_cfg *cfg)* * Return: 0 on success, VM_FAULT_SIGBUS on failure */ -static int cxlflash_mmap_fault (struct vm_fault *vmf) +static vm_fault_t cxlflash_mmap_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct file *file = vma->vm_file;
@@ -1112,7 +1112,7 @@ static int cxlflash_mmap_fault(struct vm_fault *vmf)struct ctx_info *ctxi =NULL ;struct page *err_page =NULL ;enum ctx_ctrl ctrl =CTX_CTRL_ERR_FALLBACK |CTX_CTRL_FILE ; -int rc =0 ; +vm_fault_t rc =0 ;int ctxid; ctxid = cfg->ops->process_element (ctx);
drivers/staging/ncpfs/mmap.c +1 -1
@@ -28,7 +28,7 @@* XXX: how are we excluding truncate/invalidate here? Maybe need to lock * page? */ -static int ncp_file_mmap_fault (struct vm_fault *vmf) +static vm_fault_t ncp_file_mmap_fault (struct vm_fault *vmf) {struct inode *inode =file_inode (vmf->vma->vm_file);char *pg_addr;
drivers/xen/privcmd.c +1 -1
@@ -801,7 +801,7 @@ static void privcmd_close(struct vm_area_struct *vma)kfree (pages); } -static int privcmd_fault (struct vm_fault *vmf) +static vm_fault_t privcmd_fault (struct vm_fault *vmf) { printk(KERN_DEBUG "privcmd_fault: vma=%p %lx-%lx, pgoff=%lx, uv=%p\n", vmf->vma, vmf->vma->vm_start, vmf->vma->vm_end,
fs/9p/vfs_file.c +1 -1
@@ -533,7 +533,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma)return retval; } -static int +static vm_fault_t v9fs_vm_page_mkwrite (struct vm_fault *vmf) {struct v9fs_inode *v9inode;
fs/afs/internal.h +1 -1
@@ -1028,7 +1028,7 @@ extern int afs_writepages(struct address_space *, struct writeback_control *);extern void afs_pages_written_back (struct afs_vnode *,struct afs_call *);extern ssize_t afs_file_write (struct kiocb *,struct iov_iter *);extern int afs_fsync (struct file *,loff_t ,loff_t ,int ); -extern int afs_page_mkwrite (struct vm_fault *); +extern vm_fault_t afs_page_mkwrite (struct vm_fault *);extern void afs_prune_wb_keys (struct afs_vnode *);extern int afs_launder_page (struct page *);
fs/afs/write.c +1 -1
@@ -753,7 +753,7 @@ int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)* notification that a previously read-only page is about to become writable * - if it returns an error, the caller will deliver a bus error signal */ -int afs_page_mkwrite (struct vm_fault *vmf) +vm_fault_t afs_page_mkwrite (struct vm_fault *vmf) {struct file *file = vmf->vma->vm_file;struct inode *inode =file_inode (file);
fs/f2fs/file.c +5 -5
@@ -33,19 +33,19 @@#include "trace.h" #include <trace/events/f2fs.h> -static int f2fs_filemap_fault (struct vm_fault *vmf) +static vm_fault_t f2fs_filemap_fault (struct vm_fault *vmf) {struct inode *inode =file_inode (vmf->vma->vm_file); -int err; +vm_fault_t ret;down_read (&F2FS_I (inode)->i_mmap_sem); - err =filemap_fault (vmf); + ret =filemap_fault (vmf);up_read (&F2FS_I (inode)->i_mmap_sem); -return err; +return ret; } -static int f2fs_vm_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t f2fs_vm_page_mkwrite (struct vm_fault *vmf) {struct page *page = vmf->page;struct inode *inode =file_inode (vmf->vma->vm_file);
fs/fuse/file.c +1 -1
@@ -2048,7 +2048,7 @@ static void fuse_vma_close(struct vm_area_struct *vma)* - sync(2) * - try_to_free_pages() with order > PAGE_ALLOC_COSTLY_ORDER */ -static int fuse_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t fuse_page_mkwrite (struct vm_fault *vmf) {struct page *page = vmf->page;struct inode *inode =file_inode (vmf->vma->vm_file);
fs/gfs2/file.c +1 -1
@@ -387,7 +387,7 @@ static int gfs2_allocate_page_backing(struct page *page)* blocks allocated on disk to back that page. */ -static int gfs2_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t gfs2_page_mkwrite (struct vm_fault *vmf) {struct page *page = vmf->page;struct inode *inode =file_inode (vmf->vma->vm_file);
fs/iomap.c +1 -1
@@ -444,7 +444,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length,return length; } -int iomap_page_mkwrite (struct vm_fault *vmf,const struct iomap_ops *ops) +vm_fault_t iomap_page_mkwrite (struct vm_fault *vmf,const struct iomap_ops *ops) {struct page *page = vmf->page;struct inode *inode =file_inode (vmf->vma->vm_file);
fs/nfs/file.c +2 -2
@@ -532,13 +532,13 @@ const struct address_space_operations nfs_file_aops = {* writable, implying that someone is about to modify the page through a * shared-writable mapping */ -static int nfs_vm_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t nfs_vm_page_mkwrite (struct vm_fault *vmf) {struct page *page = vmf->page;struct file *filp = vmf->vma->vm_file;struct inode *inode =file_inode (filp);unsigned pagelen; -int ret =VM_FAULT_NOPAGE ; +vm_fault_t ret =VM_FAULT_NOPAGE ;struct address_space *mapping; dfprintk(PAGECACHE, "NFS: vm_page_mkwrite(%pD2(%lu), offset %lld)\n",
fs/nilfs2/file.c +1 -1
@@ -51,7 +51,7 @@ int nilfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)return err; } -static int nilfs_page_mkwrite (struct vm_fault *vmf) +static vm_fault_t nilfs_page_mkwrite (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct page *page = vmf->page;
fs/proc/vmcore.c +1 -1
@@ -379,7 +379,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,* On s390 the fault handler is used for memory regions that can't be mapped * directly with remap_pfn_range(). */ -static int mmap_vmcore_fault (struct vm_fault *vmf) +static vm_fault_t mmap_vmcore_fault (struct vm_fault *vmf) {#ifdef CONFIG_S390 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
fs/userfaultfd.c +2 -2
@@ -336,12 +336,12 @@ static inline bool userfaultfd_must_wait(struct userfaultfd_ctx *ctx,* fatal_signal_pending()s, and the mmap_sem must be released before * returning it. */ -int handle_userfault (struct vm_fault *vmf,unsigned long reason) +vm_fault_t handle_userfault (struct vm_fault *vmf,unsigned long reason) {struct mm_struct *mm = vmf->vma->vm_mm;struct userfaultfd_ctx *ctx;struct userfaultfd_wait_queue uwq; -int ret; +vm_fault_t ret;bool must_wait, return_to_userland;long blocking_state;
fs/xfs/xfs_file.c +6 -6
@@ -1080,7 +1080,7 @@ xfs_file_llseek(* page_lock (MM) * i_lock (XFS - extent map serialisation) */ -static int +static vm_fault_t __xfs_filemap_fault( struct vm_fault *vmf, enum page_entry_size pe_size,
@@ -1088,7 +1088,7 @@ __xfs_filemap_fault( {struct inode *inode =file_inode (vmf->vma->vm_file);struct xfs_inode *ip =XFS_I (inode); -int ret; +vm_fault_t ret;trace_xfs_filemap_fault (ip, pe_size, write_fault);
@@ -1117,7 +1117,7 @@ __xfs_filemap_fault(return ret; } -static int +static vm_fault_t xfs_filemap_fault (struct vm_fault *vmf) {
@@ -1127,7 +1127,7 @@ xfs_filemap_fault( (vmf->flags & FAULT_FLAG_WRITE)); } -static int +static vm_fault_t xfs_filemap_huge_fault (struct vm_fault *vmf,enum page_entry_size pe_size)
@@ -1140,7 +1140,7 @@ xfs_filemap_huge_fault( (vmf->flags & FAULT_FLAG_WRITE)); } -static int +static vm_fault_t xfs_filemap_page_mkwrite (struct vm_fault *vmf) {
@@ -1152,7 +1152,7 @@ xfs_filemap_page_mkwrite(* on write faults. In reality, it needs to serialise against truncate and * prepare memory for writing so handle is as standard write fault. */ -static int +static vm_fault_t xfs_filemap_pfn_mkwrite (struct vm_fault *vmf) {
include/linux/huge_mm.h +7 -6
@@ -6,7 +6,7 @@#include <linux/fs.h> /* only for vma_is_dax() */ -extern int do_huge_pmd_anonymous_page (struct vm_fault *vmf); +extern vm_fault_t do_huge_pmd_anonymous_page (struct vm_fault *vmf);extern int copy_huge_pmd (struct mm_struct *dst_mm,struct mm_struct *src_mm,pmd_t *dst_pmd,pmd_t *src_pmd,unsigned long addr,struct vm_area_struct *vma);
@@ -23,7 +23,7 @@ static inline void huge_pud_set_accessed(struct vm_fault *vmf, pud_t orig_pud) }#endif -extern int do_huge_pmd_wp_page (struct vm_fault *vmf,pmd_t orig_pmd); +extern vm_fault_t do_huge_pmd_wp_page (struct vm_fault *vmf,pmd_t orig_pmd); extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd,
@@ -46,9 +46,9 @@ extern bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,extern int change_huge_pmd (struct vm_area_struct *vma,pmd_t *pmd,unsigned long addr,pgprot_t newprot,int prot_numa); -int vmf_insert_pfn_pmd (struct vm_area_struct *vma,unsigned long addr, +vm_fault_t vmf_insert_pfn_pmd (struct vm_area_struct *vma,unsigned long addr,pmd_t *pmd,pfn_t pfn,bool write); -int vmf_insert_pfn_pud (struct vm_area_struct *vma,unsigned long addr, +vm_fault_t vmf_insert_pfn_pud (struct vm_area_struct *vma,unsigned long addr,pud_t *pud,pfn_t pfn,bool write);enum transparent_hugepage_flag {TRANSPARENT_HUGEPAGE_FLAG ,
@@ -216,7 +216,7 @@ struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long addr,struct page *follow_devmap_pud (struct vm_area_struct *vma,unsigned long addr,pud_t *pud,int flags); -extern int do_huge_pmd_numa_page (struct vm_fault *vmf,pmd_t orig_pmd); +extern vm_fault_t do_huge_pmd_numa_page (struct vm_fault *vmf,pmd_t orig_pmd);extern struct page *huge_zero_page;
@@ -321,7 +321,8 @@ static inline spinlock_t *pud_trans_huge_lock(pud_t *pud,return NULL ; } -static inline int do_huge_pmd_numa_page (struct vm_fault *vmf,pmd_t orig_pmd) +static inline vm_fault_t do_huge_pmd_numa_page (struct vm_fault *vmf, +pmd_t orig_pmd) {return 0 ; }
include/linux/hugetlb.h +1 -1
@@ -105,7 +105,7 @@ void hugetlb_report_meminfo(struct seq_file *);int hugetlb_report_node_meminfo (int ,char *);void hugetlb_show_meminfo (void );unsigned long hugetlb_total_pages (void ); -int hugetlb_fault (struct mm_struct *mm,struct vm_area_struct *vma, +vm_fault_t hugetlb_fault (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,unsigned int flags); int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma,
include/linux/iomap.h +3 -1
@@ -3,6 +3,7 @@#define LINUX_IOMAP_H 1#include <linux/types.h> +#include <linux/mm_types.h> struct fiemap_extent_info ;struct inode ;
@@ -88,7 +89,8 @@ int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero, const struct iomap_ops *ops);int iomap_truncate_page (struct inode *inode,loff_t pos,bool *did_zero,const struct iomap_ops *ops); -int iomap_page_mkwrite (struct vm_fault *vmf,const struct iomap_ops *ops); +vm_fault_t iomap_page_mkwrite (struct vm_fault *vmf, +const struct iomap_ops *ops);int iomap_fiemap (struct inode *inode,struct fiemap_extent_info *fieinfo,loff_t start,loff_t len,const struct iomap_ops *ops); loff_t iomap_seek_hole(struct inode *inode, loff_t offset,
include/linux/mm.h +37 -30
106 lines not on this page · raw message
include/linux/mm_types.h +3 -2
@@ -22,7 +22,8 @@#endif #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) -typedef int vm_fault_t ; +typedef unsigned __bitwise vm_fault_t ; +struct address_space ;struct mem_cgroup ;
@@ -619,7 +620,7 @@ struct vm_special_mapping {* If non-NULL, then this is called to resolve page faults * on the special mapping. If used, .pages is not checked. */ -int (*fault)(const struct vm_special_mapping *sm, +vm_fault_t (*fault)(const struct vm_special_mapping *sm,struct vm_area_struct *vma,struct vm_fault *vmf);
include/linux/oom.h +1 -1
@@ -96,7 +96,7 @@ static inline bool mm_is_oom_victim(struct mm_struct *mm)* * Return 0 when the PF is safe VM_FAULT_SIGBUS otherwise. */ -static inline int check_stable_address_space (struct mm_struct *mm) +static inline vm_fault_t check_stable_address_space (struct mm_struct *mm) {if (unlikely (test_bit (MMF_UNSTABLE , &mm->flags)))return VM_FAULT_SIGBUS ;
include/linux/swapops.h +2 -2
@@ -134,7 +134,7 @@ static inline struct page *device_private_entry_to_page(swp_entry_t entry)return pfn_to_page (swp_offset (entry)); } -int device_private_entry_fault(struct vm_area_struct *vma, +vm_fault_t device_private_entry_fault(struct vm_area_struct *vma, unsigned long addr, swp_entry_t entry, unsigned int flags,
@@ -169,7 +169,7 @@ static inline struct page *device_private_entry_to_page(swp_entry_t entry)return NULL ; } -static inline int device_private_entry_fault(struct vm_area_struct *vma, +static inline vm_fault_t device_private_entry_fault(struct vm_area_struct *vma, unsigned long addr, swp_entry_t entry, unsigned int flags,
include/linux/userfaultfd_k.h +3 -2
@@ -28,7 +28,7 @@#define UFFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)#define UFFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS) -extern int handle_userfault (struct vm_fault *vmf,unsigned long reason); +extern vm_fault_t handle_userfault (struct vm_fault *vmf,unsigned long reason);extern ssize_t mcopy_atomic (struct mm_struct *dst_mm,unsigned long dst_start,unsigned long src_start,unsigned long len);
@@ -75,7 +75,8 @@ extern void userfaultfd_unmap_complete(struct mm_struct *mm,#else /* CONFIG_USERFAULTFD */ /* mm helpers */ -static inline int handle_userfault (struct vm_fault *vmf,unsigned long reason) +static inline vm_fault_t handle_userfault (struct vm_fault *vmf, +unsigned long reason) {return VM_FAULT_SIGBUS ; }
ipc/shm.c +1 -1
@@ -408,7 +408,7 @@ void exit_shm(struct task_struct *task)up_write (&shm_ids (ns).rwsem); } -static int shm_fault (struct vm_fault *vmf) +static vm_fault_t shm_fault (struct vm_fault *vmf) {struct file *file = vmf->vma->vm_file;struct shm_file_data *sfd =shm_file_data (file);
kernel/events/core.c +2 -2
@@ -5271,11 +5271,11 @@ void perf_event_update_userpage(struct perf_event *event) }EXPORT_SYMBOL_GPL (perf_event_update_userpage); -static int perf_mmap_fault (struct vm_fault *vmf) +static vm_fault_t perf_mmap_fault (struct vm_fault *vmf) {struct perf_event *event = vmf->vma->vm_file->private_data;struct ring_buffer *rb; -int ret =VM_FAULT_SIGBUS ; +vm_fault_t ret =VM_FAULT_SIGBUS ;if (vmf->flags &FAULT_FLAG_MKWRITE ) {if (vmf->pgoff ==0 )
mm/gup.c +4 -3
@@ -497,7 +497,7 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma, unsigned long address, unsigned int *flags, int *nonblocking) { unsigned int fault_flags = 0; -int ret; +vm_fault_t ret;/* mlock all present pages, but do not fault in new pages */ if ((*flags & (FOLL_POPULATE |FOLL_MLOCK )) ==FOLL_MLOCK )
@@ -815,7 +815,8 @@ int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, bool *unlocked) {struct vm_area_struct *vma; -int ret, major =0 ; +int major =0 ; +vm_fault_t ret;if (unlocked) fault_flags |=FAULT_FLAG_ALLOW_RETRY ;
@@ -829,7 +830,7 @@ int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,return -EFAULT ; ret =handle_mm_fault (vma, address, fault_flags); - major |= ret &VM_FAULT_MAJOR ; + major |= !!(ret &VM_FAULT_MAJOR );if (ret &VM_FAULT_ERROR ) {int err =vm_fault_to_errno (ret,0 );
mm/hmm.c +1 -1
@@ -299,7 +299,7 @@ static int hmm_vma_do_fault(struct mm_walk *walk, unsigned long addr,struct hmm_vma_walk *hmm_vma_walk = walk->private;struct hmm_range *range = hmm_vma_walk->range;struct vm_area_struct *vma = walk->vma; -int r; +vm_fault_t r; flags |= hmm_vma_walk->block ?0 :FAULT_FLAG_ALLOW_RETRY ; flags |= write_fault ?FAULT_FLAG_WRITE :0 ;
mm/huge_memory.c +15 -14
@@ -544,14 +544,14 @@ unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr, }EXPORT_SYMBOL_GPL (thp_get_unmapped_area); -static int __do_huge_pmd_anonymous_page (struct vm_fault *vmf,struct page *page, -gfp_t gfp) +static vm_fault_t __do_huge_pmd_anonymous_page (struct vm_fault *vmf, +struct page *page,gfp_t gfp) {struct vm_area_struct *vma = vmf->vma;struct mem_cgroup *memcg;pgtable_t pgtable;unsigned long haddr = vmf->address &HPAGE_PMD_MASK ; -int ret =0 ; +vm_fault_t ret =0 ;VM_BUG_ON_PAGE (!PageCompound (page), page);
@@ -587,7 +587,7 @@ static int __do_huge_pmd_anonymous_page(struct vm_fault *vmf, struct page *page,/* Deliver the page fault to userland */ if (userfaultfd_missing (vma)) { -int ret; +vm_fault_t ret;spin_unlock (vmf->ptl);mem_cgroup_cancel_charge (page, memcg, true);
@@ -666,7 +666,7 @@ static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm,return true; } -int do_huge_pmd_anonymous_page (struct vm_fault *vmf) +vm_fault_t do_huge_pmd_anonymous_page (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;gfp_t gfp;
@@ -685,7 +685,7 @@ int do_huge_pmd_anonymous_page(struct vm_fault *vmf)pgtable_t pgtable;struct page *zero_page;bool set; -int ret; +vm_fault_t ret; pgtable =pte_alloc_one (vma->vm_mm, haddr);if (unlikely (!pgtable))return VM_FAULT_OOM ;
@@ -755,7 +755,7 @@ static void insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,spin_unlock (ptl); } -int vmf_insert_pfn_pmd (struct vm_area_struct *vma,unsigned long addr, +vm_fault_t vmf_insert_pfn_pmd (struct vm_area_struct *vma,unsigned long addr,pmd_t *pmd,pfn_t pfn,bool write) {pgprot_t pgprot = vma->vm_page_prot;
@@ -815,7 +815,7 @@ static void insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,spin_unlock (ptl); } -int vmf_insert_pfn_pud (struct vm_area_struct *vma,unsigned long addr, +vm_fault_t vmf_insert_pfn_pud (struct vm_area_struct *vma,unsigned long addr,pud_t *pud,pfn_t pfn,bool write) {pgprot_t pgprot = vma->vm_page_prot;
@@ -1121,15 +1121,16 @@ void huge_pmd_set_accessed(struct vm_fault *vmf, pmd_t orig_pmd)spin_unlock (vmf->ptl); } -static int do_huge_pmd_wp_page_fallback (struct vm_fault *vmf,pmd_t orig_pmd, -struct page *page) +static vm_fault_t do_huge_pmd_wp_page_fallback (struct vm_fault *vmf, +pmd_t orig_pmd,struct page *page) {struct vm_area_struct *vma = vmf->vma;unsigned long haddr = vmf->address &HPAGE_PMD_MASK ;struct mem_cgroup *memcg;pgtable_t pgtable;pmd_t _pmd; -int ret =0 , i; +vm_fault_t ret =0 ; +int i;struct page **pages;unsigned long mmun_start;/* For mmu_notifiers */ unsigned long mmun_end;/* For mmu_notifiers */
@@ -1239,7 +1240,7 @@ static int do_huge_pmd_wp_page_fallback(struct vm_fault *vmf, pmd_t orig_pmd, goto out; } -int do_huge_pmd_wp_page (struct vm_fault *vmf,pmd_t orig_pmd) +vm_fault_t do_huge_pmd_wp_page (struct vm_fault *vmf,pmd_t orig_pmd) {struct vm_area_struct *vma = vmf->vma;struct page *page =NULL , *new_page;
@@ -1248,7 +1249,7 @@ int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd)unsigned long mmun_start;/* For mmu_notifiers */ unsigned long mmun_end;/* For mmu_notifiers */ gfp_t huge_gfp;/* for allocation and charge */ -int ret =0 ; +vm_fault_t ret =0 ; vmf->ptl =pmd_lockptr (vma->vm_mm, vmf->pmd);VM_BUG_ON_VMA (!vma->anon_vma, vma);
@@ -1459,7 +1460,7 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, }/* NUMA hinting page fault entry point for trans huge pmds */ -int do_huge_pmd_numa_page (struct vm_fault *vmf,pmd_t pmd) +vm_fault_t do_huge_pmd_numa_page (struct vm_fault *vmf,pmd_t pmd) {struct vm_area_struct *vma = vmf->vma;struct anon_vma *anon_vma =NULL ;
mm/hugetlb.c +13 -12
@@ -3159,7 +3159,7 @@ static unsigned long hugetlb_vm_op_pagesize(struct vm_area_struct *vma)* hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get * this far. */ -static int hugetlb_vm_op_fault (struct vm_fault *vmf) +static vm_fault_t hugetlb_vm_op_fault (struct vm_fault *vmf) {BUG ();return 0 ;
@@ -3499,16 +3499,17 @@ static void unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,* cannot race with other handlers or page migration. * Keep the pte_same checks anyway to make transition from the mutex easier. */ -static int hugetlb_cow (struct mm_struct *mm,struct vm_area_struct *vma, +static vm_fault_t hugetlb_cow (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,pte_t *ptep,struct page *pagecache_page,spinlock_t *ptl) {pte_t pte;struct hstate *h =hstate_vma (vma);struct page *old_page, *new_page; -int ret =0 , outside_reserve =0 ; +int outside_reserve =0 ;unsigned long mmun_start;/* For mmu_notifiers */ unsigned long mmun_end;/* For mmu_notifiers */ +vm_fault_t ret =0 ; pte =huge_ptep_get (ptep); old_page =pte_page (pte);
@@ -3675,12 +3676,13 @@ int huge_add_to_page_cache(struct page *page, struct address_space *mapping,return 0 ; } -static int hugetlb_no_page (struct mm_struct *mm,struct vm_area_struct *vma, -struct address_space *mapping,pgoff_t idx, -unsigned long address,pte_t *ptep,unsigned int flags) +static vm_fault_t hugetlb_no_page (struct mm_struct *mm, +struct vm_area_struct *vma,struct address_space *mapping, +pgoff_t idx,unsigned long address,pte_t *ptep, +unsigned int flags) {struct hstate *h =hstate_vma (vma); -int ret =VM_FAULT_SIGBUS ; +vm_fault_t ret =VM_FAULT_SIGBUS ;int anon_rmap =0 ;unsigned long size;struct page *page;
@@ -3742,8 +3744,7 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, page =alloc_huge_page (vma, address,0 );if (IS_ERR (page)) { - ret =PTR_ERR (page); -if (ret == -ENOMEM ) +if (PTR_ERR (page) == -ENOMEM ) ret =VM_FAULT_OOM ;else ret =VM_FAULT_SIGBUS ;
@@ -3870,12 +3871,12 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm, }#endif -int hugetlb_fault (struct mm_struct *mm,struct vm_area_struct *vma, +vm_fault_t hugetlb_fault (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,unsigned int flags) {pte_t *ptep, entry;spinlock_t *ptl; -int ret; +vm_fault_t ret;u32 hash;pgoff_t idx;struct page *page =NULL ;
@@ -4206,7 +4207,7 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,if (absent ||is_swap_pte (huge_ptep_get (pte)) || ((flags &FOLL_WRITE ) && !huge_pte_write (huge_ptep_get (pte)))) { -int ret; +vm_fault_t ret;unsigned int fault_flags =0 ;if (pte)
mm/internal.h +1 -1
@@ -38,7 +38,7 @@void page_writeback_init (void ); -int do_swap_page (struct vm_fault *vmf); +vm_fault_t do_swap_page (struct vm_fault *vmf);void free_pgtables (struct mmu_gather *tlb,struct vm_area_struct *start_vma,unsigned long floor,unsigned long ceiling);
mm/khugepaged.c +2 -1
@@ -880,7 +880,8 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm, unsigned long address, pmd_t *pmd, int referenced) { - int swapped_in = 0, ret = 0; + int swapped_in = 0; +vm_fault_t ret =0 ; struct vm_fault vmf = { .vma = vma, .address = address,
mm/ksm.c +1 -1
@@ -470,7 +470,7 @@ static inline bool ksm_test_exit(struct mm_struct *mm)static int break_ksm (struct vm_area_struct *vma,unsigned long addr) {struct page *page; -int ret =0 ; +vm_fault_t ret =0 ; do { cond_resched();
mm/memory.c +45 -43
299 lines not on this page · raw message
mm/mmap.c +2 -2
@@ -3277,7 +3277,7 @@ void vm_stat_account(struct mm_struct *mm, vm_flags_t flags, long npages) mm->data_vm += npages; } -static int special_mapping_fault (struct vm_fault *vmf); +static vm_fault_t special_mapping_fault (struct vm_fault *vmf);/* * Having a close hook prevents vma merging regardless of flags.
@@ -3316,7 +3316,7 @@ static const struct vm_operations_struct legacy_special_mapping_vmops = { .fault = special_mapping_fault, }; -static int special_mapping_fault (struct vm_fault *vmf) +static vm_fault_t special_mapping_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;pgoff_t pgoff;
mm/shmem.c +5 -4
@@ -123,7 +123,7 @@ static int shmem_replace_page(struct page **pagep, gfp_t gfp,static int shmem_getpage_gfp (struct inode *inode,pgoff_t index,struct page **pagep,enum sgp_type sgp,gfp_t gfp,struct vm_area_struct *vma, -struct vm_fault *vmf,int *fault_type); +struct vm_fault *vmf,vm_fault_t *fault_type);int shmem_getpage (struct inode *inode,pgoff_t index,struct page **pagep,enum sgp_type sgp)
@@ -1620,7 +1620,8 @@ static int shmem_replace_page(struct page **pagep, gfp_t gfp,*/ static int shmem_getpage_gfp (struct inode *inode,pgoff_t index,struct page **pagep,enum sgp_type sgp,gfp_t gfp, -struct vm_area_struct *vma,struct vm_fault *vmf,int *fault_type) +struct vm_area_struct *vma,struct vm_fault *vmf, +vm_fault_t *fault_type) {struct address_space *mapping = inode->i_mapping;struct shmem_inode_info *info =SHMEM_I (inode);
@@ -1947,14 +1948,14 @@ static int synchronous_wake_function(wait_queue_entry_t *wait, unsigned mode, inreturn ret; } -static int shmem_fault (struct vm_fault *vmf) +static vm_fault_t shmem_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct inode *inode =file_inode (vma->vm_file);gfp_t gfp =mapping_gfp_mask (inode->i_mapping);enum sgp_type sgp;int error; -int ret =VM_FAULT_LOCKED ; +vm_fault_t ret =VM_FAULT_LOCKED ;/* * Trinity finds that probing a hole which tmpfs is punching can
samples/vfio-mdev/mbochs.c +2 -2
@@ -657,7 +657,7 @@ static void mbochs_put_pages(struct mdev_state *mdev_state)dev_dbg (dev,"%s: %d pages released\n" , __func__, count); } -static int mbochs_region_vm_fault (struct vm_fault *vmf) +static vm_fault_t mbochs_region_vm_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct mdev_state *mdev_state = vma->vm_private_data;
@@ -695,7 +695,7 @@ static int mbochs_mmap(struct mdev_device *mdev, struct vm_area_struct *vma)return 0 ; } -static int mbochs_dmabuf_vm_fault (struct vm_fault *vmf) +static vm_fault_t mbochs_dmabuf_vm_fault (struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct mbochs_dmabuf *dmabuf = vma->vm_private_data;
virt/kvm/kvm_main.c +1 -1
@@ -2340,7 +2340,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me, bool yield_to_kernel_mode) }EXPORT_SYMBOL_GPL (kvm_vcpu_on_spin); -static int kvm_vcpu_fault (struct vm_fault *vmf) +static vm_fault_t kvm_vcpu_fault (struct vm_fault *vmf) {struct kvm_vcpu *vcpu = vmf->vma->vm_file->private_data;struct page *page;
Signature · 1 line
2.17.0
Matthew Wilcox
maintainerRe: [PATCH 14/14] mm: turn on vm_fault_t type checking
Quoted 4 lines · Christoph Hellwig
Switch
vm_fault_tto point to an unsigned int with __bіtwise annotations. This both catches any old ->fault or ->page_mkwrite instance with plain compiler type checking, as well as finding more intricate problems with sparse.
Come on, Christoph; you know better than this. This patch is completely unreviewable. Split it into one patch per maintainer tree, and in any event, the patch to convert vm_fault_t to an unsigned int should be separated from all the trivial conversions.
Re: [PATCH 14/14] mm: turn on vm_fault_t type checking
Quoted 10 lines · Matthew Wilcox
Quoted 4 lines · Christoph Hellwig
Switch
vm_fault_tto point to an unsigned int with __bіtwise annotations. This both catches any old ->fault or ->page_mkwrite instance with plain compiler type checking, as well as finding more intricate problems with sparse.Come on, Christoph; you know better than this. This patch is completely unreviewable. Split it into one patch per maintainer tree, and in any event, the patch to convert
vm_fault_tto an unsigned int should be separated from all the trivial conversions.
The whole point is that tiny split patches for mechnical translations are totally pointless. Switching the typedef might be worth splitting if people really insist.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 14/14] mm: turn on vm_fault_t type checking
In reply to Christoph HellwigQuoted 7 lines · Christoph Hellwig
Switch
vm_fault_tto point to an unsigned int with __bіtwise annotations. This both catches any old ->fault or ->page_mkwrite instance with plain compiler type checking, as well as finding more intricate problems with sparse.Signed-off-by Christoph Hellwig <[email protected]>---
<ULTRASNIP>
For the iomap and xfs parts,
That said...
Quoted 15 lines
include/linux/mm_types.h +2
-1@@ -22,7 +22,8 @@#endif #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) -typedef int vm_fault_t ; +typedef unsigned __bitwise vm_fault_t ; +struct address_space ;struct mem_cgroup ;
include/linux/mm_types.h struct vm_special_mapping { · line 623
Quoted 5 lines
include/linux/mm_types.h +1
-1@@ -619,7 +620,7 @@ struct vm_special_mapping {* If non-NULL, then this is called to resolve page faults * on the special mapping. If used, .pages is not checked. */ - int (*fault)(const struct vm_special_mapping *sm, + vm_fault_t (*fault)(const struct vm_special_mapping *sm,
Uh, we're changing function signatures /and/ redefinining vm_fault_t? All in the same 90K patch?
I /was/ expecting a series of "convert XXXXX and all callers/users" patches followed by a trivial one to switch the definition, not a giant pile of change. FWIW I don't mind so much if you make a patch containing a change for some super-common primitive and a hojillion little diff hunks tree-wide, but only one logical change at a time for a big patch, please...
I quite prefer seeing the whole series from start to finish all packaged up in one series, but wow this was overwhelming. :/
--D
<ULTRASNIP>
_______________________________________________
Ocfs2-devel mailing list
[email protected]
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
Re: [PATCH 14/14] mm: turn on vm_fault_t type checking
Quoted 10 lines · Darrick J. Wong
Uh, we're changing function signatures /and/ redefinining
vm_fault_t? All in the same 90K patch?I /was/ expecting a series of "convert XXXXX and all callers/users" patches followed by a trivial one to switch the definition, not a giant pile of change. FWIW I don't mind so much if you make a patch containing a change for some super-common primitive and a hojillion little diff hunks tree-wide, but only one logical change at a time for a big patch, please...
Quoted 2 lines
I quite prefer seeing the whole series from start to finish all packaged up in one series, but wow this was overwhelming. :/
Another vote to split the change of the typedef, ok I get the message..
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Matthew Wilcox
maintainerQuoted 3 lines · Christoph Hellwig
this series tries to actually turn
vm_fault_tinto a type that can be typechecked and checks the fallout instead of sprinkling random annotations without context.
Yes, why should we have small tasks that newcomers can do when the mighty Christoph Hellwig can swoop in and take over from them? Seriously, can't your talents find a better use than this?
Quoted 7 lines
The first one fixes a real bug in orangefs, the second and third fix mismatched existing
vm_fault_tannotations on the same function, the fourth removes an unused export that was in the chain. The remainder until the last one do some not quite trivial conversions, and the last one does the trivial mass annotation and flipsvm_fault_tto a__bitwiseunsigned int - the unsigned means we also get plain compiler type checking for the new ->fault signature even without sparse.
Yes, that was (part of) the eventual goal. Well done. Would you like a biscuit?
Quoted 8 lines · Matthew Wilcox
Quoted 3 lines · Christoph Hellwig
this series tries to actually turn
vm_fault_tinto a type that can be typechecked and checks the fallout instead of sprinkling random annotations without context.Yes, why should we have small tasks that newcomers can do when the mighty Christoph Hellwig can swoop in and take over from them? Seriously, can't your talents find a better use than this?
I've spent less time on this than trying to argue to you and Souptick that these changes are only to get ignored and yelled at as an "asshole maintainer". So yes, I could have done more productive things if you hadn't forced this escalation.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Matthew Wilcox
maintainerQuoted 6 lines · Christoph Hellwig
Quoted 5 lines · Matthew Wilcox
Quoted 3 lines · Christoph Hellwig
this series tries to actually turn
vm_fault_tinto a type that can be typechecked and checks the fallout instead of sprinkling random annotations without context.
Quoted 8 lines
Quoted 3 lines
Yes, why should we have small tasks that newcomers can do when the mighty Christoph Hellwig can swoop in and take over from them? Seriously, can't your talents find a better use than this?
I've spent less time on this than trying to argue to you and Souptick that these changes are only to get ignored and yelled at as an "asshole maintainer". So yes, I could have done more productive things if you hadn't forced this escalation.
Perhaps you should try being less of an arsehole if you don't want to get yelled at? I don't mind when you're an arsehole towards me, but I do mind when you're an arsehole towards newcomers. How are we supposed to attract and retain new maintainers when you're so rude?
Quoted 4 lines · Matthew Wilcox
Perhaps you should try being less of an arsehole if you don't want to get yelled at? I don't mind when you're an arsehole towards me, but I do mind when you're an arsehole towards newcomers. How are we supposed to attract and retain new maintainers when you're so rude?
*plonk* The only one I'm seeing being extremely rude here is you.