~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/ocfs2/symlink.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  linux/cluster/ssi/cfs/symlink.c
  3  *
  4  *      This program is free software; you can redistribute it and/or
  5  *      modify it under the terms of the GNU General Public License as
  6  *      published by the Free Software Foundation; either version 2 of
  7  *      the License, or (at your option) any later version.
  8  *
  9  *      This program is distributed in the hope that it will be useful,
 10  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  *      MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE
 12  *      or NON INFRINGEMENT.  See the GNU General Public License for more
 13  *      details.
 14  *
 15  *      You should have received a copy of the GNU General Public License
 16  *      along with this program; if not, write to the Free Software
 17  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 18  *
 19  *      Questions/Comments/Bugfixes to ssic-linux-devel@lists.sourceforge.net
 20  *
 21  *  Copyright (C) 1992  Rick Sladkey
 22  *
 23  *  Optimization changes Copyright (C) 1994 Florian La Roche
 24  *
 25  *  Jun 7 1999, cache symlink lookups in the page cache.  -DaveM
 26  *
 27  *  Portions Copyright (C) 2001 Compaq Computer Corporation
 28  *
 29  *  ocfs2 symlink handling code.
 30  *
 31  *  Copyright (C) 2004, 2005 Oracle.
 32  *
 33  */
 34 
 35 #include <linux/fs.h>
 36 #include <linux/types.h>
 37 #include <linux/slab.h>
 38 #include <linux/pagemap.h>
 39 #include <linux/namei.h>
 40 
 41 #include <cluster/masklog.h>
 42 
 43 #include "ocfs2.h"
 44 
 45 #include "alloc.h"
 46 #include "file.h"
 47 #include "inode.h"
 48 #include "journal.h"
 49 #include "symlink.h"
 50 #include "xattr.h"
 51 
 52 #include "buffer_head_io.h"
 53 
 54 
 55 static int ocfs2_fast_symlink_read_folio(struct file *f, struct folio *folio)
 56 {
 57         struct page *page = &folio->page;
 58         struct inode *inode = page->mapping->host;
 59         struct buffer_head *bh = NULL;
 60         int status = ocfs2_read_inode_block(inode, &bh);
 61         struct ocfs2_dinode *fe;
 62         const char *link;
 63         void *kaddr;
 64         size_t len;
 65 
 66         if (status < 0) {
 67                 mlog_errno(status);
 68                 return status;
 69         }
 70 
 71         fe = (struct ocfs2_dinode *) bh->b_data;
 72         link = (char *) fe->id2.i_symlink;
 73         /* will be less than a page size */
 74         len = strnlen(link, ocfs2_fast_symlink_chars(inode->i_sb));
 75         kaddr = kmap_atomic(page);
 76         memcpy(kaddr, link, len + 1);
 77         kunmap_atomic(kaddr);
 78         SetPageUptodate(page);
 79         unlock_page(page);
 80         brelse(bh);
 81         return 0;
 82 }
 83 
 84 const struct address_space_operations ocfs2_fast_symlink_aops = {
 85         .read_folio             = ocfs2_fast_symlink_read_folio,
 86 };
 87 
 88 const struct inode_operations ocfs2_symlink_inode_operations = {
 89         .get_link       = page_get_link,
 90         .getattr        = ocfs2_getattr,
 91         .setattr        = ocfs2_setattr,
 92         .listxattr      = ocfs2_listxattr,
 93         .fiemap         = ocfs2_fiemap,
 94 };
 95 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php