Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20970
b: refs/heads/master
c: 0adb25d
h: refs/heads/master
v: v3
  • Loading branch information
Kirill Korotaev authored and Linus Torvalds committed Mar 11, 2006
1 parent ff08808 commit 8bf360e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 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: 8bd0ee93fef9733c72fef1817330b3ee2b71cf9d
refs/heads/master: 0adb25d2e71ab047423d6fc63d5d184590d0a66f
3 changes: 2 additions & 1 deletion trunk/fs/ext3/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,8 @@ static int ext3_symlink (struct inode * dir,
* We have a transaction open. All is sweetness. It also sets
* i_size in generic_commit_write().
*/
err = page_symlink(inode, symname, l);
err = __page_symlink(inode, symname, l,
mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
if (err) {
ext3_dec_count(handle, inode);
ext3_mark_inode_dirty(handle, inode);
Expand Down
13 changes: 11 additions & 2 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2613,13 +2613,15 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
}
}

int page_symlink(struct inode *inode, const char *symname, int len)
int __page_symlink(struct inode *inode, const char *symname, int len,
gfp_t gfp_mask)
{
struct address_space *mapping = inode->i_mapping;
struct page *page = grab_cache_page(mapping, 0);
struct page *page;
int err = -ENOMEM;
char *kaddr;

page = find_or_create_page(mapping, 0, gfp_mask);
if (!page)
goto fail;
err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);
Expand Down Expand Up @@ -2654,6 +2656,12 @@ int page_symlink(struct inode *inode, const char *symname, int len)
return err;
}

int page_symlink(struct inode *inode, const char *symname, int len)
{
return __page_symlink(inode, symname, len,
mapping_gfp_mask(inode->i_mapping));
}

struct inode_operations page_symlink_inode_operations = {
.readlink = generic_readlink,
.follow_link = page_follow_link_light,
Expand All @@ -2672,6 +2680,7 @@ EXPORT_SYMBOL(lookup_one_len);
EXPORT_SYMBOL(page_follow_link_light);
EXPORT_SYMBOL(page_put_link);
EXPORT_SYMBOL(page_readlink);
EXPORT_SYMBOL(__page_symlink);
EXPORT_SYMBOL(page_symlink);
EXPORT_SYMBOL(page_symlink_inode_operations);
EXPORT_SYMBOL(path_lookup);
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,8 @@ extern int vfs_follow_link(struct nameidata *, const char *);
extern int page_readlink(struct dentry *, char __user *, int);
extern void *page_follow_link_light(struct dentry *, struct nameidata *);
extern void page_put_link(struct dentry *, struct nameidata *, void *);
extern int __page_symlink(struct inode *inode, const char *symname, int len,
gfp_t gfp_mask);
extern int page_symlink(struct inode *inode, const char *symname, int len);
extern struct inode_operations page_symlink_inode_operations;
extern int generic_readlink(struct dentry *, char __user *, int);
Expand Down

0 comments on commit 8bf360e

Please sign in to comment.