diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index e28de846c591..8dc2b038d5d9 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2224,13 +2224,17 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de | |||
2224 | * and other special files. --ADM | 2224 | * and other special files. --ADM |
2225 | */ | 2225 | */ |
2226 | asmlinkage long sys_linkat(int olddfd, const char __user *oldname, | 2226 | asmlinkage long sys_linkat(int olddfd, const char __user *oldname, |
2227 | int newdfd, const char __user *newname) | 2227 | int newdfd, const char __user *newname, |
2228 | int flags) | ||
2228 | { | 2229 | { |
2229 | struct dentry *new_dentry; | 2230 | struct dentry *new_dentry; |
2230 | struct nameidata nd, old_nd; | 2231 | struct nameidata nd, old_nd; |
2231 | int error; | 2232 | int error; |
2232 | char * to; | 2233 | char * to; |
2233 | 2234 | ||
2235 | if (flags != 0) | ||
2236 | return -EINVAL; | ||
2237 | |||
2234 | to = getname(newname); | 2238 | to = getname(newname); |
2235 | if (IS_ERR(to)) | 2239 | if (IS_ERR(to)) |
2236 | return PTR_ERR(to); | 2240 | return PTR_ERR(to); |
@@ -2263,7 +2267,7 @@ exit: | |||
2263 | 2267 | ||
2264 | asmlinkage long sys_link(const char __user *oldname, const char __user *newname) | 2268 | asmlinkage long sys_link(const char __user *oldname, const char __user *newname) |
2265 | { | 2269 | { |
2266 | return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname); | 2270 | return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); |
2267 | } | 2271 | } |
2268 | 2272 | ||
2269 | /* | 2273 | /* |
@@ -2609,13 +2613,15 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) | |||
2609 | } | 2613 | } |
2610 | } | 2614 | } |
2611 | 2615 | ||
2612 | int page_symlink(struct inode *inode, const char *symname, int len) | 2616 | int __page_symlink(struct inode *inode, const char *symname, int len, |
2617 | gfp_t gfp_mask) | ||
2613 | { | 2618 | { |
2614 | struct address_space *mapping = inode->i_mapping; | 2619 | struct address_space *mapping = inode->i_mapping; |
2615 | struct page *page = grab_cache_page(mapping, 0); | 2620 | struct page *page; |
2616 | int err = -ENOMEM; | 2621 | int err = -ENOMEM; |
2617 | char *kaddr; | 2622 | char *kaddr; |
2618 | 2623 | ||
2624 | page = find_or_create_page(mapping, 0, gfp_mask); | ||
2619 | if (!page) | 2625 | if (!page) |
2620 | goto fail; | 2626 | goto fail; |
2621 | err = mapping->a_ops->prepare_write(NULL, page, 0, len-1); | 2627 | err = mapping->a_ops->prepare_write(NULL, page, 0, len-1); |
@@ -2650,6 +2656,12 @@ fail: | |||
2650 | return err; | 2656 | return err; |
2651 | } | 2657 | } |
2652 | 2658 | ||
2659 | int page_symlink(struct inode *inode, const char *symname, int len) | ||
2660 | { | ||
2661 | return __page_symlink(inode, symname, len, | ||
2662 | mapping_gfp_mask(inode->i_mapping)); | ||
2663 | } | ||
2664 | |||
2653 | struct inode_operations page_symlink_inode_operations = { | 2665 | struct inode_operations page_symlink_inode_operations = { |
2654 | .readlink = generic_readlink, | 2666 | .readlink = generic_readlink, |
2655 | .follow_link = page_follow_link_light, | 2667 | .follow_link = page_follow_link_light, |
@@ -2668,6 +2680,7 @@ EXPORT_SYMBOL(lookup_one_len); | |||
2668 | EXPORT_SYMBOL(page_follow_link_light); | 2680 | EXPORT_SYMBOL(page_follow_link_light); |
2669 | EXPORT_SYMBOL(page_put_link); | 2681 | EXPORT_SYMBOL(page_put_link); |
2670 | EXPORT_SYMBOL(page_readlink); | 2682 | EXPORT_SYMBOL(page_readlink); |
2683 | EXPORT_SYMBOL(__page_symlink); | ||
2671 | EXPORT_SYMBOL(page_symlink); | 2684 | EXPORT_SYMBOL(page_symlink); |
2672 | EXPORT_SYMBOL(page_symlink_inode_operations); | 2685 | EXPORT_SYMBOL(page_symlink_inode_operations); |
2673 | EXPORT_SYMBOL(path_lookup); | 2686 | EXPORT_SYMBOL(path_lookup); |