Skip to content

Commit

Permalink
Merge branch 'for-linus' into for-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Viro committed Jun 17, 2015
2 parents b853a16 + e4f9551 commit 4ef51e8
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 79 deletions.
8 changes: 4 additions & 4 deletions fs/dcache.c
Expand Up @@ -1239,13 +1239,13 @@ static void d_walk(struct dentry *parent, void *data,
/* might go back up the wrong parent if we have had a rename. */
if (need_seqretry(&rename_lock, seq))
goto rename_retry;
next = child->d_child.next;
while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) {
/* go into the first sibling still alive */
do {
next = child->d_child.next;
if (next == &this_parent->d_subdirs)
goto ascend;
child = list_entry(next, struct dentry, d_child);
next = next->next;
}
} while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED));
rcu_read_unlock();
goto resume;
}
Expand Down
2 changes: 2 additions & 0 deletions fs/ncpfs/dir.c
Expand Up @@ -1145,6 +1145,8 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
case 0x00:
ncp_dbg(1, "renamed %pd -> %pd\n",
old_dentry, new_dentry);
ncp_d_prune(old_dentry);
ncp_d_prune(new_dentry);
break;
case 0x9E:
error = -ENAMETOOLONG;
Expand Down
34 changes: 17 additions & 17 deletions fs/ufs/balloc.c
Expand Up @@ -51,8 +51,8 @@ void ufs_free_fragments(struct inode *inode, u64 fragment, unsigned count)

if (ufs_fragnum(fragment) + count > uspi->s_fpg)
ufs_error (sb, "ufs_free_fragments", "internal error");
lock_ufs(sb);

mutex_lock(&UFS_SB(sb)->s_lock);

cgno = ufs_dtog(uspi, fragment);
bit = ufs_dtogd(uspi, fragment);
Expand Down Expand Up @@ -115,13 +115,13 @@ void ufs_free_fragments(struct inode *inode, u64 fragment, unsigned count)
if (sb->s_flags & MS_SYNCHRONOUS)
ubh_sync_block(UCPI_UBH(ucpi));
ufs_mark_sb_dirty(sb);
unlock_ufs(sb);

mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT\n");
return;

failed:
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT (FAILED)\n");
return;
}
Expand Down Expand Up @@ -151,7 +151,7 @@ void ufs_free_blocks(struct inode *inode, u64 fragment, unsigned count)
goto failed;
}

lock_ufs(sb);
mutex_lock(&UFS_SB(sb)->s_lock);

do_more:
overflow = 0;
Expand Down Expand Up @@ -211,12 +211,12 @@ void ufs_free_blocks(struct inode *inode, u64 fragment, unsigned count)
}

ufs_mark_sb_dirty(sb);
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT\n");
return;

failed_unlock:
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
failed:
UFSD("EXIT (FAILED)\n");
return;
Expand Down Expand Up @@ -357,7 +357,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
usb1 = ubh_get_usb_first(uspi);
*err = -ENOSPC;

lock_ufs(sb);
mutex_lock(&UFS_SB(sb)->s_lock);
tmp = ufs_data_ptr_to_cpu(sb, p);

if (count + ufs_fragnum(fragment) > uspi->s_fpb) {
Expand All @@ -378,19 +378,19 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
"fragment %llu, tmp %llu\n",
(unsigned long long)fragment,
(unsigned long long)tmp);
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
return INVBLOCK;
}
if (fragment < UFS_I(inode)->i_lastfrag) {
UFSD("EXIT (ALREADY ALLOCATED)\n");
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
return 0;
}
}
else {
if (tmp) {
UFSD("EXIT (ALREADY ALLOCATED)\n");
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
return 0;
}
}
Expand All @@ -399,7 +399,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
* There is not enough space for user on the device
*/
if (!capable(CAP_SYS_RESOURCE) && ufs_freespace(uspi, UFS_MINFREE) <= 0) {
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT (FAILED)\n");
return 0;
}
Expand All @@ -424,7 +424,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
ufs_clear_frags(inode, result + oldcount,
newcount - oldcount, locked_page != NULL);
}
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT, result %llu\n", (unsigned long long)result);
return result;
}
Expand All @@ -439,7 +439,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
fragment + count);
ufs_clear_frags(inode, result + oldcount, newcount - oldcount,
locked_page != NULL);
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT, result %llu\n", (unsigned long long)result);
return result;
}
Expand Down Expand Up @@ -477,15 +477,15 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
*err = 0;
UFS_I(inode)->i_lastfrag = max(UFS_I(inode)->i_lastfrag,
fragment + count);
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
if (newcount < request)
ufs_free_fragments (inode, result + newcount, request - newcount);
ufs_free_fragments (inode, tmp, oldcount);
UFSD("EXIT, result %llu\n", (unsigned long long)result);
return result;
}

unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT (FAILED)\n");
return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions fs/ufs/dir.c
Expand Up @@ -87,7 +87,8 @@ ino_t ufs_inode_by_name(struct inode *dir, const struct qstr *qstr)

/* Releases the page */
void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
struct page *page, struct inode *inode)
struct page *page, struct inode *inode,
bool update_times)
{
loff_t pos = page_offset(page) +
(char *) de - (char *) page_address(page);
Expand All @@ -103,7 +104,8 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,

err = ufs_commit_chunk(page, pos, len);
ufs_put_page(page);
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
if (update_times)
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
mark_inode_dirty(dir);
}

Expand Down
16 changes: 8 additions & 8 deletions fs/ufs/ialloc.c
Expand Up @@ -69,19 +69,19 @@ void ufs_free_inode (struct inode * inode)

ino = inode->i_ino;

lock_ufs(sb);
mutex_lock(&UFS_SB(sb)->s_lock);

if (!((ino > 1) && (ino < (uspi->s_ncg * uspi->s_ipg )))) {
ufs_warning(sb, "ufs_free_inode", "reserved inode or nonexistent inode %u\n", ino);
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
return;
}

cg = ufs_inotocg (ino);
bit = ufs_inotocgoff (ino);
ucpi = ufs_load_cylinder (sb, cg);
if (!ucpi) {
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
return;
}
ucg = ubh_get_ucg(UCPI_UBH(ucpi));
Expand Down Expand Up @@ -115,7 +115,7 @@ void ufs_free_inode (struct inode * inode)
ubh_sync_block(UCPI_UBH(ucpi));

ufs_mark_sb_dirty(sb);
unlock_ufs(sb);
mutex_unlock(&UFS_SB(sb)->s_lock);
UFSD("EXIT\n");
}

Expand Down Expand Up @@ -193,7 +193,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
sbi = UFS_SB(sb);
uspi = sbi->s_uspi;

lock_ufs(sb);
mutex_lock(&sbi->s_lock);

/*
* Try to place the inode in its parent directory
Expand Down Expand Up @@ -331,21 +331,21 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
sync_dirty_buffer(bh);
brelse(bh);
}
unlock_ufs(sb);
mutex_unlock(&sbi->s_lock);

UFSD("allocating inode %lu\n", inode->i_ino);
UFSD("EXIT\n");
return inode;

fail_remove_inode:
unlock_ufs(sb);
mutex_unlock(&sbi->s_lock);
clear_nlink(inode);
unlock_new_inode(inode);
iput(inode);
UFSD("EXIT (FAILED): err %d\n", err);
return ERR_PTR(err);
failed:
unlock_ufs(sb);
mutex_unlock(&sbi->s_lock);
make_bad_inode(inode);
iput (inode);
UFSD("EXIT (FAILED): err %d\n", err);
Expand Down
5 changes: 4 additions & 1 deletion fs/ufs/inode.c
Expand Up @@ -903,6 +903,9 @@ void ufs_evict_inode(struct inode * inode)
invalidate_inode_buffers(inode);
clear_inode(inode);

if (want_delete)
if (want_delete) {
lock_ufs(inode->i_sb);
ufs_free_inode(inode);
unlock_ufs(inode->i_sb);
}
}

0 comments on commit 4ef51e8

Please sign in to comment.