diff options
Diffstat (limited to 'fs/hfs')
-rw-r--r-- | fs/hfs/dir.c | 2 | ||||
-rw-r--r-- | fs/hfs/super.c | 44 |
2 files changed, 15 insertions, 31 deletions
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 40f8d2e5f..debe0a967 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -311,7 +311,7 @@ int hfs_rmdir(struct inode * parent, struct dentry *dentry) goto hfs_rmdir_put; error = -EBUSY; - if (!list_empty(&dentry->d_hash)) + if (!d_unhashed(dentry)) goto hfs_rmdir_put; if (/* we only have to worry about 2 and 3 for mount points */ diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 3ed8307a0..251690dc8 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -36,7 +36,7 @@ static void hfs_read_inode(struct inode *); static void hfs_put_super(struct super_block *); -static int hfs_statfs(struct super_block *, struct statfs *, int); +static int hfs_statfs(struct super_block *, struct statfs *); static void hfs_write_super(struct super_block *); /*================ Global variables ================*/ @@ -51,11 +51,7 @@ static struct super_operations hfs_super_operations = { /*================ File-local variables ================*/ -static struct file_system_type hfs_fs = { - "hfs", - FS_REQUIRES_DEV, - hfs_read_super, - NULL}; +static DECLARE_FSTYPE_DEV(hfs_fs, "hfs", hfs_read_super); /*================ File-local functions ================*/ @@ -126,8 +122,6 @@ static void hfs_put_super(struct super_block *sb) /* restore default blocksize for the device */ set_blocksize(sb->s_dev, BLOCK_SIZE); - - MOD_DEC_USE_COUNT; } /* @@ -139,21 +133,20 @@ static void hfs_put_super(struct super_block *sb) * * changed f_files/f_ffree to reflect the fs_ablock/free_ablocks. */ -static int hfs_statfs(struct super_block *sb, struct statfs *buf, int len) +static int hfs_statfs(struct super_block *sb, struct statfs *buf) { struct hfs_mdb *mdb = HFS_SB(sb)->s_mdb; - struct statfs tmp; - - tmp.f_type = HFS_SUPER_MAGIC; - tmp.f_bsize = HFS_SECTOR_SIZE; - tmp.f_blocks = mdb->alloc_blksz * mdb->fs_ablocks; - tmp.f_bfree = mdb->alloc_blksz * mdb->free_ablocks; - tmp.f_bavail = tmp.f_bfree; - tmp.f_files = mdb->fs_ablocks; - tmp.f_ffree = mdb->free_ablocks; - tmp.f_namelen = HFS_NAMELEN; - - return copy_to_user(buf, &tmp, len) ? -EFAULT : 0; + + buf->f_type = HFS_SUPER_MAGIC; + buf->f_bsize = HFS_SECTOR_SIZE; + buf->f_blocks = mdb->alloc_blksz * mdb->fs_ablocks; + buf->f_bfree = mdb->alloc_blksz * mdb->free_ablocks; + buf->f_bavail = buf->f_bfree; + buf->f_files = mdb->fs_ablocks; + buf->f_ffree = mdb->free_ablocks; + buf->f_namelen = HFS_NAMELEN; + + return 0; } /* @@ -407,11 +400,6 @@ struct super_block *hfs_read_super(struct super_block *s, void *data, goto bail3; } - /* in case someone tries to unload the module while we wait on I/O */ - MOD_INC_USE_COUNT; - - lock_super(s); - /* set the device driver to 512-byte blocks */ set_blocksize(dev, HFS_SECTOR_SIZE); @@ -471,7 +459,6 @@ struct super_block *hfs_read_super(struct super_block *s, void *data, s->s_root->d_op = &hfs_dentry_operations; /* everything's okay */ - unlock_super(s); return s; bail_no_root: @@ -481,10 +468,7 @@ bail1: hfs_mdb_put(mdb, s->s_flags & MS_RDONLY); bail2: set_blocksize(dev, BLOCK_SIZE); - unlock_super(s); - MOD_DEC_USE_COUNT; bail3: - s->s_dev = 0; return NULL; } |