--- linux/fs/inode.c 2018/04/24 18:04:59 1.1.1.6 +++ linux/fs/inode.c 2018/04/24 18:05:57 1.1.1.7 @@ -8,16 +8,12 @@ #include #include -#include #include #include #include struct inode inode_table[NR_INODE]={{0,},}; -extern void minix_read_inode(struct inode * inode); -extern void minix_write_inode(struct inode * inode); - static inline void wait_on_inode(struct inode * inode) { cli(); @@ -48,20 +44,34 @@ static void write_inode(struct inode * i unlock_inode(inode); return; } - minix_write_inode(inode); + if (inode->i_op && inode->i_op->write_inode) + inode->i_op->write_inode(inode); unlock_inode(inode); } static void read_inode(struct inode * inode) { lock_inode(inode); - minix_read_inode(inode); + if (inode->i_sb && inode->i_sb->s_op && inode->i_sb->s_op->read_inode) + inode->i_sb->s_op->read_inode(inode); unlock_inode(inode); } +/* + * bmap is needed for demand-loading and paging: if this function + * doesn't exist for a filesystem, then those things are impossible: + * executables cannot be run from the filesystem etc... + * + * This isn't as bad as it sounds: the read-routines might still work, + * so the filesystem would be otherwise ok (for example, you might have + * a DOS filesystem, which doesn't lend itself to bmap very well, but + * you could still transfer files to/from the filesystem) + */ int bmap(struct inode * inode, int block) { - return minix_bmap(inode,block); + if (inode->i_op && inode->i_op->bmap) + return inode->i_op->bmap(inode,block); + return 0; } void invalidate_inodes(int dev) @@ -127,8 +137,8 @@ repeat: return; } if (!inode->i_nlink) { - minix_truncate(inode); - minix_free_inode(inode); + if (inode->i_op && inode->i_op->put_inode) + inode->i_op->put_inode(inode); return; } if (inode->i_dirt) {