aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /fs/sysfs
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/bin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 614b2b544880..2ce9a5db6ab5 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -70,7 +70,7 @@ static ssize_t
70read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off) 70read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off)
71{ 71{
72 struct bin_buffer *bb = file->private_data; 72 struct bin_buffer *bb = file->private_data;
73 int size = file->f_path.dentry->d_inode->i_size; 73 int size = file_inode(file)->i_size;
74 loff_t offs = *off; 74 loff_t offs = *off;
75 int count = min_t(size_t, bytes, PAGE_SIZE); 75 int count = min_t(size_t, bytes, PAGE_SIZE);
76 char *temp; 76 char *temp;
@@ -140,7 +140,7 @@ static ssize_t write(struct file *file, const char __user *userbuf,
140 size_t bytes, loff_t *off) 140 size_t bytes, loff_t *off)
141{ 141{
142 struct bin_buffer *bb = file->private_data; 142 struct bin_buffer *bb = file->private_data;
143 int size = file->f_path.dentry->d_inode->i_size; 143 int size = file_inode(file)->i_size;
144 loff_t offs = *off; 144 loff_t offs = *off;
145 int count = min_t(size_t, bytes, PAGE_SIZE); 145 int count = min_t(size_t, bytes, PAGE_SIZE);
146 char *temp; 146 char *temp;
@@ -469,7 +469,7 @@ void unmap_bin_file(struct sysfs_dirent *attr_sd)
469 mutex_lock(&sysfs_bin_lock); 469 mutex_lock(&sysfs_bin_lock);
470 470
471 hlist_for_each_entry(bb, tmp, &attr_sd->s_bin_attr.buffers, list) { 471 hlist_for_each_entry(bb, tmp, &attr_sd->s_bin_attr.buffers, list) {
472 struct inode *inode = bb->file->f_path.dentry->d_inode; 472 struct inode *inode = file_inode(bb->file);
473 473
474 unmap_mapping_range(inode->i_mapping, 0, 0, 1); 474 unmap_mapping_range(inode->i_mapping, 0, 0, 1);
475 } 475 }