/* * linux/fs/nfs/symlink.c * * Copyright (C) 1992 Rick Sladkey * * Optimization changes Copyright (C) 1994 Florian La Roche * * Jun 7 1999, cache symlink lookups in the page cache. -DaveM * * nfs symlink handling code */ #include #include #include #include #include #include #include #include #include #include /* Symlink caching in the page cache is even more simplistic * and straight-forward than readdir caching. */ static int nfs_symlink_filler(struct inode *inode, struct page *page) { int error; error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE); if (error < 0) goto error; SetPageUptodate(page); unlock_page(page); return 0; error: SetPageError(page); unlock_page(page); return -EIO; } static const char *nfs_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *done) { struct page *page; void *err; if (!dentry) { err = ERR_PTR(nfs_revalidate_mapping_rcu(inode)); if (err) return err; page = find_get_page(inode->i_mapping, 0); if (!page) return ERR_PTR(-ECHILD); if (!PageUptodate(page)) { put_page(page); return ERR_PTR(-ECHILD); } } else { err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping)); if (err) return err; page = read_cache_page(&inode->i_data, 0, (filler_t *)nfs_symlink_filler, inode); if (IS_ERR(page)) return ERR_CAST(page); } set_delayed_call(done, page_put_link, page); return page_address(page); } /* * symlinks can't do much... */ const struct inode_operations nfs_symlink_inode_operations = { .get_link = nfs_get_link, .getattr = nfs_getattr, .setattr = nfs_setattr, }; e/include?h=nds-private-remove&id=926af6273fc683cd98cd0ce7bf0d04a02eed6742'>treecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2017-02-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds3-7/+10
2017-02-07udp: properly cope with csum errorsEric Dumazet1-1/+3
2017-02-04netlabel: out of bound access in cipso_v4_validate()Eric Dumazet1-0/+4
2017-02-04Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/ker...Linus Torvalds1-0/+17
2017-02-04Merge tag 'char-misc-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/g...Linus Torvalds1-2/+30
2017-02-03base/memory, hotplug: fix a kernel oops in show_valid_zones()Toshi Kani1-1/+2
2017-02-03Merge tag 'drm-fixes-for-v4.10-rc7' of git://people.freedesktop.org/~airlied/...Linus Torvalds2-1/+16
2017-02-03Merge branch 'modversions' (modversions fixes for powerpc from Ard)Linus Torvalds3-17/+25
2017-02-03log2: make order_base_2() behave correctly on const input value zeroArd Biesheuvel1-1/+12
2017-02-03module: unify absolute krctab definitions for 32-bit and 64-bitArd Biesheuvel1-7/+0
2017-02-03modversions: treat symbol CRCs as 32 bit quantitiesArd Biesheuvel3-12/+27
2017-02-03ipv6: sr: remove cleanup flag and fix HMAC computationDavid Lebrun1-6/+3
2017-02-02Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/ke...Linus Torvalds1-3/+0
2017-02-01Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds4-19/+26
2017-02-01Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir...Linus Torvalds1-0/+1
2017-02-01net: fix ndo_features_check/ndo_fix_features comment orderingDimitris Michailidis1-14/+15
2017-02-01perf/x86/intel/uncore: Make package handling more robustThomas Gleixner1-2/+0