diff options
Diffstat (limited to 'fs/exofs')
-rw-r--r-- | fs/exofs/dir.c | 4 | ||||
-rw-r--r-- | fs/exofs/namei.c | 13 | ||||
-rw-r--r-- | fs/exofs/super.c | 4 |
3 files changed, 5 insertions, 16 deletions
diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c index 80405836ba6e..c61e62ac231c 100644 --- a/fs/exofs/dir.c +++ b/fs/exofs/dir.c | |||
@@ -597,7 +597,7 @@ int exofs_make_empty(struct inode *inode, struct inode *parent) | |||
597 | goto fail; | 597 | goto fail; |
598 | } | 598 | } |
599 | 599 | ||
600 | kaddr = kmap_atomic(page, KM_USER0); | 600 | kaddr = kmap_atomic(page); |
601 | de = (struct exofs_dir_entry *)kaddr; | 601 | de = (struct exofs_dir_entry *)kaddr; |
602 | de->name_len = 1; | 602 | de->name_len = 1; |
603 | de->rec_len = cpu_to_le16(EXOFS_DIR_REC_LEN(1)); | 603 | de->rec_len = cpu_to_le16(EXOFS_DIR_REC_LEN(1)); |
@@ -611,7 +611,7 @@ int exofs_make_empty(struct inode *inode, struct inode *parent) | |||
611 | de->inode_no = cpu_to_le64(parent->i_ino); | 611 | de->inode_no = cpu_to_le64(parent->i_ino); |
612 | memcpy(de->name, PARENT_DIR, sizeof(PARENT_DIR)); | 612 | memcpy(de->name, PARENT_DIR, sizeof(PARENT_DIR)); |
613 | exofs_set_de_type(de, inode); | 613 | exofs_set_de_type(de, inode); |
614 | kunmap_atomic(kaddr, KM_USER0); | 614 | kunmap_atomic(kaddr); |
615 | err = exofs_commit_chunk(page, 0, chunk_size); | 615 | err = exofs_commit_chunk(page, 0, chunk_size); |
616 | fail: | 616 | fail: |
617 | page_cache_release(page); | 617 | page_cache_release(page); |
diff --git a/fs/exofs/namei.c b/fs/exofs/namei.c index 9dbf0c301030..fc7161d6bf6b 100644 --- a/fs/exofs/namei.c +++ b/fs/exofs/namei.c | |||
@@ -143,9 +143,6 @@ static int exofs_link(struct dentry *old_dentry, struct inode *dir, | |||
143 | { | 143 | { |
144 | struct inode *inode = old_dentry->d_inode; | 144 | struct inode *inode = old_dentry->d_inode; |
145 | 145 | ||
146 | if (inode->i_nlink >= EXOFS_LINK_MAX) | ||
147 | return -EMLINK; | ||
148 | |||
149 | inode->i_ctime = CURRENT_TIME; | 146 | inode->i_ctime = CURRENT_TIME; |
150 | inode_inc_link_count(inode); | 147 | inode_inc_link_count(inode); |
151 | ihold(inode); | 148 | ihold(inode); |
@@ -156,10 +153,7 @@ static int exofs_link(struct dentry *old_dentry, struct inode *dir, | |||
156 | static int exofs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | 153 | static int exofs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) |
157 | { | 154 | { |
158 | struct inode *inode; | 155 | struct inode *inode; |
159 | int err = -EMLINK; | 156 | int err; |
160 | |||
161 | if (dir->i_nlink >= EXOFS_LINK_MAX) | ||
162 | goto out; | ||
163 | 157 | ||
164 | inode_inc_link_count(dir); | 158 | inode_inc_link_count(dir); |
165 | 159 | ||
@@ -275,11 +269,6 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
275 | if (err) | 269 | if (err) |
276 | goto out_dir; | 270 | goto out_dir; |
277 | } else { | 271 | } else { |
278 | if (dir_de) { | ||
279 | err = -EMLINK; | ||
280 | if (new_dir->i_nlink >= EXOFS_LINK_MAX) | ||
281 | goto out_dir; | ||
282 | } | ||
283 | err = exofs_add_link(new_dentry, old_inode); | 272 | err = exofs_add_link(new_dentry, old_inode); |
284 | if (err) | 273 | if (err) |
285 | goto out_dir; | 274 | goto out_dir; |
diff --git a/fs/exofs/super.c b/fs/exofs/super.c index 6c5397ad7a2a..735ca06430ac 100644 --- a/fs/exofs/super.c +++ b/fs/exofs/super.c | |||
@@ -755,6 +755,7 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent) | |||
755 | sb->s_blocksize = EXOFS_BLKSIZE; | 755 | sb->s_blocksize = EXOFS_BLKSIZE; |
756 | sb->s_blocksize_bits = EXOFS_BLKSHIFT; | 756 | sb->s_blocksize_bits = EXOFS_BLKSHIFT; |
757 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 757 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
758 | sb->s_max_links = EXOFS_LINK_MAX; | ||
758 | atomic_set(&sbi->s_curr_pending, 0); | 759 | atomic_set(&sbi->s_curr_pending, 0); |
759 | sb->s_bdev = NULL; | 760 | sb->s_bdev = NULL; |
760 | sb->s_dev = 0; | 761 | sb->s_dev = 0; |
@@ -819,9 +820,8 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent) | |||
819 | ret = PTR_ERR(root); | 820 | ret = PTR_ERR(root); |
820 | goto free_sbi; | 821 | goto free_sbi; |
821 | } | 822 | } |
822 | sb->s_root = d_alloc_root(root); | 823 | sb->s_root = d_make_root(root); |
823 | if (!sb->s_root) { | 824 | if (!sb->s_root) { |
824 | iput(root); | ||
825 | EXOFS_ERR("ERROR: get root inode failed\n"); | 825 | EXOFS_ERR("ERROR: get root inode failed\n"); |
826 | ret = -ENOMEM; | 826 | ret = -ENOMEM; |
827 | goto free_sbi; | 827 | goto free_sbi; |