Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144900
b: refs/heads/master
c: 201913e
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi committed May 9, 2009
1 parent 02d6d13 commit 8ded2ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85c2a74fabadfc561b75fbd7decc6bcbfe873d57
refs/heads/master: 201913ed746c7724a40d33ee5a0b6a1fd2ef3193
8 changes: 5 additions & 3 deletions trunk/fs/nilfs2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,14 +516,16 @@ static ssize_t
nilfs_ioctl_do_free_segments(struct the_nilfs *nilfs, __u64 *posp, int flags,
void *buf, size_t size, size_t nmembs)
{
struct nilfs_sb_info *sbi = nilfs_get_writer(nilfs);
struct nilfs_sb_info *sbi = nilfs->ns_writer;
int ret;

if (unlikely(!sbi))
if (unlikely(!sbi)) {
/* never happens because called for a writable mount */
WARN_ON(1);
return -EROFS;
}
ret = nilfs_segctor_add_segments_to_be_freed(
NILFS_SC(sbi), buf, nmembs);
nilfs_put_writer(nilfs);

return (ret < 0) ? ret : nmembs;
}
Expand Down
13 changes: 7 additions & 6 deletions trunk/fs/nilfs2/mdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,22 @@ static int nilfs_mdt_create_block(struct inode *inode, unsigned long block,
void *))
{
struct the_nilfs *nilfs = NILFS_MDT(inode)->mi_nilfs;
struct nilfs_sb_info *writer = NULL;
struct super_block *sb = inode->i_sb;
struct nilfs_transaction_info ti;
struct buffer_head *bh;
int err;

if (!sb) {
writer = nilfs_get_writer(nilfs);
if (!writer) {
/*
* Make sure this function is not called from any
* read-only context.
*/
if (!nilfs->ns_writer) {
WARN_ON(1);
err = -EROFS;
goto out;
}
sb = writer->s_super;
sb = nilfs->ns_writer->s_super;
}

nilfs_transaction_begin(sb, &ti, 0);
Expand Down Expand Up @@ -127,8 +130,6 @@ static int nilfs_mdt_create_block(struct inode *inode, unsigned long block,
err = nilfs_transaction_commit(sb);
else
nilfs_transaction_abort(sb);
if (writer)
nilfs_put_writer(nilfs);
out:
return err;
}
Expand Down

0 comments on commit 8ded2ac

Please sign in to comment.