summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/fs/udf/symlink.c
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-11 12:28:04 +0530
committerSrikant Patnaik2015-01-11 12:28:04 +0530
commit871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch)
tree8718f573808810c2a1e8cb8fb6ac469093ca2784 /ANDROID_3.4.5/fs/udf/symlink.c
parent9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff)
downloadFOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure.
Diffstat (limited to 'ANDROID_3.4.5/fs/udf/symlink.c')
-rw-r--r--ANDROID_3.4.5/fs/udf/symlink.c125
1 files changed, 0 insertions, 125 deletions
diff --git a/ANDROID_3.4.5/fs/udf/symlink.c b/ANDROID_3.4.5/fs/udf/symlink.c
deleted file mode 100644
index d7c6dbe4..00000000
--- a/ANDROID_3.4.5/fs/udf/symlink.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * symlink.c
- *
- * PURPOSE
- * Symlink handling routines for the OSTA-UDF(tm) filesystem.
- *
- * COPYRIGHT
- * This file is distributed under the terms of the GNU General Public
- * License (GPL). Copies of the GPL can be obtained from:
- * ftp://prep.ai.mit.edu/pub/gnu/GPL
- * Each contributing author retains all rights to their own work.
- *
- * (C) 1998-2001 Ben Fennema
- * (C) 1999 Stelias Computing Inc
- *
- * HISTORY
- *
- * 04/16/99 blf Created.
- *
- */
-
-#include "udfdecl.h"
-#include <asm/uaccess.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/time.h>
-#include <linux/mm.h>
-#include <linux/stat.h>
-#include <linux/pagemap.h>
-#include <linux/buffer_head.h>
-#include "udf_i.h"
-
-static void udf_pc_to_char(struct super_block *sb, unsigned char *from,
- int fromlen, unsigned char *to)
-{
- struct pathComponent *pc;
- int elen = 0;
- unsigned char *p = to;
-
- while (elen < fromlen) {
- pc = (struct pathComponent *)(from + elen);
- switch (pc->componentType) {
- case 1:
- /*
- * Symlink points to some place which should be agreed
- * upon between originator and receiver of the media. Ignore.
- */
- if (pc->lengthComponentIdent > 0)
- break;
- /* Fall through */
- case 2:
- p = to;
- *p++ = '/';
- break;
- case 3:
- memcpy(p, "../", 3);
- p += 3;
- break;
- case 4:
- memcpy(p, "./", 2);
- p += 2;
- /* that would be . - just ignore */
- break;
- case 5:
- p += udf_get_filename(sb, pc->componentIdent, p,
- pc->lengthComponentIdent);
- *p++ = '/';
- break;
- }
- elen += sizeof(struct pathComponent) + pc->lengthComponentIdent;
- }
- if (p > to + 1)
- p[-1] = '\0';
- else
- p[0] = '\0';
-}
-
-static int udf_symlink_filler(struct file *file, struct page *page)
-{
- struct inode *inode = page->mapping->host;
- struct buffer_head *bh = NULL;
- unsigned char *symlink;
- int err = -EIO;
- unsigned char *p = kmap(page);
- struct udf_inode_info *iinfo;
- uint32_t pos;
-
- iinfo = UDF_I(inode);
- pos = udf_block_map(inode, 0);
-
- down_read(&iinfo->i_data_sem);
- if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
- symlink = iinfo->i_ext.i_data + iinfo->i_lenEAttr;
- } else {
- bh = sb_bread(inode->i_sb, pos);
-
- if (!bh)
- goto out;
-
- symlink = bh->b_data;
- }
-
- udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p);
- brelse(bh);
-
- up_read(&iinfo->i_data_sem);
- SetPageUptodate(page);
- kunmap(page);
- unlock_page(page);
- return 0;
-
-out:
- up_read(&iinfo->i_data_sem);
- SetPageError(page);
- kunmap(page);
- unlock_page(page);
- return err;
-}
-
-/*
- * symlinks can't do much...
- */
-const struct address_space_operations udf_symlink_aops = {
- .readpage = udf_symlink_filler,
-};