Commit ac664f02 authored by Mika Kukkonen's avatar Mika Kukkonen Committed by Linus Torvalds

[PATCH] Fix sparse warnings in fs/udf/*

  CHECK   fs/udf/dir.c
fs/udf/dir.c:240:13: warning: expected lvalue for member dereference
[...]
  CHECK   fs/udf/namei.c
fs/udf/namei.c:872:6: warning: expected lvalue for member dereference
fs/udf/namei.c:916:6: warning: expected lvalue for member dereference
fs/udf/namei.c:1189:14: warning: expected lvalue for member dereference
fs/udf/namei.c:1234:7: warning: expected lvalue for member dereference
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 12abcba2
......@@ -237,7 +237,9 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
}
else
{
iblock = udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0);
lb_addr tloc = lelb_to_cpu(cfi.icb.extLocation);
iblock = udf_get_lb_pblock(dir->i_sb, tloc, 0);
flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);
dt_type = DT_UNKNOWN;
}
......
......@@ -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;
......
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