symlink.c (245f0db0de926601353776085e6f6a4c974c5615) | symlink.c (09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a) |
---|---|
1/* 2 * Squashfs - a compressed read only filesystem for Linux 3 * 4 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 5 * Phillip Lougher <phillip@squashfs.org.uk> 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License --- 34 unchanged lines hidden (view full) --- 43#include "squashfs.h" 44#include "xattr.h" 45 46static int squashfs_symlink_readpage(struct file *file, struct page *page) 47{ 48 struct inode *inode = page->mapping->host; 49 struct super_block *sb = inode->i_sb; 50 struct squashfs_sb_info *msblk = sb->s_fs_info; | 1/* 2 * Squashfs - a compressed read only filesystem for Linux 3 * 4 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 5 * Phillip Lougher <phillip@squashfs.org.uk> 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License --- 34 unchanged lines hidden (view full) --- 43#include "squashfs.h" 44#include "xattr.h" 45 46static int squashfs_symlink_readpage(struct file *file, struct page *page) 47{ 48 struct inode *inode = page->mapping->host; 49 struct super_block *sb = inode->i_sb; 50 struct squashfs_sb_info *msblk = sb->s_fs_info; |
51 int index = page->index << PAGE_CACHE_SHIFT; | 51 int index = page->index << PAGE_SHIFT; |
52 u64 block = squashfs_i(inode)->start; 53 int offset = squashfs_i(inode)->offset; | 52 u64 block = squashfs_i(inode)->start; 53 int offset = squashfs_i(inode)->offset; |
54 int length = min_t(int, i_size_read(inode) - index, PAGE_CACHE_SIZE); | 54 int length = min_t(int, i_size_read(inode) - index, PAGE_SIZE); |
55 int bytes, copied; 56 void *pageaddr; 57 struct squashfs_cache_entry *entry; 58 59 TRACE("Entered squashfs_symlink_readpage, page index %ld, start block " 60 "%llx, offset %x\n", page->index, block, offset); 61 62 /* --- 26 unchanged lines hidden (view full) --- 89 squashfs_cache_put(entry); 90 goto error_out; 91 } 92 93 pageaddr = kmap_atomic(page); 94 copied = squashfs_copy_data(pageaddr + bytes, entry, offset, 95 length - bytes); 96 if (copied == length - bytes) | 55 int bytes, copied; 56 void *pageaddr; 57 struct squashfs_cache_entry *entry; 58 59 TRACE("Entered squashfs_symlink_readpage, page index %ld, start block " 60 "%llx, offset %x\n", page->index, block, offset); 61 62 /* --- 26 unchanged lines hidden (view full) --- 89 squashfs_cache_put(entry); 90 goto error_out; 91 } 92 93 pageaddr = kmap_atomic(page); 94 copied = squashfs_copy_data(pageaddr + bytes, entry, offset, 95 length - bytes); 96 if (copied == length - bytes) |
97 memset(pageaddr + length, 0, PAGE_CACHE_SIZE - length); | 97 memset(pageaddr + length, 0, PAGE_SIZE - length); |
98 else 99 block = entry->next_index; 100 kunmap_atomic(pageaddr); 101 squashfs_cache_put(entry); 102 } 103 104 flush_dcache_page(page); 105 SetPageUptodate(page); --- 21 unchanged lines hidden --- | 98 else 99 block = entry->next_index; 100 kunmap_atomic(pageaddr); 101 squashfs_cache_put(entry); 102 } 103 104 flush_dcache_page(page); 105 SetPageUptodate(page); --- 21 unchanged lines hidden --- |