static unsigned qnx6_match(struct super_block *s, int len, const char *name,
static unsigned qnx6_lfile_checksum(char *name, unsigned size)
crc = ((crc >> 1) + *(name++)) ^
((crc & 0x00000001) ? 0x80000000 : 0);
static struct page *qnx6_get_page(struct inode *dir, unsigned long n)
struct address_space *mapping = dir->i_mapping;
struct page *page = read_mapping_page(mapping, n, NULL);
static unsigned last_entry(struct inode *inode, unsigned long page_nr)
unsigned long last_byte = inode->i_size;
last_byte -= page_nr << PAGE_SHIFT;
if (last_byte > PAGE_SIZE)
return last_byte / QNX6_DIR_ENTRY_SIZE;
static struct qnx6_long_filename *qnx6_longname(struct super_block *sb,
struct qnx6_long_dir_entry *de,
struct qnx6_sb_info *sbi = QNX6_SB(sb);
u32 s = fs32_to_cpu(sbi, de->de_long_inode);
u32 n = s >> (PAGE_SHIFT - sb->s_blocksize_bits);
u32 offs = (s << sb->s_blocksize_bits) & ~PAGE_MASK;
struct address_space *mapping = sbi->longfile->i_mapping;
struct page *page = read_mapping_page(mapping, n, NULL);
return (struct qnx6_long_filename *)(page_address(page) + offs);
static int qnx6_dir_longfilename(struct inode *inode,
struct qnx6_long_dir_entry *de,
struct qnx6_long_filename *lf;
struct super_block *s = inode->i_sb;
struct qnx6_sb_info *sbi = QNX6_SB(s);
if (de->de_size != 0xff) {
pr_err("invalid direntry size (%i).\n", de->de_size);
lf = qnx6_longname(s, de, &page);
pr_err("Error reading longname\n");
lf_size = fs16_to_cpu(sbi, lf->lf_size);
if (lf_size > QNX6_LONG_NAME_MAX) {
pr_debug("file %s\n", lf->lf_fname);
pr_err("Filename too long (%i)\n", lf_size);