Skip to content

Commit

Permalink
mm: page_mkwrite change prototype to match fault: fix sysfs
Browse files Browse the repository at this point in the history
Fix warnings and return values in sysfs bin_page_mkwrite(), fixing
fs/sysfs/bin.c: In function `bin_page_mkwrite':
fs/sysfs/bin.c:250: warning: passing argument 2 of `bb->vm_ops->page_mkwrite' from incompatible pointer type
fs/sysfs/bin.c: At top level:
fs/sysfs/bin.c:280: warning: initialization from incompatible pointer type

Expects to have my [PATCH next] sysfs: fix some bin_vm_ops errors

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: "Eric W. Biederman" <ebiederm@aristanetworks.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Apr 1, 2009
1 parent 56a76f8 commit 851a039
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/sysfs/bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,23 @@ static int bin_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
return ret;
}

static int bin_page_mkwrite(struct vm_area_struct *vma, struct page *page)
static int bin_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct file *file = vma->vm_file;
struct bin_buffer *bb = file->private_data;
struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
int ret;

if (!bb->vm_ops)
return -EINVAL;
return VM_FAULT_SIGBUS;

if (!bb->vm_ops->page_mkwrite)
return 0;

if (!sysfs_get_active_two(attr_sd))
return -EINVAL;
return VM_FAULT_SIGBUS;

ret = bb->vm_ops->page_mkwrite(vma, page);
ret = bb->vm_ops->page_mkwrite(vma, vmf);

sysfs_put_active_two(attr_sd);
return ret;
Expand Down

0 comments on commit 851a039

Please sign in to comment.