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/udf | |
parent | e80d2c5456d30ebba5b0eb8a9d33e17d815d4d83 (diff) |
Merge with Linux 2.3.51.
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/namei.c | 3 | ||||
-rw-r--r-- | fs/udf/super.c | 57 |
2 files changed, 21 insertions, 39 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index db140e66e..c371b5d52 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -1165,6 +1165,9 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, if (new_inode) { + retval = -EBUSY; + if (!d_unhashed(new_dentry)) + goto end_rename; retval = -ENOTEMPTY; if (!empty_dir(new_inode)) goto end_rename; diff --git a/fs/udf/super.c b/fs/udf/super.c index 6b3e32f03..761cdcb6c 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -93,25 +93,21 @@ static void udf_load_partdesc(struct super_block *, struct buffer_head *); static void udf_open_lvid(struct super_block *); static void udf_close_lvid(struct super_block *); static unsigned int udf_count_free(struct super_block *); -static int udf_statfs(struct super_block *, struct statfs *, int); +static int udf_statfs(struct super_block *, struct statfs *); /* UDF filesystem type */ -static struct file_system_type udf_fstype = { - name: "udf", - fs_flags: FS_REQUIRES_DEV, - read_super: udf_read_super, -}; +static DECLARE_FSTYPE_DEV(udf_fstype, "udf", udf_read_super); /* Superblock operations */ static struct super_operations udf_sb_ops = { - read_inode: udf_read_inode, + read_inode: udf_read_inode, write_inode: udf_write_inode, - put_inode: udf_put_inode, + put_inode: udf_put_inode, delete_inode: udf_delete_inode, - put_super: udf_put_super, + put_super: udf_put_super, write_super: udf_write_super, - statfs: udf_statfs, - remount_fs: udf_remount_fs, + statfs: udf_statfs, + remount_fs: udf_remount_fs, }; struct udf_options @@ -1326,10 +1322,6 @@ udf_read_super(struct super_block *sb, void *options, int silent) uopt.gid = -1; uopt.umask = 0; - /* Lock the module in memory (if applicable) */ - MOD_INC_USE_COUNT; - - lock_super(sb); memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info)); #if CONFIG_UDF_RW != 1 @@ -1438,7 +1430,6 @@ udf_read_super(struct super_block *sb, void *options, int silent) } if (!(sb->s_flags & MS_RDONLY)) udf_open_lvid(sb); - unlock_super(sb); /* Assign the root inode */ /* assign inodes by physical block number */ @@ -1470,8 +1461,6 @@ error_out: udf_close_lvid(sb); udf_release_data(UDF_SB_LVIDBH(sb)); UDF_SB_FREE(sb); - unlock_super(sb); - MOD_DEC_USE_COUNT; return NULL; } @@ -1530,8 +1519,6 @@ udf_put_super(struct super_block *sb) for (i=0; i<UDF_MAX_BLOCK_LOADED; i++) udf_release_data(UDF_SB_BLOCK_BITMAP(sb, i)); UDF_SB_FREE(sb); - - MOD_DEC_USE_COUNT; } /* @@ -1548,29 +1535,21 @@ udf_put_super(struct super_block *sb) * Written, tested, and released. */ static int -udf_statfs(struct super_block *sb, struct statfs *buf, int bufsize) +udf_statfs(struct super_block *sb, struct statfs *buf) { - int size; - struct statfs tmp; - int rc; - - size = (bufsize < sizeof(tmp)) ? bufsize: sizeof(tmp); - - memset(&tmp, 0, sizeof(tmp)); - tmp.f_type = UDF_SUPER_MAGIC; - tmp.f_bsize = sb->s_blocksize; - tmp.f_blocks = UDF_SB_PARTLEN(sb, UDF_SB_PARTITION(sb)); - tmp.f_bfree = udf_count_free(sb); - tmp.f_bavail = tmp.f_bfree; - tmp.f_files = (UDF_SB_LVIDBH(sb) ? + buf->f_type = UDF_SUPER_MAGIC; + buf->f_bsize = sb->s_blocksize; + buf->f_blocks = UDF_SB_PARTLEN(sb, UDF_SB_PARTITION(sb)); + buf->f_bfree = udf_count_free(sb); + buf->f_bavail = buf->f_bfree; + buf->f_files = (UDF_SB_LVIDBH(sb) ? (le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) + - le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs)) : 0) + tmp.f_bfree; - tmp.f_ffree = tmp.f_bfree; + le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs)) : 0) + buf->f_bfree; + buf->f_ffree = buf->f_bfree; /* __kernel_fsid_t f_fsid */ - tmp.f_namelen = UDF_NAME_LEN; + buf->f_namelen = UDF_NAME_LEN; - rc= copy_to_user(buf, &tmp, size) ? -EFAULT: 0; - return rc; + return 0; } static unsigned char udf_bitmap_lookup[16] = { |