diff options
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/conv.c | 1 | ||||
-rw-r--r-- | fs/9p/error.c | 1 | ||||
-rw-r--r-- | fs/9p/fcall.c | 1 | ||||
-rw-r--r-- | fs/9p/fcprint.c | 1 | ||||
-rw-r--r-- | fs/9p/fid.c | 1 | ||||
-rw-r--r-- | fs/9p/mux.c | 5 | ||||
-rw-r--r-- | fs/9p/trans_fd.c | 1 | ||||
-rw-r--r-- | fs/9p/v9fs.c | 1 | ||||
-rw-r--r-- | fs/9p/v9fs_vfs.h | 2 | ||||
-rw-r--r-- | fs/9p/vfs_addr.c | 3 | ||||
-rw-r--r-- | fs/9p/vfs_file.c | 1 | ||||
-rw-r--r-- | fs/9p/vfs_inode.c | 14 | ||||
-rw-r--r-- | fs/9p/vfs_super.c | 29 |
13 files changed, 28 insertions, 33 deletions
diff --git a/fs/9p/conv.c b/fs/9p/conv.c index a767e05b60bf..1e898144eb7c 100644 --- a/fs/9p/conv.c +++ b/fs/9p/conv.c @@ -24,7 +24,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/9p/error.c b/fs/9p/error.c index 981fe8ecd780..ae91555c1558 100644 --- a/fs/9p/error.c +++ b/fs/9p/error.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/list.h> diff --git a/fs/9p/fcall.c b/fs/9p/fcall.c index 6f2617820a4e..8556097fcda8 100644 --- a/fs/9p/fcall.c +++ b/fs/9p/fcall.c @@ -24,7 +24,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/9p/fcprint.c b/fs/9p/fcprint.c index 583e827baebd..34b96114a28d 100644 --- a/fs/9p/fcprint.c +++ b/fs/9p/fcprint.c @@ -21,7 +21,6 @@ * Boston, MA 02111-1301 USA * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/9p/fid.c b/fs/9p/fid.c index b7608af07ce8..70492ccb4385 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c @@ -20,7 +20,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/9p/mux.c b/fs/9p/mux.c index f4407eb276c7..90a79c784549 100644 --- a/fs/9p/mux.c +++ b/fs/9p/mux.c @@ -23,7 +23,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> @@ -712,7 +711,7 @@ static void v9fs_read_work(void *a) * v9fs_send_request - send 9P request * The function can sleep until the request is scheduled for sending. * The function can be interrupted. Return from the function is not - * a guarantee that the request is sent succesfully. Can return errors + * a guarantee that the request is sent successfully. Can return errors * that can be retrieved by PTR_ERR macros. * * @m: mux data @@ -932,6 +931,8 @@ v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, r.rcall || r.err); } while (!r.rcall && !r.err && err==-ERESTARTSYS && m->trans->status==Connected && !m->err); + + err = -ERESTARTSYS; } sigpending = 1; } diff --git a/fs/9p/trans_fd.c b/fs/9p/trans_fd.c index 94e0a7fd9fc2..34d43355beb7 100644 --- a/fs/9p/trans_fd.c +++ b/fs/9p/trans_fd.c @@ -25,7 +25,6 @@ * */ -#include <linux/config.h> #include <linux/in.h> #include <linux/module.h> #include <linux/net.h> diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index d37416eb5791..22f7ccd58d38 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -23,7 +23,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h index f867b8d3e973..450b0c1b385e 100644 --- a/fs/9p/v9fs_vfs.h +++ b/fs/9p/v9fs_vfs.h @@ -38,7 +38,7 @@ */ extern struct file_system_type v9fs_fs_type; -extern struct address_space_operations v9fs_addr_operations; +extern const struct address_space_operations v9fs_addr_operations; extern const struct file_operations v9fs_file_operations; extern const struct file_operations v9fs_dir_operations; extern struct dentry_operations v9fs_dentry_operations; diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index efda46fb64d9..9dfd259a70b4 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -31,7 +31,6 @@ #include <linux/string.h> #include <linux/smp_lock.h> #include <linux/inet.h> -#include <linux/version.h> #include <linux/pagemap.h> #include <linux/idr.h> @@ -103,6 +102,6 @@ UnmapAndUnlock: return retval; } -struct address_space_operations v9fs_addr_operations = { +const struct address_space_operations v9fs_addr_operations = { .readpage = v9fs_vfs_readpage, }; diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 1a8e46084f0e..c3c47eda7574 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -31,7 +31,6 @@ #include <linux/string.h> #include <linux/smp_lock.h> #include <linux/inet.h> -#include <linux/version.h> #include <linux/list.h> #include <asm/uaccess.h> #include <linux/idr.h> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 2cb87ba4b1c1..2f580a197b8d 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -300,7 +300,7 @@ clunk_fid: fid = V9FS_NOFID; put_fid: - if (fid >= 0) + if (fid != V9FS_NOFID) v9fs_put_idpool(fid, &v9ses->fidpool); kfree(fcall); @@ -530,9 +530,6 @@ error: if (vfid) v9fs_fid_destroy(vfid); - if (inode) - iput(inode); - return err; } @@ -1054,6 +1051,9 @@ static int v9fs_vfs_readlink(struct dentry *dentry, char __user * buffer, int ret; char *link = __getname(); + if (unlikely(!link)) + return -ENOMEM; + if (buflen > PATH_MAX) buflen = PATH_MAX; @@ -1171,9 +1171,6 @@ error: if (vfid) v9fs_fid_destroy(vfid); - if (inode) - iput(inode); - return err; } @@ -1227,6 +1224,9 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, } name = __getname(); + if (unlikely(!name)) + return -ENOMEM; + sprintf(name, "%d\n", oldfid->fid); retval = v9fs_vfs_mkspecial(dir, dentry, V9FS_DMLINK, name); __putname(name); diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 61c599b4a1e3..63320d4e15d2 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -25,7 +25,6 @@ */ #include <linux/kernel.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> @@ -99,12 +98,13 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses, * @flags: mount flags * @dev_name: device name that was mounted * @data: mount options + * @mnt: mountpoint record to be instantiated * */ -static struct super_block *v9fs_get_sb(struct file_system_type - *fs_type, int flags, - const char *dev_name, void *data) +static int v9fs_get_sb(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data, + struct vfsmount *mnt) { struct super_block *sb = NULL; struct v9fs_fcall *fcall = NULL; @@ -123,17 +123,19 @@ static struct super_block *v9fs_get_sb(struct file_system_type v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); if (!v9ses) - return ERR_PTR(-ENOMEM); + return -ENOMEM; if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) { dprintk(DEBUG_ERROR, "problem initiating session\n"); - sb = ERR_PTR(newfid); + retval = newfid; goto out_free_session; } sb = sget(fs_type, NULL, v9fs_set_super, v9ses); - if (IS_ERR(sb)) + if (IS_ERR(sb)) { + retval = PTR_ERR(sb); goto out_close_session; + } v9fs_fill_super(sb, v9ses, flags); inode = v9fs_get_inode(sb, S_IFDIR | mode); @@ -184,19 +186,19 @@ static struct super_block *v9fs_get_sb(struct file_system_type goto put_back_sb; } - return sb; + return simple_set_mnt(mnt, sb); out_close_session: v9fs_session_close(v9ses); out_free_session: kfree(v9ses); - return sb; + return retval; put_back_sb: /* deactivate_super calls v9fs_kill_super which will frees the rest */ up_write(&sb->s_umount); deactivate_super(sb); - return ERR_PTR(retval); + return retval; } /** @@ -253,11 +255,12 @@ static int v9fs_show_options(struct seq_file *m, struct vfsmount *mnt) } static void -v9fs_umount_begin(struct super_block *sb) +v9fs_umount_begin(struct vfsmount *vfsmnt, int flags) { - struct v9fs_session_info *v9ses = sb->s_fs_info; + struct v9fs_session_info *v9ses = vfsmnt->mnt_sb->s_fs_info; - v9fs_session_cancel(v9ses); + if (flags & MNT_FORCE) + v9fs_session_cancel(v9ses); } static struct super_operations v9fs_super_ops = { |