4 * Copyright (c) 1999 Al Smith
6 * Portions derived from work (c) 1995,1996 Christian Vogelgsang.
9 #include <linux/string.h>
10 <<<<<<< HEAD
:fs
/efs
/symlink
.c
11 #include <linux/efs_fs.h>
13 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:fs
/efs
/symlink
.c
14 #include <linux/pagemap.h>
15 #include <linux/buffer_head.h>
16 #include <linux/smp_lock.h>
17 <<<<<<< HEAD
:fs
/efs
/symlink
.c
20 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:fs
/efs
/symlink
.c
22 static int efs_symlink_readpage(struct file
*file
, struct page
*page
)
24 char *link
= kmap(page
);
25 struct buffer_head
* bh
;
26 struct inode
* inode
= page
->mapping
->host
;
27 efs_block_t size
= inode
->i_size
;
31 if (size
> 2 * EFS_BLOCKSIZE
)
35 /* read first 512 bytes of link target */
37 bh
= sb_bread(inode
->i_sb
, efs_bmap(inode
, 0));
40 memcpy(link
, bh
->b_data
, (size
> EFS_BLOCKSIZE
) ? EFS_BLOCKSIZE
: size
);
42 if (size
> EFS_BLOCKSIZE
) {
43 bh
= sb_bread(inode
->i_sb
, efs_bmap(inode
, 1));
46 memcpy(link
+ EFS_BLOCKSIZE
, bh
->b_data
, size
- EFS_BLOCKSIZE
);
51 SetPageUptodate(page
);
64 const struct address_space_operations efs_symlink_aops
= {
65 .readpage
= efs_symlink_readpage