Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Symlink inode operations for Coda filesystem
0004  * Original version: (C) 1996 P. Braam and M. Callahan
0005  * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
0006  * 
0007  * Carnegie Mellon encourages users to contribute improvements to
0008  * the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
0009  */
0010 
0011 #include <linux/types.h>
0012 #include <linux/kernel.h>
0013 #include <linux/time.h>
0014 #include <linux/fs.h>
0015 #include <linux/stat.h>
0016 #include <linux/errno.h>
0017 #include <linux/pagemap.h>
0018 
0019 #include <linux/coda.h>
0020 #include "coda_psdev.h"
0021 #include "coda_linux.h"
0022 
0023 static int coda_symlink_filler(struct file *file, struct folio *folio)
0024 {
0025     struct inode *inode = folio->mapping->host;
0026     int error;
0027     struct coda_inode_info *cii;
0028     unsigned int len = PAGE_SIZE;
0029     char *p = folio_address(folio);
0030 
0031     cii = ITOC(inode);
0032 
0033     error = venus_readlink(inode->i_sb, &cii->c_fid, p, &len);
0034     if (error)
0035         goto fail;
0036     folio_mark_uptodate(folio);
0037     folio_unlock(folio);
0038     return 0;
0039 
0040 fail:
0041     folio_set_error(folio);
0042     folio_unlock(folio);
0043     return error;
0044 }
0045 
0046 const struct address_space_operations coda_symlink_aops = {
0047     .read_folio = coda_symlink_filler,
0048 };