9 #include <linux/slab.h>
12 static int hpfs_dir_release(
struct inode *
inode,
struct file *filp)
14 hpfs_lock(inode->
i_sb);
17 hpfs_unlock(inode->
i_sb);
23 static loff_t hpfs_dir_lseek(
struct file *filp, loff_t off,
int whence)
25 loff_t new_off = off + (whence == 1 ? filp->
f_pos : 0);
39 if (new_off == 0 || new_off == 1 || new_off == 11 || new_off == 12 || new_off == 13)
goto ok;
42 while (pos != new_off) {
45 if (pos == 12)
goto fail;
50 return filp->
f_pos = new_off;
66 unsigned char *tempname;
70 hpfs_lock(inode->
i_sb);
72 if (hpfs_sb(inode->
i_sb)->sb_chk) {
82 if (hpfs_sb(inode->
i_sb)->sb_chk >= 2) {
83 struct buffer_head *bh;
90 if (!fnode_is_dir(fno)) {
93 (
unsigned long)inode->
i_ino);
105 lc = hpfs_sb(inode->
i_sb)->sb_lowercase;
106 if (filp->
f_pos == 12) {
110 if (filp->
f_pos == 13) {
120 if (hpfs_sb(inode->
i_sb)->sb_chk)
125 if (filp->
f_pos == 12)
128 printk(
"HPFS: warning: pos==%d\n",(
int)filp->
f_pos);
131 if (filp->
f_pos == 0) {
136 if (filp->
f_pos == 11) {
141 if (filp->
f_pos == 1) {
146 old_pos = filp->
f_pos;
152 if (hpfs_sb(inode->
i_sb)->sb_chk) {
154 || de ->
name[0] != 1 || de->
name[1] != 1))
155 hpfs_error(inode->
i_sb,
"hpfs_readdir: bad ^A^A entry; pos = %08lx", old_pos);
157 hpfs_error(inode->
i_sb,
"hpfs_readdir: bad \\377 entry; pos = %08lx", old_pos);
164 filp->
f_pos = old_pos;
165 if (tempname != de->
name)
kfree(tempname);
169 if (tempname != de->
name)
kfree(tempname);
173 hpfs_unlock(inode->
i_sb);
194 const unsigned char *
name = dentry->
d_name.name;
203 hpfs_lock(dir->
i_sb);
206 hpfs_unlock(dir->
i_sb);
254 hpfs_result = hpfs_i(result);
258 hpfs_error(result->
i_sb,
"ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures");
279 if (result->
i_size == -1) {
282 hpfs_i(result)->mmu_private = result->
i_size;
302 hpfs_unlock(dir->
i_sb);
303 d_add(dentry, result);
315 hpfs_unlock(dir->
i_sb);
321 .llseek = hpfs_dir_lseek,
323 .readdir = hpfs_readdir,
324 .release = hpfs_dir_release,