up(&hpfs_sb(s)->hpfs_creation_de);
}
-void hpfs_lock_iget(struct super_block *s, int mode)
-{
-#ifdef DEBUG_LOCKS
- printk("lock iget\n");
-#endif
- while (hpfs_sb(s)->sb_rd_inode) sleep_on(&hpfs_sb(s)->sb_iget_q);
- hpfs_sb(s)->sb_rd_inode = mode;
-}
-
-void hpfs_unlock_iget(struct super_block *s)
-{
-#ifdef DEBUG_LOCKS
- printk("unlock iget\n");
-#endif
- hpfs_sb(s)->sb_rd_inode = 0;
- wake_up(&hpfs_sb(s)->sb_iget_q);
-}
-
void hpfs_lock_inode(struct inode *i)
{
if (i) {
* Go find or make an inode.
*/
- hpfs_lock_iget(dir->i_sb, de->directory || (de->ea_size && hpfs_sb(dir->i_sb)->sb_eas) ? 1 : 2);
result = iget_locked(dir->i_sb, ino);
if (!result) {
- hpfs_unlock_iget(dir->i_sb);
hpfs_error(dir->i_sb, "hpfs_lookup: can't get inode");
goto bail1;
}
if (result->i_state & I_NEW) {
- hpfs_read_inode(result);
+ hpfs_init_inode(result);
+ if (de->directory)
+ hpfs_read_inode(result);
+ else if (de->ea_size && hpfs_sb(dir->i_sb)->sb_eas)
+ hpfs_read_inode(result);
+ else {
+ result->i_mode |= S_IFREG;
+ result->i_mode &= ~0111;
+ result->i_op = &hpfs_file_iops;
+ result->i_fop = &hpfs_file_ops;
+ result->i_nlink = 1;
+ }
unlock_new_inode(result);
}
hpfs_result = hpfs_i(result);
if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino;
- hpfs_unlock_iget(dir->i_sb);
hpfs_decide_conv(result, (char *)name, len);
void hpfs_lock_creation(struct super_block *);
void hpfs_unlock_creation(struct super_block *);
-void hpfs_lock_iget(struct super_block *, int);
-void hpfs_unlock_iget(struct super_block *);
void hpfs_lock_inode(struct inode *);
void hpfs_unlock_inode(struct inode *);
void *hpfs_map_sector(struct super_block *, unsigned, struct buffer_head **, int);
unsigned char *ea;
int ea_size;
- hpfs_init_inode(i);
-
- if (!hpfs_sb(i->i_sb)->sb_rd_inode)
- hpfs_error(i->i_sb, "read_inode: sb_rd_inode == 0");
- if (hpfs_sb(i->i_sb)->sb_rd_inode == 2) {
- i->i_mode |= S_IFREG;
- i->i_mode &= ~0111;
- i->i_op = &hpfs_file_iops;
- i->i_fop = &hpfs_file_ops;
- i->i_nlink = 1;
- return;
- }
if (!(fnode = hpfs_map_fnode(sb, i->i_ino, &bh))) {
/*i->i_mode |= S_IFREG;
i->i_mode &= ~0111;
kfree(hpfs_inode->i_rddir_off);
hpfs_inode->i_rddir_off = NULL;
}
- hpfs_lock_iget(i->i_sb, 1);
parent = iget_locked(i->i_sb, hpfs_inode->i_parent_dir);
if (parent) {
hpfs_inode->i_dirty = 0;
if (parent->i_state & I_NEW) {
+ hpfs_init_inode(parent);
hpfs_read_inode(parent);
unlock_new_inode(parent);
}
- hpfs_unlock_iget(i->i_sb);
hpfs_lock_inode(parent);
hpfs_write_inode_nolock(i);
hpfs_unlock_inode(parent);
iput(parent);
} else {
- hpfs_unlock_iget(i->i_sb);
mark_inode_dirty(i);
}
}
{
.alloc_inode = hpfs_alloc_inode,
.destroy_inode = hpfs_destroy_inode,
- .read_inode = hpfs_read_inode,
.delete_inode = hpfs_delete_inode,
.put_super = hpfs_put_super,
.statfs = hpfs_statfs,
sbi->sb_bmp_dir = NULL;
sbi->sb_cp_table = NULL;
- sbi->sb_rd_inode = 0;
init_MUTEX(&sbi->hpfs_creation_de);
- init_waitqueue_head(&sbi->sb_iget_q);
uid = current->uid;
gid = current->gid;
brelse(bh1);
brelse(bh0);
- hpfs_lock_iget(s, 1);
root = iget_locked(s, sbi->sb_root);
- if (!root) {
- hpfs_unlock_iget(s);
+ if (!root)
goto bail0;
- }
+ hpfs_init_inode(root);
hpfs_read_inode(root);
unlock_new_inode(root);
- hpfs_unlock_iget(s);
s->s_root = d_alloc_root(root);
if (!s->s_root) {
iput(root);
unsigned sb_lowercase : 1; /* downcase filenames hackery */
unsigned sb_was_error : 1; /* there was an error, set dirty flag */
unsigned sb_chkdsk : 2; /* chkdsk: 0-no, 1-on errs, 2-allways */
- unsigned sb_rd_fnode : 2; /* read fnode 0-no 1-dirs 2-all */
- unsigned sb_rd_inode : 2; /* lookup tells read_inode: 1-read fnode
- 2-don't read fnode, file
- 3-don't read fnode, direcotry */
- wait_queue_head_t sb_iget_q;
unsigned char *sb_cp_table; /* code page tables: */
/* 128 bytes uppercasing table & */
/* 128 bytes lowercasing table */