VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / udf / namei.c
index ee346b7..86cf34e 100644 (file)
@@ -861,6 +861,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
        struct inode * inode = dentry->d_inode;
        struct udf_fileident_bh fibh;
        struct fileIdentDesc *fi, cfi;
+       lb_addr tloc;
 
        retval = -ENOENT;
        lock_kernel();
@@ -869,7 +870,8 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
                goto out;
 
        retval = -EIO;
-       if (udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0) != inode->i_ino)
+       tloc = lelb_to_cpu(cfi.icb.extLocation);
+       if (udf_get_lb_pblock(dir->i_sb, tloc, 0) != inode->i_ino)
                goto end_rmdir;
        retval = -ENOTEMPTY;
        if (!empty_dir(inode))
@@ -904,6 +906,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
        struct udf_fileident_bh fibh;
        struct fileIdentDesc *fi;
        struct fileIdentDesc cfi;
+       lb_addr tloc;
 
        retval = -ENOENT;
        lock_kernel();
@@ -912,12 +915,9 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
                goto out;
 
        retval = -EIO;
-
-       if (udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0) !=
-               inode->i_ino)
-       {
+       tloc = lelb_to_cpu(cfi.icb.extLocation);
+       if (udf_get_lb_pblock(dir->i_sb, tloc, 0) != inode->i_ino)
                goto end_unlink;
-       }
 
        if (!inode->i_nlink)
        {
@@ -1178,6 +1178,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
        struct fileIdentDesc *ofi = NULL, *nfi = NULL, *dir_fi = NULL, ocfi, ncfi;
        struct buffer_head *dir_bh = NULL;
        int retval = -ENOENT;
+       lb_addr tloc;
 
        lock_kernel();
        if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi)))
@@ -1186,11 +1187,10 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
                        udf_release_data(ofibh.ebh);
                udf_release_data(ofibh.sbh);
        }
-       if (!ofi || udf_get_lb_pblock(old_dir->i_sb, lelb_to_cpu(ocfi.icb.extLocation), 0) !=
-               old_inode->i_ino)
-       {
+       tloc = lelb_to_cpu(ocfi.icb.extLocation);
+       if (!ofi || udf_get_lb_pblock(old_dir->i_sb, tloc, 0)
+                                       != old_inode->i_ino)
                goto end_rename;
-       }
 
        nfi = udf_find_entry(new_dir, new_dentry, &nfibh, &ncfi);
        if (nfi)
@@ -1231,11 +1231,11 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
                }
                if (!dir_fi)
                        goto end_rename;
-               if (udf_get_lb_pblock(old_inode->i_sb, cpu_to_lelb(dir_fi->icb.extLocation), 0) !=
-                       old_dir->i_ino)
-               {
+               tloc = cpu_to_lelb(dir_fi->icb.extLocation);
+               if (udf_get_lb_pblock(old_inode->i_sb, tloc, 0)
+                                       != old_dir->i_ino)
                        goto end_rename;
-               }
+
                retval = -EMLINK;
                if (!new_inode && new_dir->i_nlink >= (256<<sizeof(new_dir->i_nlink))-1)
                        goto end_rename;