34 #include <linux/time.h>
37 #include <linux/kernel.h>
48 #define VXFS_BLOCK_PER_PAGE(sbp) ((PAGE_CACHE_SIZE / (sbp)->s_blocksize))
51 static struct dentry * vxfs_lookup(
struct inode *,
struct dentry *,
unsigned int);
55 .lookup = vxfs_lookup,
61 .readdir = vxfs_readdir,
72 dir_blocks(
struct inode *
ip)
75 return (ip->
i_size + bsize - 1) & ~(bsize - 1);
114 vxfs_find_entry(
struct inode *ip,
struct dentry *
dp,
struct page **
ppp)
118 const char *name = dp->
d_name.name;
121 npages = dir_pages(ip);
122 nblocks = dir_blocks(ip);
125 for (page = 0; page < npages; page++) {
134 for (block = 0; block <= nblocks && block <= pblocks; block++) {
139 baddr = kaddr + (block * bsize);
145 for (; (
caddr_t)de <= limit; de = vxfs_next_entry(de)) {
150 if (vxfs_match(namelen, name, de)) {
175 vxfs_inode_by_name(
struct inode *dip,
struct dentry *dp)
181 de = vxfs_find_entry(dip, dp, &pp);
206 vxfs_lookup(
struct inode *dip,
struct dentry *dp,
unsigned int flags)
208 struct inode *ip =
NULL;
214 ino = vxfs_inode_by_name(dip, dp);
240 struct inode *ip = fp->
f_path.dentry->d_inode;
246 switch ((
long)fp->
f_pos) {
264 npages = dir_pages(ip);
265 nblocks = dir_blocks(ip);
272 for (; page < npages; page++, block = 0) {
281 for (; block <= nblocks && block <= pblocks; block++) {
286 baddr = kaddr + (block * bsize);
295 for (; (
caddr_t)de <= limit; de = vxfs_next_entry(de)) {
305 ((page << PAGE_CACHE_SHIFT) | offset) + 2,