X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fjfs%2Fjfs_inode.c;h=ed6574bee51a211ea1c46f82e04d01625308577b;hb=40df2d1d8538865341a4cb9d4b7a375296517ad2;hp=bffaca9ae3a20ef31e737485230b0836d666887a;hpb=e823aff2d6eb43083abcc75a32ddfb167c324089;p=linux-2.6-omap-h63xx.git diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c index bffaca9ae3a..ed6574bee51 100644 --- a/fs/jfs/jfs_inode.c +++ b/fs/jfs/jfs_inode.c @@ -3,16 +3,16 @@ * * 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 - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -45,6 +45,24 @@ void jfs_set_inode_flags(struct inode *inode) inode->i_flags |= S_SYNC; } +void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip) +{ + unsigned int flags = jfs_ip->vfs_inode.i_flags; + + jfs_ip->mode2 &= ~(JFS_IMMUTABLE_FL | JFS_APPEND_FL | JFS_NOATIME_FL | + JFS_DIRSYNC_FL | JFS_SYNC_FL); + if (flags & S_IMMUTABLE) + jfs_ip->mode2 |= JFS_IMMUTABLE_FL; + if (flags & S_APPEND) + jfs_ip->mode2 |= JFS_APPEND_FL; + if (flags & S_NOATIME) + jfs_ip->mode2 |= JFS_NOATIME_FL; + if (flags & S_DIRSYNC) + jfs_ip->mode2 |= JFS_DIRSYNC_FL; + if (flags & S_SYNC) + jfs_ip->mode2 |= JFS_SYNC_FL; +} + /* * NAME: ialloc() * @@ -61,7 +79,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) inode = new_inode(sb); if (!inode) { jfs_warn("ialloc: new_inode returned NULL!"); - return inode; + return ERR_PTR(-ENOMEM); } jfs_inode = JFS_IP(inode); @@ -69,9 +87,10 @@ struct inode *ialloc(struct inode *parent, umode_t mode) rc = diAlloc(parent, S_ISDIR(mode), inode); if (rc) { jfs_warn("ialloc: diAlloc returned %d!", rc); - make_bad_inode(inode); + if (rc == -EIO) + make_bad_inode(inode); iput(inode); - return NULL; + return ERR_PTR(rc); } inode->i_uid = current->fsuid; @@ -97,7 +116,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) inode->i_flags |= S_NOQUOTA; inode->i_nlink = 0; iput(inode); - return NULL; + return ERR_PTR(-EDQUOT); } inode->i_mode = mode;