提交 7706a9d6 编写于 作者: J Josef Sipek 提交者: Linus Torvalds

[PATCH] struct path: convert fuse

Signed-off-by: NJosef Sipek <jsipek@fsl.cs.sunysb.edu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1f70cecc
...@@ -23,7 +23,7 @@ static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file) ...@@ -23,7 +23,7 @@ static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file)
{ {
struct fuse_conn *fc; struct fuse_conn *fc;
mutex_lock(&fuse_mutex); mutex_lock(&fuse_mutex);
fc = file->f_dentry->d_inode->i_private; fc = file->f_path.dentry->d_inode->i_private;
if (fc) if (fc)
fc = fuse_conn_get(fc); fc = fuse_conn_get(fc);
mutex_unlock(&fuse_mutex); mutex_unlock(&fuse_mutex);
......
...@@ -856,7 +856,7 @@ static int fuse_readdir(struct file *file, void *dstbuf, filldir_t filldir) ...@@ -856,7 +856,7 @@ static int fuse_readdir(struct file *file, void *dstbuf, filldir_t filldir)
int err; int err;
size_t nbytes; size_t nbytes;
struct page *page; struct page *page;
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_req *req; struct fuse_req *req;
......
...@@ -141,8 +141,8 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir) ...@@ -141,8 +141,8 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir)
isdir ? FUSE_RELEASEDIR : FUSE_RELEASE); isdir ? FUSE_RELEASEDIR : FUSE_RELEASE);
/* Hold vfsmount and dentry until release is finished */ /* Hold vfsmount and dentry until release is finished */
req->vfsmount = mntget(file->f_vfsmnt); req->vfsmount = mntget(file->f_path.mnt);
req->dentry = dget(file->f_dentry); req->dentry = dget(file->f_path.dentry);
request_send_background(fc, req); request_send_background(fc, req);
} }
...@@ -184,7 +184,7 @@ static u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id) ...@@ -184,7 +184,7 @@ static u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id)
static int fuse_flush(struct file *file, fl_owner_t id) static int fuse_flush(struct file *file, fl_owner_t id)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_file *ff = file->private_data; struct fuse_file *ff = file->private_data;
struct fuse_req *req; struct fuse_req *req;
...@@ -533,7 +533,7 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf, ...@@ -533,7 +533,7 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf,
static ssize_t fuse_direct_io(struct file *file, const char __user *buf, static ssize_t fuse_direct_io(struct file *file, const char __user *buf,
size_t count, loff_t *ppos, int write) size_t count, loff_t *ppos, int write)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
size_t nmax = write ? fc->max_write : fc->max_read; size_t nmax = write ? fc->max_write : fc->max_read;
loff_t pos = *ppos; loff_t pos = *ppos;
...@@ -607,7 +607,7 @@ static ssize_t fuse_direct_read(struct file *file, char __user *buf, ...@@ -607,7 +607,7 @@ static ssize_t fuse_direct_read(struct file *file, char __user *buf,
static ssize_t fuse_direct_write(struct file *file, const char __user *buf, static ssize_t fuse_direct_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
ssize_t res; ssize_t res;
/* Don't allow parallel writes to the same file */ /* Don't allow parallel writes to the same file */
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
...@@ -662,7 +662,7 @@ static int convert_fuse_file_lock(const struct fuse_file_lock *ffl, ...@@ -662,7 +662,7 @@ static int convert_fuse_file_lock(const struct fuse_file_lock *ffl,
static void fuse_lk_fill(struct fuse_req *req, struct file *file, static void fuse_lk_fill(struct fuse_req *req, struct file *file,
const struct file_lock *fl, int opcode, pid_t pid) const struct file_lock *fl, int opcode, pid_t pid)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_file *ff = file->private_data; struct fuse_file *ff = file->private_data;
struct fuse_lk_in *arg = &req->misc.lk_in; struct fuse_lk_in *arg = &req->misc.lk_in;
...@@ -682,7 +682,7 @@ static void fuse_lk_fill(struct fuse_req *req, struct file *file, ...@@ -682,7 +682,7 @@ static void fuse_lk_fill(struct fuse_req *req, struct file *file,
static int fuse_getlk(struct file *file, struct file_lock *fl) static int fuse_getlk(struct file *file, struct file_lock *fl)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_req *req; struct fuse_req *req;
struct fuse_lk_out outarg; struct fuse_lk_out outarg;
...@@ -707,7 +707,7 @@ static int fuse_getlk(struct file *file, struct file_lock *fl) ...@@ -707,7 +707,7 @@ static int fuse_getlk(struct file *file, struct file_lock *fl)
static int fuse_setlk(struct file *file, struct file_lock *fl) static int fuse_setlk(struct file *file, struct file_lock *fl)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_req *req; struct fuse_req *req;
int opcode = (fl->fl_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK; int opcode = (fl->fl_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK;
...@@ -734,7 +734,7 @@ static int fuse_setlk(struct file *file, struct file_lock *fl) ...@@ -734,7 +734,7 @@ static int fuse_setlk(struct file *file, struct file_lock *fl)
static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
int err; int err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册