diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
commit | 1471f525455788c20b130690e0f104df451aeb43 (patch) | |
tree | 3778beba56558beb9a9548ea5b467e9c44ea966f /fs/minix | |
parent | e80d2c5456d30ebba5b0eb8a9d33e17d815d4d83 (diff) |
Merge with Linux 2.3.51.
Diffstat (limited to 'fs/minix')
-rw-r--r-- | fs/minix/inode.c | 43 | ||||
-rw-r--r-- | fs/minix/namei.c | 5 |
2 files changed, 17 insertions, 31 deletions
diff --git a/fs/minix/inode.c b/fs/minix/inode.c index 1d9ebb062..31d4c99c7 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -23,14 +23,13 @@ #include <linux/highuid.h> #include <asm/system.h> -#include <asm/uaccess.h> #include <asm/bitops.h> #include <linux/minix_fs.h> static void minix_read_inode(struct inode * inode); static void minix_write_inode(struct inode * inode); -static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz); +static int minix_statfs(struct super_block *sb, struct statfs *buf); static int minix_remount (struct super_block * sb, int * flags, char * data); static void minix_delete_inode(struct inode *inode) @@ -80,7 +79,6 @@ static void minix_put_super(struct super_block *sb) brelse (sb->u.minix_sb.s_sbh); kfree(sb->u.minix_sb.s_imap); - MOD_DEC_USE_COUNT; return; } @@ -189,13 +187,10 @@ static struct super_block *minix_read_super(struct super_block *s, void *data, if (64 != sizeof(struct minix2_inode)) panic("bad V2 i-node size"); - MOD_INC_USE_COUNT; - hblock = get_hardblocksize(dev); if (hblock && hblock > BLOCK_SIZE) goto out_bad_hblock; - lock_super(s); set_blocksize(dev, BLOCK_SIZE); if (!(bh = bread(dev,1,BLOCK_SIZE))) goto out_bad_sb; @@ -287,7 +282,6 @@ static struct super_block *minix_read_super(struct super_block *s, void *data, mark_buffer_dirty(bh, 1); s->s_dirt = 1; } - unlock_super(s); if (!(s->u.minix_sb.s_mount_state & MINIX_VALID_FS)) printk ("MINIX-fs: mounting unchecked file system, " "running fsck is recommended.\n"); @@ -329,7 +323,7 @@ out_no_fs: "%s.\n", kdevname(dev)); out_release: brelse(bh); - goto out_unlock; + goto out; out_bad_hblock: printk("MINIX-fs: blocksize too small for device.\n"); @@ -337,27 +331,21 @@ out_bad_hblock: out_bad_sb: printk("MINIX-fs: unable to read superblock\n"); - out_unlock: - unlock_super(s); out: - s->s_dev = 0; - MOD_DEC_USE_COUNT; return NULL; } -static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz) +static int minix_statfs(struct super_block *sb, struct statfs *buf) { - struct statfs tmp; - - tmp.f_type = sb->s_magic; - tmp.f_bsize = sb->s_blocksize; - tmp.f_blocks = (sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone) << sb->u.minix_sb.s_log_zone_size; - tmp.f_bfree = minix_count_free_blocks(sb); - tmp.f_bavail = tmp.f_bfree; - tmp.f_files = sb->u.minix_sb.s_ninodes; - tmp.f_ffree = minix_count_free_inodes(sb); - tmp.f_namelen = sb->u.minix_sb.s_namelen; - return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0; + buf->f_type = sb->s_magic; + buf->f_bsize = sb->s_blocksize; + buf->f_blocks = (sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone) << sb->u.minix_sb.s_log_zone_size; + buf->f_bfree = minix_count_free_blocks(sb); + buf->f_bavail = buf->f_bfree; + buf->f_files = sb->u.minix_sb.s_ninodes; + buf->f_ffree = minix_count_free_inodes(sb); + buf->f_namelen = sb->u.minix_sb.s_namelen; + return 0; } /* @@ -1277,12 +1265,7 @@ int minix_sync_inode(struct inode * inode) return err; } -static struct file_system_type minix_fs_type = { - "minix", - FS_REQUIRES_DEV, - minix_read_super, - NULL -}; +static DECLARE_FSTYPE_DEV(minix_fs_type,"minix",minix_read_super); int __init init_minix_fs(void) { diff --git a/fs/minix/namei.c b/fs/minix/namei.c index c18b46a37..211556d4a 100644 --- a/fs/minix/namei.c +++ b/fs/minix/namei.c @@ -399,7 +399,7 @@ static int minix_rmdir(struct inode * dir, struct dentry *dentry) retval = -ENOENT; goto end_rmdir; } - if (!list_empty(&dentry->d_hash)) { + if (!d_unhashed(dentry)) { retval = -EBUSY; goto end_rmdir; } @@ -569,6 +569,9 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry, } if (S_ISDIR(old_inode->i_mode)) { if (new_inode) { + retval = -EBUSY; + if (!d_unhashed(new_dentry)) + goto end_rename; retval = -ENOTEMPTY; if (!empty_dir(new_inode)) goto end_rename; |