diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-24 19:01:15 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-24 19:01:15 -0800 |
commit | 397aa6b63ff25cee0b8ed20a6d447527c8ab0849 (patch) | |
tree | b3146e8c494b00624597e400f0d2a9a8edd36d4a /fs/minix/bitmap.c | |
parent | 595fa4e313fee3c0b69c10bbed6fffb803237306 (diff) | |
parent | 2cb6a44220b974a7832d1a09630b4cee870b023a (diff) | |
download | lwn-397aa6b63ff25cee0b8ed20a6d447527c8ab0849.tar.gz lwn-397aa6b63ff25cee0b8ed20a6d447527c8ab0849.zip |
Merge branch 'work.minix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull minix updates from Al Viro:
"Assorted fixes - mostly Christoph's"
* 'work.minix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
minix_rename(): minix_delete_entry() might fail
minix: don't flush page immediately for DIRSYNC directories
minix: fix error handling in minix_set_link
minix: fix error handling in minix_delete_entry
minix: move releasing pages into unlink and rename
minix: make minix_new_inode() return error as ERR_PTR(-E...)
Diffstat (limited to 'fs/minix/bitmap.c')
-rw-r--r-- | fs/minix/bitmap.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c index 724d8191a310..870207ba23f1 100644 --- a/fs/minix/bitmap.c +++ b/fs/minix/bitmap.c @@ -210,7 +210,7 @@ void minix_free_inode(struct inode * inode) mark_buffer_dirty(bh); } -struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error) +struct inode *minix_new_inode(const struct inode *dir, umode_t mode) { struct super_block *sb = dir->i_sb; struct minix_sb_info *sbi = minix_sb(sb); @@ -220,13 +220,10 @@ struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error) unsigned long j; int i; - if (!inode) { - *error = -ENOMEM; - return NULL; - } + if (!inode) + return ERR_PTR(-ENOMEM); j = bits_per_zone; bh = NULL; - *error = -ENOSPC; spin_lock(&bitmap_lock); for (i = 0; i < sbi->s_imap_blocks; i++) { bh = sbi->s_imap[i]; @@ -237,20 +234,20 @@ struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error) if (!bh || j >= bits_per_zone) { spin_unlock(&bitmap_lock); iput(inode); - return NULL; + return ERR_PTR(-ENOSPC); } if (minix_test_and_set_bit(j, bh->b_data)) { /* shouldn't happen */ spin_unlock(&bitmap_lock); printk("minix_new_inode: bit already set\n"); iput(inode); - return NULL; + return ERR_PTR(-ENOSPC); } spin_unlock(&bitmap_lock); mark_buffer_dirty(bh); j += i * bits_per_zone; if (!j || j > sbi->s_ninodes) { iput(inode); - return NULL; + return ERR_PTR(-ENOSPC); } inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_ino = j; @@ -260,7 +257,6 @@ struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error) insert_inode_hash(inode); mark_inode_dirty(inode); - *error = 0; return inode; } |