]> err.no Git - linux-2.6/blobdiff - fs/gfs2/inode.c
rtc: rtc_time_to_tm: use unsigned arithmetic
[linux-2.6] / fs / gfs2 / inode.c
index 810ff023fb147bc4da497464aff09eb81e68717e..3a9ef526c308be626b9a3470e27437d11240dab0 100644 (file)
@@ -149,7 +149,8 @@ void gfs2_set_iop(struct inode *inode)
        } else if (S_ISLNK(mode)) {
                inode->i_op = &gfs2_symlink_iops;
        } else {
-               inode->i_op = &gfs2_dev_iops;
+               inode->i_op = &gfs2_file_iops;
+               init_special_inode(inode, inode->i_mode, inode->i_rdev);
        }
 
        unlock_new_inode(inode);
@@ -350,6 +351,8 @@ int gfs2_dinode_dealloc(struct gfs2_inode *ip)
        }
 
        al = gfs2_alloc_get(ip);
+       if (!al)
+               return -ENOMEM;
 
        error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
        if (error)
@@ -824,7 +827,8 @@ static int make_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
        int error;
 
        munge_mode_uid_gid(dip, &mode, &uid, &gid);
-       gfs2_alloc_get(dip);
+       if (!gfs2_alloc_get(dip))
+               return -ENOMEM;
 
        error = gfs2_quota_lock(dip, uid, gid);
        if (error)
@@ -859,6 +863,8 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
        int error;
 
        al = gfs2_alloc_get(dip);
+       if (!al)
+               return -ENOMEM;
 
        error = gfs2_quota_lock(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
        if (error)
@@ -1225,7 +1231,7 @@ int gfs2_readlinki(struct gfs2_inode *ip, char **buf, unsigned int *len)
 
        x = ip->i_di.di_size + 1;
        if (x > *len) {
-               *buf = kmalloc(x, GFP_KERNEL);
+               *buf = kmalloc(x, GFP_NOFS);
                if (!*buf) {
                        error = -ENOMEM;
                        goto out_brelse;