diff options
author | Al Smith <Al.Smith@aeschi.ch.eu.org> | 1999-04-13 15:52:53 +0000 |
---|---|---|
committer | Al Smith <Al.Smith@aeschi.ch.eu.org> | 1999-04-13 15:52:53 +0000 |
commit | e9d2c29f0ad03e31b6264deb9605f25989791630 (patch) | |
tree | 312567059fbf6cd8fba968c9cda8ff617e219973 /fs/efs/inode.c | |
parent | d6509c7221656060ff995b645dfc1eac582c7f31 (diff) |
bug fixes: block/char devices fixed (NB: IRIX uses 32-bit wide dev_t,
linux only has 16-bit wide dev_t. this is apparently going to
change in linux-2.3 but for now we can't handle devices with
major or minor numbers > 255.
handling of empty directory slots has been fixed.
Diffstat (limited to 'fs/efs/inode.c')
-rw-r--r-- | fs/efs/inode.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/fs/efs/inode.c b/fs/efs/inode.c index 33e3863f3..893af40ec 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c @@ -68,7 +68,6 @@ void efs_read_inode(struct inode *inode) { efs_inode = (struct efs_dinode *) (bh->b_data + offset); - /* fill in standard inode infos */ inode->i_mode = be16_to_cpu(efs_inode->di_mode); inode->i_nlink = be16_to_cpu(efs_inode->di_nlink); inode->i_uid = be16_to_cpu(efs_inode->di_uid); @@ -85,10 +84,20 @@ void efs_read_inode(struct inode *inode) { inode->i_blocks = ((inode->i_size - 1) >> EFS_BLOCKSIZE_BITS) + 1; } - device = be32_to_cpu(efs_inode->di_u.di_dev); - - /* The following values are stored in my private part of the Inode. - They are necessary for further operations with the file */ + /* + * BUG: irix devices are 32-bits. linux devices are only 16-bits. + * + * apparently linux will change to 32-bit devices sometime during + * linux 2.3. + * + * as is, this code maps devices that can't be represented in + * 16-bits (ie major > 255 or minor > 255) to major = minor = 255. + * + * during 2.3 when 32-bit devices become available, we should test + * to see whether odev contains 65535. if this is the case then we + * should do device = be32_to_cpu(efs_inode->di_u.di_dev.ndec). + */ + device = be16_to_cpu(efs_inode->di_u.di_dev.odev); /* get the number of extents for this object */ in->numextents = be16_to_cpu(efs_inode->di_numextents); @@ -111,7 +120,6 @@ void efs_read_inode(struct inode *inode) { inode->i_ino, in->numextents); #endif - /* Install the filetype Handler */ switch (inode->i_mode & S_IFMT) { case S_IFDIR: inode->i_op = &efs_dir_inode_operations; @@ -164,9 +172,9 @@ efs_extent_check(efs_extent *ptr, efs_block_t block, struct efs_sb_info *sb) { efs_block_t offset; /* - ** given an extent and a logical block within a file, - ** can this block be found within this extent ? - */ + * given an extent and a logical block within a file, + * can this block be found within this extent ? + */ start = ptr->cooked.ex_bn; length = ptr->cooked.ex_length; offset = ptr->cooked.ex_offset; @@ -178,8 +186,6 @@ efs_extent_check(efs_extent *ptr, efs_block_t block, struct efs_sb_info *sb) { } } -/* find the disk block number for a given logical file block number */ - efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { struct efs_sb_info *sb = SUPER_INFO(inode->i_sb); struct efs_inode_info *in = INODE_INFO(inode); @@ -205,8 +211,10 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) { direxts = in->numextents; - /* check the stored extents in the inode */ - /* start with next extent and check forwards */ + /* + * check the stored extents in the inode + * start with next extent and check forwards + */ for(dirext = 1; dirext < direxts; dirext++) { cur = (last + dirext) % in->numextents; if ((result = efs_extent_check(&in->extents[cur], block, sb))) { |