Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5904
b: refs/heads/master
c: b8d9598
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Aug 20, 2005
1 parent e87a969 commit 9e61cb3
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 121 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 83c4e43722a2c8a8438b8d165047720fd36aaea4
refs/heads/master: b8d9598c41e999fb094d3811019248197c54274a
4 changes: 2 additions & 2 deletions trunk/arch/i386/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static void disable_lapic_nmi_watchdog(void)
wrmsr(MSR_P6_EVNTSEL0, 0, 0);
break;
case 15:
if (boot_cpu_data.x86_model > 0x3)
if (boot_cpu_data.x86_model > 0x4)
break;

wrmsr(MSR_P4_IQ_CCCR0, 0, 0);
Expand Down Expand Up @@ -432,7 +432,7 @@ void setup_apic_nmi_watchdog (void)
setup_p6_watchdog();
break;
case 15:
if (boot_cpu_data.x86_model > 0x3)
if (boot_cpu_data.x86_model > 0x4)
return;

if (!setup_p4_watchdog())
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/afs/mntpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir,
struct dentry *dentry,
struct nameidata *nd);
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 = {
.open = afs_mntpt_open,
Expand Down Expand Up @@ -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
*/
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 dentry *old_dentry;
Expand All @@ -249,7 +249,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
newmnt = afs_mntpt_do_automount(dentry);
if (IS_ERR(newmnt)) {
path_release(nd);
return PTR_ERR(newmnt);
return (void *)newmnt;
}

old_dentry = nd->dentry;
Expand All @@ -267,7 +267,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
}

kleave(" = %d", err);
return err;
return ERR_PTR(err);
} /* end afs_mntpt_follow_link() */

/*****************************************************************************/
Expand Down
5 changes: 3 additions & 2 deletions trunk/fs/autofs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

#include "autofs_i.h"

static int autofs_follow_link(struct dentry *dentry, struct nameidata *nd)
/* Nothing to release.. */
static void *autofs_follow_link(struct dentry *dentry, struct nameidata *nd)
{
char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data;
nd_set_link(nd, s);
return 0;
return NULL;
}

struct inode_operations autofs_symlink_inode_operations = {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/autofs4/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

#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);
nd_set_link(nd, (char *)ino->u.symlink);
return 0;
return NULL;
}

struct inode_operations autofs4_symlink_inode_operations = {
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/befs/linuxvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ static struct inode *befs_alloc_inode(struct super_block *sb);
static void befs_destroy_inode(struct inode *inode);
static int befs_init_inodecache(void);
static void befs_destroy_inodecache(void);
static int befs_follow_link(struct dentry *, struct nameidata *);
static void befs_put_link(struct dentry *, struct nameidata *);
static void *befs_follow_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,
char **out, int *out_len);
static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
Expand Down Expand Up @@ -487,10 +487,10 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd)
}

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);
if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/cifs/cifsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ extern int cifs_dir_notify(struct file *, unsigned long arg);
extern struct dentry_operations cifs_dentry_ops;

/* Functions related to symlinks */
extern int cifs_follow_link(struct dentry *direntry, struct nameidata *nd);
extern void cifs_put_link(struct dentry *direntry, struct nameidata *nd);
extern void *cifs_follow_link(struct dentry *direntry, struct nameidata *nd);
extern void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *);
extern int cifs_readlink(struct dentry *direntry, char __user *buffer,
int buflen);
extern int cifs_symlink(struct inode *inode, struct dentry *direntry,
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/cifs/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
return rc;
}

int
void *
cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
{
struct inode *inode = direntry->d_inode;
Expand Down Expand Up @@ -148,7 +148,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
out_no_free:
FreeXid(xid);
nd_set_link(nd, target_path);
return 0;
return NULL; /* No cookie */
}

int
Expand Down Expand Up @@ -330,7 +330,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
return rc;
}

void cifs_put_link(struct dentry *direntry, struct nameidata *nd)
void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie)
{
char *p = nd_get_link(nd);
if (!IS_ERR(p))
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/devfs/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2491,11 +2491,11 @@ static int devfs_mknod(struct inode *dir, struct dentry *dentry, int mode,
return 0;
} /* 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);
nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV));
return 0;
return NULL;
} /* End Function devfs_follow_link */

static struct inode_operations devfs_iops = {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/ext2/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "xattr.h"
#include <linux/namei.h>

static int ext2_follow_link(struct dentry *dentry, struct nameidata *nd)
static void *ext2_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct ext2_inode_info *ei = EXT2_I(dentry->d_inode);
nd_set_link(nd, (char *)ei->i_data);
return 0;
return NULL;
}

struct inode_operations ext2_symlink_inode_operations = {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/ext3/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include <linux/namei.h>
#include "xattr.h"

static int ext3_follow_link(struct dentry *dentry, struct nameidata *nd)
static void * ext3_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct ext3_inode_info *ei = EXT3_I(dentry->d_inode);
nd_set_link(nd, (char*)ei->i_data);
return 0;
return NULL;
}

struct inode_operations ext3_symlink_inode_operations = {
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/freevxfs/vxfs_immed.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#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 *);

Expand Down Expand Up @@ -77,7 +77,7 @@ vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np)
{
struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode);
nd_set_link(np, vip->vii_immed.vi_immed);
return 0;
return NULL;
}

/**
Expand Down
16 changes: 9 additions & 7 deletions trunk/fs/jffs2/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/namei.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 =
{
Expand All @@ -27,9 +27,10 @@ struct inode_operations jffs2_symlink_inode_operations =
.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);
char *p = (char *)f->dents;

/*
* We don't acquire the f->sem mutex here since the only data we
Expand All @@ -45,19 +46,20 @@ static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
* nd_set_link() call.
*/

if (!f->dents) {
if (!p) {
printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n");
return -EIO;
p = ERR_PTR(-EIO);
} else {
D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents));
}
D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents));

nd_set_link(nd, (char *)f->dents);
nd_set_link(nd, p);

/*
* We unlock the f->sem mutex but VFS will use the f->dents string. This is safe
* 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.
*/
return 0;
return NULL;
}

4 changes: 2 additions & 2 deletions trunk/fs/jfs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include "jfs_inode.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;
nd_set_link(nd, s);
return 0;
return NULL;
}

struct inode_operations jfs_symlink_inode_operations = {
Expand Down
40 changes: 21 additions & 19 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,20 +501,23 @@ struct path {
static inline int __do_follow_link(struct path *path, struct nameidata *nd)
{
int error;
void *cookie;
struct dentry *dentry = path->dentry;

touch_atime(path->mnt, dentry);
nd_set_link(nd, NULL);

if (path->mnt == nd->mnt)
mntget(path->mnt);
error = dentry->d_inode->i_op->follow_link(dentry, nd);
if (!error) {
cookie = dentry->d_inode->i_op->follow_link(dentry, nd);
error = PTR_ERR(cookie);
if (!IS_ERR(cookie)) {
char *s = nd_get_link(nd);
error = 0;
if (s)
error = __vfs_follow_link(nd, s);
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, nd);
dentry->d_inode->i_op->put_link(dentry, nd, cookie);
}
dput(dentry);
mntput(path->mnt);
Expand Down Expand Up @@ -2344,15 +2347,17 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c
int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen)
{
struct nameidata nd;
int res;
void *cookie;

nd.depth = 0;
res = dentry->d_inode->i_op->follow_link(dentry, &nd);
if (!res) {
res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd));
cookie = dentry->d_inode->i_op->follow_link(dentry, &nd);
if (!IS_ERR(cookie)) {
int res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd));
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, &nd);
dentry->d_inode->i_op->put_link(dentry, &nd, cookie);
cookie = ERR_PTR(res);
}
return res;
return PTR_ERR(cookie);
}

int vfs_follow_link(struct nameidata *nd, const char *link)
Expand Down Expand Up @@ -2395,23 +2400,20 @@ int page_readlink(struct dentry *dentry, char __user *buffer, int buflen)
return res;
}

int page_follow_link_light(struct dentry *dentry, struct nameidata *nd)
void *page_follow_link_light(struct dentry *dentry, struct nameidata *nd)
{
struct page *page;
struct page *page = NULL;
nd_set_link(nd, page_getlink(dentry, &page));
return 0;
return page;
}

void page_put_link(struct dentry *dentry, struct nameidata *nd)
void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
{
if (!IS_ERR(nd_get_link(nd))) {
struct page *page;
page = find_get_page(dentry->d_inode->i_mapping, 0);
if (!page)
BUG();
struct page *page = cookie;

if (page) {
kunmap(page);
page_cache_release(page);
page_cache_release(page);
}
}

Expand Down
1 change: 1 addition & 0 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
error = nfs_revalidate_inode(NFS_SERVER(dir), dir);
if (error < 0) {
res = ERR_PTR(error);
unlock_kernel();
goto out;
}

Expand Down
Loading

0 comments on commit 9e61cb3

Please sign in to comment.