cregit-Linux how code gets into the kernel

Release 4.10 fs/ext4/symlink.c

Directory: fs/ext4
/*
 *  linux/fs/ext4/symlink.c
 *
 * Only fast symlinks left here - the rest is done by generic code. AV, 1999
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card (card@masi.ibp.fr)
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 *
 *  from
 *
 *  linux/fs/minix/symlink.c
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 *
 *  ext4 symlink handling code
 */

#include <linux/fs.h>
#include <linux/namei.h>
#include "ext4.h"
#include "xattr.h"


static const char *ext4_encrypted_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *done) { struct page *cpage = NULL; char *caddr, *paddr = NULL; struct fscrypt_str cstr, pstr; struct fscrypt_symlink_data *sd; int res; u32 max_size = inode->i_sb->s_blocksize; if (!dentry) return ERR_PTR(-ECHILD); res = fscrypt_get_encryption_info(inode); if (res) return ERR_PTR(res); if (ext4_inode_is_fast_symlink(inode)) { caddr = (char *) EXT4_I(inode)->i_data; max_size = sizeof(EXT4_I(inode)->i_data); } else { cpage = read_mapping_page(inode->i_mapping, 0, NULL); if (IS_ERR(cpage)) return ERR_CAST(cpage); caddr = page_address(cpage); } /* Symlink is encrypted */ sd = (struct fscrypt_symlink_data *)caddr; cstr.name = sd->encrypted_path; cstr.len = le16_to_cpu(sd->len); if ((cstr.len + sizeof(struct fscrypt_symlink_data) - 1) > max_size) { /* Symlink data on the disk is corrupted */ res = -EFSCORRUPTED; goto errout; } res = fscrypt_fname_alloc_buffer(inode, cstr.len, &pstr); if (res) goto errout; paddr = pstr.name; res = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr); if (res) goto errout; /* Null-terminate the name */ paddr[pstr.len] = '\0'; if (cpage) put_page(cpage); set_delayed_call(done, kfree_link, paddr); return paddr; errout: if (cpage) put_page(cpage); kfree(paddr); return ERR_PTR(res); }

Contributors

PersonTokensPropCommitsCommitProp
theodore tsotheodore tso24174.61%320.00%
al viroal viro3811.76%533.33%
jaegeuk kimjaegeuk kim206.19%16.67%
dave kleikampdave kleikamp113.41%16.67%
eric biggerseric biggers82.48%213.33%
linus torvaldslinus torvalds20.62%16.67%
kirill a. shutemovkirill a. shutemov20.62%16.67%
darrick j. wongdarrick j. wong10.31%16.67%
Total323100.00%15100.00%

const struct inode_operations ext4_encrypted_symlink_inode_operations = { .get_link = ext4_encrypted_get_link, .setattr = ext4_setattr, .listxattr = ext4_listxattr, }; const struct inode_operations ext4_symlink_inode_operations = { .get_link = page_get_link, .setattr = ext4_setattr, .listxattr = ext4_listxattr, }; const struct inode_operations ext4_fast_symlink_inode_operations = { .get_link = simple_get_link, .setattr = ext4_setattr, .listxattr = ext4_listxattr, };

Overall Contributors

PersonTokensPropCommitsCommitProp
theodore tsotheodore tso24460.70%314.29%
al viroal viro6115.17%628.57%
dave kleikampdave kleikamp4310.70%14.76%
jaegeuk kimjaegeuk kim204.98%14.76%
dmitriy monakhovdmitriy monakhov102.49%14.76%
eric biggerseric biggers81.99%29.52%
mingming caomingming cao51.24%14.76%
kirill a. shutemovkirill a. shutemov20.50%14.76%
christoph hellwigchristoph hellwig20.50%14.76%
linus torvaldslinus torvalds20.50%14.76%
arjan van de venarjan van de ven20.50%14.76%
tao matao ma20.50%14.76%
darrick j. wongdarrick j. wong10.25%14.76%
Total402100.00%21100.00%
Directory: fs/ext4
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.