unsigned long n = pos >> PAGE_CACHE_SHIFT;
unsigned long npages = dir_pages(inode);
unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
- unsigned char *types = NULL;
+ unsigned char *types = ext2_filetype_table;
int need_revalidate = (filp->f_version != inode->i_version);
int rc = 0;
ENTRY;
for ( ;(char*)de <= limit; de = ext2_next_entry(de)) {
if (de->inode) {
int over;
- unsigned char d_type = DT_UNKNOWN;
rc = 0; /* no error if we return something */
- if (types && de->file_type < EXT2_FT_MAX)
- d_type = types[de->file_type];
offset = (char *)de - kaddr;
over = filldir(dirent, de->name, de->name_len,
(n<<PAGE_CACHE_SHIFT) | offset,
- le32_to_cpu(de->inode), d_type);
+ le32_to_cpu(de->inode),
+ types[de->file_type &
+ (EXT2_FT_MAX - 1)]);
if (over) {
ext2_put_page(page);
GOTO(done, rc);
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), cmd=%#x\n",
inode->i_ino, inode->i_generation, inode, cmd);
- if (_IOC_TYPE(cmd) == 'T') /* tty ioctls */
+ /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */
+ if (_IOC_TYPE(cmd) == 'T' || _IOC_TYPE(cmd) == 't') /* tty ioctls */
return -ENOTTY;
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_IOCTL);
CDEBUG(D_INODE|D_PAGE, "walking page indices start: %lu j: %lu "
"count: %lu skip: %lu end: %lu%s\n", start, start % count,
count, skip, end, discard ? " (DISCARDING)" : "");
-
+
/* walk through the vmas on the inode and tear down mmaped pages that
* intersect with the lock. this stops immediately if there are no
* mmap()ed regions of the file. This is not efficient at all and
j = min(count - (i % count), end - i + 1);
LASSERT(j > 0);
LASSERT(inode->i_mapping);
- if (ll_teardown_mmaps(inode->i_mapping,
+ if (ll_teardown_mmaps(inode->i_mapping,
(__u64)i << PAGE_CACHE_SHIFT,
((__u64)(i+j) << PAGE_CACHE_SHIFT) - 1) )
break;
ssize_t retval;
__u64 kms;
ENTRY;
- CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),size="LPSZ",offset=%Ld\n",
- inode->i_ino, inode->i_generation, inode, count, *ppos);
+ CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),size=%lu,offset=%Ld=%#Lx\n",
+ inode->i_ino, inode->i_generation,inode,(long)count,*ppos,*ppos);
/* "If nbyte is 0, read() will return 0 and have no other results."
* -- Single Unix Spec */
RETURN(-EFAULT);
RETURN(count);
}
-
- node = ll_node_from_inode(inode, *ppos, *ppos + count - 1,
- LCK_PR);
+
+ node = ll_node_from_inode(inode, *ppos, *ppos + count - 1, LCK_PR);
tree.lt_fd = filp->private_data;
- rc = ll_tree_lock(&tree, node, buf, count,
+ rc = ll_tree_lock(&tree, node, buf, count,
filp->f_flags & O_NONBLOCK ? LDLM_FL_BLOCK_NOWAIT :0);
if (rc != 0)
RETURN(rc);
ssize_t retval;
int rc;
ENTRY;
- CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),size="LPSZ",offset=%Ld\n",
- inode->i_ino, inode->i_generation, inode, count, *ppos);
+ CDEBUG(D_VFSTRACE,"VFS Op:inode=%lu/%u(%p),size=%lu,offset=%Ld=%#Lx\n",
+ inode->i_ino, inode->i_generation,inode,(long)count,*ppos,*ppos);
SIGNAL_MASK_ASSERT(); /* XXX BUG 1511 */
if (file->f_flags & O_LOV_DELAY_CREATE && lsm == NULL)
RETURN(-EBADF);
- LASSERT(lsm);
-
+ LASSERT(lsm != NULL);
+
if (file->f_flags & O_APPEND)
node = ll_node_from_inode(inode, 0, OBD_OBJECT_EOF, LCK_PW);
else
- node = ll_node_from_inode(inode, *ppos, *ppos + count - 1,
+ node = ll_node_from_inode(inode, *ppos, *ppos + count - 1,
LCK_PW);
if (IS_ERR(node))
RETURN(PTR_ERR(node));
tree.lt_fd = file->private_data;
- rc = ll_tree_lock(&tree, node, buf, count,
+ rc = ll_tree_lock(&tree, node, buf, count,
file->f_flags & O_NONBLOCK ? LDLM_FL_BLOCK_NOWAIT :0);
if (rc != 0)
RETURN(rc);
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),cmd=%x\n", inode->i_ino,
inode->i_generation, inode, cmd);
- if (_IOC_TYPE(cmd) == 'T') /* tty ioctls */
+ /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */
+ if (_IOC_TYPE(cmd) == 'T' || _IOC_TYPE(cmd) == 't') /* tty ioctls */
RETURN(-ENOTTY);
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_IOCTL);
struct lustre_handle lockh = {0};
loff_t retval;
ENTRY;
- CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), to=%llu(%s)\n",
- inode->i_ino, inode->i_generation, inode,
- offset + ((origin == 2) ? inode->i_size :
- (origin == 1) ? file->f_pos : 0),
+ retval = offset + ((origin == 2) ? inode->i_size :
+ (origin == 1) ? file->f_pos : 0);
+ CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), to=%Lu=%#Lx(%s)\n",
+ inode->i_ino, inode->i_generation, inode, retval, retval,
origin == 2 ? "SEEK_END": origin == 1 ? "SEEK_CUR" : "SEEK_SET");
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_LLSEEK);