Commit f427f5d5 authored by Josef "Jeff" Sipek's avatar Josef "Jeff" Sipek Committed by Linus Torvalds

[PATCH] sysfs: change uses of f_{dentry, vfsmnt} to use f_path

Change all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the sysfs
filesystem code.
Signed-off-by: default avatarJosef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0f7fc9e4
...@@ -35,7 +35,7 @@ static ssize_t ...@@ -35,7 +35,7 @@ static ssize_t
read(struct file * file, char __user * userbuf, size_t count, loff_t * off) read(struct file * file, char __user * userbuf, size_t count, loff_t * off)
{ {
char *buffer = file->private_data; char *buffer = file->private_data;
struct dentry *dentry = file->f_dentry; struct dentry *dentry = file->f_path.dentry;
int size = dentry->d_inode->i_size; int size = dentry->d_inode->i_size;
loff_t offs = *off; loff_t offs = *off;
int ret; int ret;
...@@ -81,7 +81,7 @@ static ssize_t write(struct file * file, const char __user * userbuf, ...@@ -81,7 +81,7 @@ static ssize_t write(struct file * file, const char __user * userbuf,
size_t count, loff_t * off) size_t count, loff_t * off)
{ {
char *buffer = file->private_data; char *buffer = file->private_data;
struct dentry *dentry = file->f_dentry; struct dentry *dentry = file->f_path.dentry;
int size = dentry->d_inode->i_size; int size = dentry->d_inode->i_size;
loff_t offs = *off; loff_t offs = *off;
...@@ -105,7 +105,7 @@ static ssize_t write(struct file * file, const char __user * userbuf, ...@@ -105,7 +105,7 @@ static ssize_t write(struct file * file, const char __user * userbuf,
static int mmap(struct file *file, struct vm_area_struct *vma) static int mmap(struct file *file, struct vm_area_struct *vma)
{ {
struct dentry *dentry = file->f_dentry; struct dentry *dentry = file->f_path.dentry;
struct bin_attribute *attr = to_bin_attr(dentry); struct bin_attribute *attr = to_bin_attr(dentry);
struct kobject *kobj = to_kobj(dentry->d_parent); struct kobject *kobj = to_kobj(dentry->d_parent);
...@@ -117,8 +117,8 @@ static int mmap(struct file *file, struct vm_area_struct *vma) ...@@ -117,8 +117,8 @@ static int mmap(struct file *file, struct vm_area_struct *vma)
static int open(struct inode * inode, struct file * file) static int open(struct inode * inode, struct file * file)
{ {
struct kobject *kobj = sysfs_get_kobject(file->f_dentry->d_parent); struct kobject *kobj = sysfs_get_kobject(file->f_path.dentry->d_parent);
struct bin_attribute * attr = to_bin_attr(file->f_dentry); struct bin_attribute * attr = to_bin_attr(file->f_path.dentry);
int error = -EINVAL; int error = -EINVAL;
if (!kobj || !attr) if (!kobj || !attr)
...@@ -153,8 +153,8 @@ static int open(struct inode * inode, struct file * file) ...@@ -153,8 +153,8 @@ static int open(struct inode * inode, struct file * file)
static int release(struct inode * inode, struct file * file) static int release(struct inode * inode, struct file * file)
{ {
struct kobject * kobj = to_kobj(file->f_dentry->d_parent); struct kobject * kobj = to_kobj(file->f_path.dentry->d_parent);
struct bin_attribute * attr = to_bin_attr(file->f_dentry); struct bin_attribute * attr = to_bin_attr(file->f_path.dentry);
u8 * buffer = file->private_data; u8 * buffer = file->private_data;
if (kobj) if (kobj)
......
...@@ -419,7 +419,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent) ...@@ -419,7 +419,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent)
static int sysfs_dir_open(struct inode *inode, struct file *file) static int sysfs_dir_open(struct inode *inode, struct file *file)
{ {
struct dentry * dentry = file->f_dentry; struct dentry * dentry = file->f_path.dentry;
struct sysfs_dirent * parent_sd = dentry->d_fsdata; struct sysfs_dirent * parent_sd = dentry->d_fsdata;
mutex_lock(&dentry->d_inode->i_mutex); mutex_lock(&dentry->d_inode->i_mutex);
...@@ -432,7 +432,7 @@ static int sysfs_dir_open(struct inode *inode, struct file *file) ...@@ -432,7 +432,7 @@ static int sysfs_dir_open(struct inode *inode, struct file *file)
static int sysfs_dir_close(struct inode *inode, struct file *file) static int sysfs_dir_close(struct inode *inode, struct file *file)
{ {
struct dentry * dentry = file->f_dentry; struct dentry * dentry = file->f_path.dentry;
struct sysfs_dirent * cursor = file->private_data; struct sysfs_dirent * cursor = file->private_data;
mutex_lock(&dentry->d_inode->i_mutex); mutex_lock(&dentry->d_inode->i_mutex);
...@@ -452,7 +452,7 @@ static inline unsigned char dt_type(struct sysfs_dirent *sd) ...@@ -452,7 +452,7 @@ static inline unsigned char dt_type(struct sysfs_dirent *sd)
static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
{ {
struct dentry *dentry = filp->f_dentry; struct dentry *dentry = filp->f_path.dentry;
struct sysfs_dirent * parent_sd = dentry->d_fsdata; struct sysfs_dirent * parent_sd = dentry->d_fsdata;
struct sysfs_dirent *cursor = filp->private_data; struct sysfs_dirent *cursor = filp->private_data;
struct list_head *p, *q = &cursor->s_sibling; struct list_head *p, *q = &cursor->s_sibling;
...@@ -509,7 +509,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) ...@@ -509,7 +509,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
static loff_t sysfs_dir_lseek(struct file * file, loff_t offset, int origin) static loff_t sysfs_dir_lseek(struct file * file, loff_t offset, int origin)
{ {
struct dentry * dentry = file->f_dentry; struct dentry * dentry = file->f_path.dentry;
mutex_lock(&dentry->d_inode->i_mutex); mutex_lock(&dentry->d_inode->i_mutex);
switch (origin) { switch (origin) {
...@@ -519,7 +519,7 @@ static loff_t sysfs_dir_lseek(struct file * file, loff_t offset, int origin) ...@@ -519,7 +519,7 @@ static loff_t sysfs_dir_lseek(struct file * file, loff_t offset, int origin)
if (offset >= 0) if (offset >= 0)
break; break;
default: default:
mutex_unlock(&file->f_dentry->d_inode->i_mutex); mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
return -EINVAL; return -EINVAL;
} }
if (offset != file->f_pos) { if (offset != file->f_pos) {
......
...@@ -154,7 +154,7 @@ sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -154,7 +154,7 @@ sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
down(&buffer->sem); down(&buffer->sem);
if (buffer->needs_read_fill) { if (buffer->needs_read_fill) {
if ((retval = fill_read_buffer(file->f_dentry,buffer))) if ((retval = fill_read_buffer(file->f_path.dentry,buffer)))
goto out; goto out;
} }
pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n", pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n",
...@@ -245,7 +245,7 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t ...@@ -245,7 +245,7 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t
down(&buffer->sem); down(&buffer->sem);
len = fill_write_buffer(buffer, buf, count); len = fill_write_buffer(buffer, buf, count);
if (len > 0) if (len > 0)
len = flush_write_buffer(file->f_dentry, buffer, len); len = flush_write_buffer(file->f_path.dentry, buffer, len);
if (len > 0) if (len > 0)
*ppos += len; *ppos += len;
up(&buffer->sem); up(&buffer->sem);
...@@ -254,8 +254,8 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t ...@@ -254,8 +254,8 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t
static int check_perm(struct inode * inode, struct file * file) static int check_perm(struct inode * inode, struct file * file)
{ {
struct kobject *kobj = sysfs_get_kobject(file->f_dentry->d_parent); struct kobject *kobj = sysfs_get_kobject(file->f_path.dentry->d_parent);
struct attribute * attr = to_attr(file->f_dentry); struct attribute * attr = to_attr(file->f_path.dentry);
struct sysfs_buffer * buffer; struct sysfs_buffer * buffer;
struct sysfs_ops * ops = NULL; struct sysfs_ops * ops = NULL;
int error = 0; int error = 0;
...@@ -337,8 +337,8 @@ static int sysfs_open_file(struct inode * inode, struct file * filp) ...@@ -337,8 +337,8 @@ static int sysfs_open_file(struct inode * inode, struct file * filp)
static int sysfs_release(struct inode * inode, struct file * filp) static int sysfs_release(struct inode * inode, struct file * filp)
{ {
struct kobject * kobj = to_kobj(filp->f_dentry->d_parent); struct kobject * kobj = to_kobj(filp->f_path.dentry->d_parent);
struct attribute * attr = to_attr(filp->f_dentry); struct attribute * attr = to_attr(filp->f_path.dentry);
struct module * owner = attr->owner; struct module * owner = attr->owner;
struct sysfs_buffer * buffer = filp->private_data; struct sysfs_buffer * buffer = filp->private_data;
...@@ -372,8 +372,8 @@ static int sysfs_release(struct inode * inode, struct file * filp) ...@@ -372,8 +372,8 @@ static int sysfs_release(struct inode * inode, struct file * filp)
static unsigned int sysfs_poll(struct file *filp, poll_table *wait) static unsigned int sysfs_poll(struct file *filp, poll_table *wait)
{ {
struct sysfs_buffer * buffer = filp->private_data; struct sysfs_buffer * buffer = filp->private_data;
struct kobject * kobj = to_kobj(filp->f_dentry->d_parent); struct kobject * kobj = to_kobj(filp->f_path.dentry->d_parent);
struct sysfs_dirent * sd = filp->f_dentry->d_fsdata; struct sysfs_dirent * sd = filp->f_path.dentry->d_fsdata;
int res = 0; int res = 0;
poll_wait(filp, &kobj->poll, wait); poll_wait(filp, &kobj->poll, wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment