dect
/
linux-2.6
Archived
13
0
Fork 0

[PATCH] Fix up symlink function pointers

This fixes up the symlink functions for the calling convention change:

 * afs, autofs4, befs, devfs, freevxfs, jffs2, jfs, ncpfs, procfs,
   smbfs, sysvfs, ufs, xfs - prototype change for ->follow_link()
 * befs, smbfs, xfs - same for ->put_link()

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Al Viro 2005-08-20 00:17:39 +01:00 committed by Linus Torvalds
parent cc314eef01
commit 008b150a3c
13 changed files with 37 additions and 37 deletions

View File

@ -30,7 +30,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir,
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd); struct nameidata *nd);
static int afs_mntpt_open(struct inode *inode, struct file *file); static int afs_mntpt_open(struct inode *inode, struct file *file);
static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd);
struct file_operations afs_mntpt_file_operations = { struct file_operations afs_mntpt_file_operations = {
.open = afs_mntpt_open, .open = afs_mntpt_open,
@ -233,7 +233,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
/* /*
* follow a link from a mountpoint directory, thus causing it to be mounted * follow a link from a mountpoint directory, thus causing it to be mounted
*/ */
static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct vfsmount *newmnt; struct vfsmount *newmnt;
struct dentry *old_dentry; struct dentry *old_dentry;
@ -249,7 +249,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
newmnt = afs_mntpt_do_automount(dentry); newmnt = afs_mntpt_do_automount(dentry);
if (IS_ERR(newmnt)) { if (IS_ERR(newmnt)) {
path_release(nd); path_release(nd);
return PTR_ERR(newmnt); return (void *)newmnt;
} }
old_dentry = nd->dentry; old_dentry = nd->dentry;
@ -267,7 +267,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
} }
kleave(" = %d", err); kleave(" = %d", err);
return err; return ERR_PTR(err);
} /* end afs_mntpt_follow_link() */ } /* end afs_mntpt_follow_link() */
/*****************************************************************************/ /*****************************************************************************/

View File

@ -12,11 +12,11 @@
#include "autofs_i.h" #include "autofs_i.h"
static int autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct autofs_info *ino = autofs4_dentry_ino(dentry); struct autofs_info *ino = autofs4_dentry_ino(dentry);
nd_set_link(nd, (char *)ino->u.symlink); nd_set_link(nd, (char *)ino->u.symlink);
return 0; return NULL;
} }
struct inode_operations autofs4_symlink_inode_operations = { struct inode_operations autofs4_symlink_inode_operations = {

View File

@ -41,8 +41,8 @@ static struct inode *befs_alloc_inode(struct super_block *sb);
static void befs_destroy_inode(struct inode *inode); static void befs_destroy_inode(struct inode *inode);
static int befs_init_inodecache(void); static int befs_init_inodecache(void);
static void befs_destroy_inodecache(void); static void befs_destroy_inodecache(void);
static int befs_follow_link(struct dentry *, struct nameidata *); static void *befs_follow_link(struct dentry *, struct nameidata *);
static void befs_put_link(struct dentry *, struct nameidata *); static void befs_put_link(struct dentry *, struct nameidata *, void *);
static int befs_utf2nls(struct super_block *sb, const char *in, int in_len, static int befs_utf2nls(struct super_block *sb, const char *in, int in_len,
char **out, int *out_len); char **out, int *out_len);
static int befs_nls2utf(struct super_block *sb, const char *in, int in_len, static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
@ -487,10 +487,10 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd)
} }
nd_set_link(nd, link); nd_set_link(nd, link);
return 0; return NULL;
} }
static void befs_put_link(struct dentry *dentry, struct nameidata *nd) static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
{ {
befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
if (befs_ino->i_flags & BEFS_LONG_SYMLINK) { if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {

View File

@ -2491,11 +2491,11 @@ static int devfs_mknod(struct inode *dir, struct dentry *dentry, int mode,
return 0; return 0;
} /* End Function devfs_mknod */ } /* End Function devfs_mknod */
static int devfs_follow_link(struct dentry *dentry, struct nameidata *nd) static void *devfs_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct devfs_entry *p = get_devfs_entry_from_vfs_inode(dentry->d_inode); struct devfs_entry *p = get_devfs_entry_from_vfs_inode(dentry->d_inode);
nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV)); nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV));
return 0; return NULL;
} /* End Function devfs_follow_link */ } /* End Function devfs_follow_link */
static struct inode_operations devfs_iops = { static struct inode_operations devfs_iops = {

View File

@ -38,7 +38,7 @@
#include "vxfs_inode.h" #include "vxfs_inode.h"
static int vxfs_immed_follow_link(struct dentry *, struct nameidata *); static void * vxfs_immed_follow_link(struct dentry *, struct nameidata *);
static int vxfs_immed_readpage(struct file *, struct page *); static int vxfs_immed_readpage(struct file *, struct page *);
@ -77,7 +77,7 @@ vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np)
{ {
struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode); struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode);
nd_set_link(np, vip->vii_immed.vi_immed); nd_set_link(np, vip->vii_immed.vi_immed);
return 0; return NULL;
} }
/** /**

View File

@ -18,7 +18,7 @@
#include <linux/namei.h> #include <linux/namei.h>
#include "nodelist.h" #include "nodelist.h"
static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd); static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
struct inode_operations jffs2_symlink_inode_operations = struct inode_operations jffs2_symlink_inode_operations =
{ {
@ -27,7 +27,7 @@ struct inode_operations jffs2_symlink_inode_operations =
.setattr = jffs2_setattr .setattr = jffs2_setattr
}; };
static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd) static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct jffs2_inode_info *f = JFFS2_INODE_INFO(dentry->d_inode); struct jffs2_inode_info *f = JFFS2_INODE_INFO(dentry->d_inode);
char *p = (char *)f->dents; char *p = (char *)f->dents;
@ -60,6 +60,6 @@ static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
* since the only way that may cause f->dents to be changed is iput() operation. * since the only way that may cause f->dents to be changed is iput() operation.
* But VFS will not use f->dents after iput() has been called. * But VFS will not use f->dents after iput() has been called.
*/ */
return 0; return NULL;
} }

View File

@ -22,11 +22,11 @@
#include "jfs_inode.h" #include "jfs_inode.h"
#include "jfs_xattr.h" #include "jfs_xattr.h"
static int jfs_follow_link(struct dentry *dentry, struct nameidata *nd) static void *jfs_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
char *s = JFS_IP(dentry->d_inode)->i_inline; char *s = JFS_IP(dentry->d_inode)->i_inline;
nd_set_link(nd, s); nd_set_link(nd, s);
return 0; return NULL;
} }
struct inode_operations jfs_symlink_inode_operations = { struct inode_operations jfs_symlink_inode_operations = {

View File

@ -890,7 +890,7 @@ static struct file_operations proc_seccomp_operations = {
}; };
#endif /* CONFIG_SECCOMP */ #endif /* CONFIG_SECCOMP */
static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
int error = -EACCES; int error = -EACCES;
@ -907,7 +907,7 @@ static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
error = PROC_I(inode)->op.proc_get_link(inode, &nd->dentry, &nd->mnt); error = PROC_I(inode)->op.proc_get_link(inode, &nd->dentry, &nd->mnt);
nd->last_type = LAST_BIND; nd->last_type = LAST_BIND;
out: out:
return error; return ERR_PTR(error);
} }
static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt, static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt,
@ -1692,11 +1692,11 @@ static int proc_self_readlink(struct dentry *dentry, char __user *buffer,
return vfs_readlink(dentry,buffer,buflen,tmp); return vfs_readlink(dentry,buffer,buflen,tmp);
} }
static int proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
char tmp[30]; char tmp[30];
sprintf(tmp, "%d", current->tgid); sprintf(tmp, "%d", current->tgid);
return vfs_follow_link(nd,tmp); return ERR_PTR(vfs_follow_link(nd,tmp));
} }
static struct inode_operations proc_self_inode_operations = { static struct inode_operations proc_self_inode_operations = {

View File

@ -329,10 +329,10 @@ static void release_inode_number(unsigned int inum)
spin_unlock(&proc_inum_lock); spin_unlock(&proc_inum_lock);
} }
static int proc_follow_link(struct dentry *dentry, struct nameidata *nd) static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
nd_set_link(nd, PDE(dentry->d_inode)->data); nd_set_link(nd, PDE(dentry->d_inode)->data);
return 0; return NULL;
} }
static struct inode_operations proc_link_inode_operations = { static struct inode_operations proc_link_inode_operations = {

View File

@ -34,7 +34,7 @@ int smb_symlink(struct inode *inode, struct dentry *dentry, const char *oldname)
return smb_proc_symlink(server_from_dentry(dentry), dentry, oldname); return smb_proc_symlink(server_from_dentry(dentry), dentry, oldname);
} }
static int smb_follow_link(struct dentry *dentry, struct nameidata *nd) static void *smb_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
char *link = __getname(); char *link = __getname();
DEBUG1("followlink of %s/%s\n", DENTRY_PATH(dentry)); DEBUG1("followlink of %s/%s\n", DENTRY_PATH(dentry));
@ -52,10 +52,10 @@ static int smb_follow_link(struct dentry *dentry, struct nameidata *nd)
} }
} }
nd_set_link(nd, link); nd_set_link(nd, link);
return 0; return NULL;
} }
static void smb_put_link(struct dentry *dentry, struct nameidata *nd) static void smb_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
{ {
char *s = nd_get_link(nd); char *s = nd_get_link(nd);
if (!IS_ERR(s)) if (!IS_ERR(s))

View File

@ -8,10 +8,10 @@
#include "sysv.h" #include "sysv.h"
#include <linux/namei.h> #include <linux/namei.h>
static int sysv_follow_link(struct dentry *dentry, struct nameidata *nd) static void *sysv_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
nd_set_link(nd, (char *)SYSV_I(dentry->d_inode)->i_data); nd_set_link(nd, (char *)SYSV_I(dentry->d_inode)->i_data);
return 0; return NULL;
} }
struct inode_operations sysv_fast_symlink_inode_operations = { struct inode_operations sysv_fast_symlink_inode_operations = {

View File

@ -29,11 +29,11 @@
#include <linux/namei.h> #include <linux/namei.h>
#include <linux/ufs_fs.h> #include <linux/ufs_fs.h>
static int ufs_follow_link(struct dentry *dentry, struct nameidata *nd) static void *ufs_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct ufs_inode_info *p = UFS_I(dentry->d_inode); struct ufs_inode_info *p = UFS_I(dentry->d_inode);
nd_set_link(nd, (char*)p->i_u1.i_symlink); nd_set_link(nd, (char*)p->i_u1.i_symlink);
return 0; return NULL;
} }
struct inode_operations ufs_fast_symlink_inode_operations = { struct inode_operations ufs_fast_symlink_inode_operations = {

View File

@ -374,7 +374,7 @@ linvfs_rename(
* we need to be very careful about how much stack we use. * we need to be very careful about how much stack we use.
* uio is kmalloced for this reason... * uio is kmalloced for this reason...
*/ */
STATIC int STATIC void *
linvfs_follow_link( linvfs_follow_link(
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
@ -391,14 +391,14 @@ linvfs_follow_link(
link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL); link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
if (!link) { if (!link) {
nd_set_link(nd, ERR_PTR(-ENOMEM)); nd_set_link(nd, ERR_PTR(-ENOMEM));
return 0; return NULL;
} }
uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL); uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
if (!uio) { if (!uio) {
kfree(link); kfree(link);
nd_set_link(nd, ERR_PTR(-ENOMEM)); nd_set_link(nd, ERR_PTR(-ENOMEM));
return 0; return NULL;
} }
vp = LINVFS_GET_VP(dentry->d_inode); vp = LINVFS_GET_VP(dentry->d_inode);
@ -422,10 +422,10 @@ linvfs_follow_link(
kfree(uio); kfree(uio);
nd_set_link(nd, link); nd_set_link(nd, link);
return 0; return NULL;
} }
static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd) static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
{ {
char *s = nd_get_link(nd); char *s = nd_get_link(nd);
if (!IS_ERR(s)) if (!IS_ERR(s))