Commit 44f54921 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  JFS: White space cleanup
  [PATCH] JFS: return correct error when i-node allocation failed
  JFS: Remove shadow variable from fs/jfs/jfs_txnmgr.c:xtLog()
parents 3e04767a 63f83c9f
/* /*
* Copyright (c) International Business Machines Corp., 2001 * Copyright (C) International Business Machines Corp., 2001
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (c) International Business Machines Corp., 2002 * Copyright (C) International Business Machines Corp., 2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2001 * Copyright (C) International Business Machines Corp., 2000-2001
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -3780,13 +3780,13 @@ static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp, ...@@ -3780,13 +3780,13 @@ static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
GFP_KERNEL); GFP_KERNEL);
if (lkey.name == NULL) if (lkey.name == NULL)
return -ENOSPC; return -ENOMEM;
rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
GFP_KERNEL); GFP_KERNEL);
if (rkey.name == NULL) { if (rkey.name == NULL) {
kfree(lkey.name); kfree(lkey.name);
return -ENOSPC; return -ENOMEM;
} }
/* get left and right key */ /* get left and right key */
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -582,16 +582,16 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -582,16 +582,16 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
* *
* FUNCTION: attempt to extend an extent's allocation. * FUNCTION: attempt to extend an extent's allocation.
* *
* initially, we will try to extend the extent's allocation * Initially, we will try to extend the extent's allocation
* in place. if this fails, we'll try to move the extent * in place. If this fails, we'll try to move the extent
* to a new set of blocks. if moving the extent, we initially * to a new set of blocks. If moving the extent, we initially
* will try to allocate disk blocks for the requested size * will try to allocate disk blocks for the requested size
* (nnew). if this fails (new contiguous free blocks not * (newnblks). if this fails (new contiguous free blocks not
* avaliable), we'll try to allocate a smaller number of * avaliable), we'll try to allocate a smaller number of
* blocks (producing a smaller extent), with this smaller * blocks (producing a smaller extent), with this smaller
* number of blocks consisting of the requested number of * number of blocks consisting of the requested number of
* blocks rounded down to the next smaller power of 2 * blocks rounded down to the next smaller power of 2
* number (i.e. 16 -> 8). we'll continue to round down and * number (i.e. 16 -> 8). We'll continue to round down and
* retry the allocation until the number of blocks to allocate * retry the allocation until the number of blocks to allocate
* is smaller than the number of blocks per page. * is smaller than the number of blocks per page.
* *
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2001 * Copyright (C) International Business Machines Corp., 2000-2001
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -61,7 +61,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) ...@@ -61,7 +61,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
inode = new_inode(sb); inode = new_inode(sb);
if (!inode) { if (!inode) {
jfs_warn("ialloc: new_inode returned NULL!"); jfs_warn("ialloc: new_inode returned NULL!");
return inode; return ERR_PTR(-ENOMEM);
} }
jfs_inode = JFS_IP(inode); jfs_inode = JFS_IP(inode);
...@@ -69,9 +69,10 @@ struct inode *ialloc(struct inode *parent, umode_t mode) ...@@ -69,9 +69,10 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
rc = diAlloc(parent, S_ISDIR(mode), inode); rc = diAlloc(parent, S_ISDIR(mode), inode);
if (rc) { if (rc) {
jfs_warn("ialloc: diAlloc returned %d!", rc); jfs_warn("ialloc: diAlloc returned %d!", rc);
if (rc == -EIO)
make_bad_inode(inode); make_bad_inode(inode);
iput(inode); iput(inode);
return NULL; return ERR_PTR(rc);
} }
inode->i_uid = current->fsuid; inode->i_uid = current->fsuid;
...@@ -97,7 +98,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) ...@@ -97,7 +98,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
inode->i_flags |= S_NOQUOTA; inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0; inode->i_nlink = 0;
iput(inode); iput(inode);
return NULL; return ERR_PTR(-EDQUOT);
} }
inode->i_mode = mode; inode->i_mode = mode;
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2001 * Copyright (C) International Business Machines Corp., 2000-2001
* Portions Copyright (c) Christoph Hellwig, 2001-2002 * Portions Copyright (C) Christoph Hellwig, 2001-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -319,12 +319,10 @@ struct lrd { ...@@ -319,12 +319,10 @@ struct lrd {
* do not apply records which precede this record in the log * do not apply records which precede this record in the log
* with the same inode number. * with the same inode number.
* *
* NOREDILE must be the first to be written at commit * NOREDOFILE must be the first to be written at commit
* (last to be read in logredo()) - it prevents * (last to be read in logredo()) - it prevents
* replay of preceding updates of all preceding generations * replay of preceding updates of all preceding generations
* of the inumber esp. the on-disk inode itself, * of the inumber esp. the on-disk inode itself.
* but does NOT prevent
* replay of the
*/ */
struct { struct {
__le32 fileset; /* 4: fileset number */ __le32 fileset; /* 4: fileset number */
......
...@@ -2026,8 +2026,6 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -2026,8 +2026,6 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
* truncate entry XAD[twm == next - 1]: * truncate entry XAD[twm == next - 1]:
*/ */
if (twm == next - 1) { if (twm == next - 1) {
struct pxd_lock *pxdlock;
/* format a maplock for txUpdateMap() to update bmap /* format a maplock for txUpdateMap() to update bmap
* to free truncated delta extent of the truncated * to free truncated delta extent of the truncated
* entry XAD[next - 1]; * entry XAD[next - 1];
......
...@@ -124,7 +124,7 @@ int get_UCSname(struct component_name * uniName, struct dentry *dentry) ...@@ -124,7 +124,7 @@ int get_UCSname(struct component_name * uniName, struct dentry *dentry)
kmalloc((length + 1) * sizeof(wchar_t), GFP_NOFS); kmalloc((length + 1) * sizeof(wchar_t), GFP_NOFS);
if (uniName->name == NULL) if (uniName->name == NULL)
return -ENOSPC; return -ENOMEM;
uniName->namlen = jfs_strtoUCS(uniName->name, dentry->d_name.name, uniName->namlen = jfs_strtoUCS(uniName->name, dentry->d_name.name,
length, nls_tab); length, nls_tab);
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* Portions Copyright (c) Christoph Hellwig, 2001-2002 * Portions Copyright (C) Christoph Hellwig, 2001-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -97,8 +97,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode, ...@@ -97,8 +97,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
* begin the transaction before we search the directory. * begin the transaction before we search the directory.
*/ */
ip = ialloc(dip, mode); ip = ialloc(dip, mode);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out2; goto out2;
} }
...@@ -231,8 +231,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -231,8 +231,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
* begin the transaction before we search the directory. * begin the transaction before we search the directory.
*/ */
ip = ialloc(dip, S_IFDIR | mode); ip = ialloc(dip, S_IFDIR | mode);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out2; goto out2;
} }
...@@ -906,8 +906,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -906,8 +906,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
* (iAlloc() returns new, locked inode) * (iAlloc() returns new, locked inode)
*/ */
ip = ialloc(dip, S_IFLNK | 0777); ip = ialloc(dip, S_IFLNK | 0777);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out2; goto out2;
} }
...@@ -978,7 +978,6 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -978,7 +978,6 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
xlen = xsize >> JFS_SBI(sb)->l2bsize; xlen = xsize >> JFS_SBI(sb)->l2bsize;
if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0))) { if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0))) {
txAbort(tid, 0); txAbort(tid, 0);
rc = -ENOSPC;
goto out3; goto out3;
} }
extent = xaddr; extent = xaddr;
...@@ -1350,8 +1349,8 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry, ...@@ -1350,8 +1349,8 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
goto out; goto out;
ip = ialloc(dir, mode); ip = ialloc(dir, mode);
if (ip == NULL) { if (IS_ERR(ip)) {
rc = -ENOSPC; rc = PTR_ERR(ip);
goto out1; goto out1;
} }
jfs_ip = JFS_IP(ip); jfs_ip = JFS_IP(ip);
......
...@@ -422,7 +422,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -422,7 +422,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL); sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL);
if (!sbi) if (!sbi)
return -ENOSPC; return -ENOMEM;
sb->s_fs_info = sbi; sb->s_fs_info = sbi;
sbi->sb = sb; sbi->sb = sb;
sbi->uid = sbi->gid = sbi->umask = -1; sbi->uid = sbi->gid = sbi->umask = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment