aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 880052cadbcd..b3780e3fc88e 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -22,7 +22,6 @@
22#include <linux/quotaops.h> 22#include <linux/quotaops.h>
23#include <linux/pagemap.h> 23#include <linux/pagemap.h>
24#include <linux/fsnotify.h> 24#include <linux/fsnotify.h>
25#include <linux/smp_lock.h>
26#include <linux/personality.h> 25#include <linux/personality.h>
27#include <linux/security.h> 26#include <linux/security.h>
28#include <linux/syscalls.h> 27#include <linux/syscalls.h>
@@ -1153,14 +1152,12 @@ static int fastcall do_path_lookup(int dfd, const char *name,
1153 1152
1154 fput_light(file, fput_needed); 1153 fput_light(file, fput_needed);
1155 } 1154 }
1156 current->total_link_count = 0; 1155
1157 retval = link_path_walk(name, nd); 1156 retval = path_walk(name, nd);
1158out: 1157out:
1159 if (likely(retval == 0)) { 1158 if (unlikely(!retval && !audit_dummy_context() && nd->dentry &&
1160 if (unlikely(!audit_dummy_context() && nd && nd->dentry &&
1161 nd->dentry->d_inode)) 1159 nd->dentry->d_inode))
1162 audit_inode(name, nd->dentry->d_inode); 1160 audit_inode(name, nd->dentry->d_inode);
1163 }
1164out_fail: 1161out_fail:
1165 return retval; 1162 return retval;
1166 1163
@@ -1350,17 +1347,6 @@ struct dentry *lookup_one_len_kern(const char *name, struct dentry *base, int le
1350 return __lookup_hash_kern(&this, base, NULL); 1347 return __lookup_hash_kern(&this, base, NULL);
1351} 1348}
1352 1349
1353/*
1354 * namei()
1355 *
1356 * is used by most simple commands to get the inode of a specified name.
1357 * Open, link etc use their own routines, but this is enough for things
1358 * like 'chmod' etc.
1359 *
1360 * namei exists in two versions: namei/lnamei. The only difference is
1361 * that namei follows links, while lnamei does not.
1362 * SMP-safe
1363 */
1364int fastcall __user_walk_fd(int dfd, const char __user *name, unsigned flags, 1350int fastcall __user_walk_fd(int dfd, const char __user *name, unsigned flags,
1365 struct nameidata *nd) 1351 struct nameidata *nd)
1366{ 1352{
@@ -2671,19 +2657,9 @@ static char *page_getlink(struct dentry * dentry, struct page **ppage)
2671 struct address_space *mapping = dentry->d_inode->i_mapping; 2657 struct address_space *mapping = dentry->d_inode->i_mapping;
2672 page = read_mapping_page(mapping, 0, NULL); 2658 page = read_mapping_page(mapping, 0, NULL);
2673 if (IS_ERR(page)) 2659 if (IS_ERR(page))
2674 goto sync_fail; 2660 return (char*)page;
2675 wait_on_page_locked(page);
2676 if (!PageUptodate(page))
2677 goto async_fail;
2678 *ppage = page; 2661 *ppage = page;
2679 return kmap(page); 2662 return kmap(page);
2680
2681async_fail:
2682 page_cache_release(page);
2683 return ERR_PTR(-EIO);
2684
2685sync_fail:
2686 return (char*)page;
2687} 2663}
2688 2664
2689int page_readlink(struct dentry *dentry, char __user *buffer, int buflen) 2665int page_readlink(struct dentry *dentry, char __user *buffer, int buflen)