diff options
| author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-27 08:30:07 -0400 |
|---|---|---|
| committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-27 08:30:07 -0400 |
| commit | efda9452046bdd707b23a85b7846ec33548f84f1 (patch) | |
| tree | f08c915049ea1829ba115cd41a0ba28ddf184e07 /mm/shmem.c | |
| parent | b01f2cc1c37ac3d5ca313c90370a586dffe5aca9 (diff) | |
| parent | 36676bcbf9f6bcbea9d06e67ee8d04eacde54952 (diff) | |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'mm/shmem.c')
| -rw-r--r-- | mm/shmem.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index e64fa726a790..5a81b1ee4f7a 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
| @@ -1773,32 +1773,27 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s | |||
| 1773 | return 0; | 1773 | return 0; |
| 1774 | } | 1774 | } |
| 1775 | 1775 | ||
| 1776 | static int shmem_follow_link_inline(struct dentry *dentry, struct nameidata *nd) | 1776 | static void *shmem_follow_link_inline(struct dentry *dentry, struct nameidata *nd) |
| 1777 | { | 1777 | { |
| 1778 | nd_set_link(nd, (char *)SHMEM_I(dentry->d_inode)); | 1778 | nd_set_link(nd, (char *)SHMEM_I(dentry->d_inode)); |
| 1779 | return 0; | 1779 | return NULL; |
| 1780 | } | 1780 | } |
| 1781 | 1781 | ||
| 1782 | static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd) | 1782 | static void *shmem_follow_link(struct dentry *dentry, struct nameidata *nd) |
| 1783 | { | 1783 | { |
| 1784 | struct page *page = NULL; | 1784 | struct page *page = NULL; |
| 1785 | int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL); | 1785 | int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL); |
| 1786 | nd_set_link(nd, res ? ERR_PTR(res) : kmap(page)); | 1786 | nd_set_link(nd, res ? ERR_PTR(res) : kmap(page)); |
| 1787 | return 0; | 1787 | return page; |
| 1788 | } | 1788 | } |
| 1789 | 1789 | ||
| 1790 | static void shmem_put_link(struct dentry *dentry, struct nameidata *nd) | 1790 | static void shmem_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
| 1791 | { | 1791 | { |
| 1792 | if (!IS_ERR(nd_get_link(nd))) { | 1792 | if (!IS_ERR(nd_get_link(nd))) { |
| 1793 | struct page *page; | 1793 | struct page *page = cookie; |
| 1794 | |||
| 1795 | page = find_get_page(dentry->d_inode->i_mapping, 0); | ||
| 1796 | if (!page) | ||
| 1797 | BUG(); | ||
| 1798 | kunmap(page); | 1794 | kunmap(page); |
| 1799 | mark_page_accessed(page); | 1795 | mark_page_accessed(page); |
| 1800 | page_cache_release(page); | 1796 | page_cache_release(page); |
| 1801 | page_cache_release(page); | ||
| 1802 | } | 1797 | } |
| 1803 | } | 1798 | } |
| 1804 | 1799 | ||
