int ntfs_attr_remove(struct ntfs_inode *ni, const __le32 type, __le16 *name,
u32 name_len)
{
- struct super_block *sb;
int err;
struct inode *attr_vi;
struct ntfs_inode *attr_ni;
ntfs_debug("Entering\n");
- sb = ni->vol->sb;
- if (!ni) {
- ntfs_error(sb, "NULL inode pointer\n");
+ if (!ni)
return -EINVAL;
- }
attr_vi = ntfs_attr_iget(VFS_I(ni), type, name, name_len);
if (IS_ERR(attr_vi)) {
err = PTR_ERR(attr_vi);
- ntfs_error(sb, "Failed to open attribute 0x%02x of inode 0x%llx",
+ ntfs_error(ni->vol->sb, "Failed to open attribute 0x%02x of inode 0x%llx",
type, (unsigned long long)ni->mft_no);
return err;
}
err = ntfs_attr_rm(attr_ni);
if (err)
- ntfs_error(sb, "Failed to remove attribute 0x%02x of inode 0x%llx",
+ ntfs_error(ni->vol->sb, "Failed to remove attribute 0x%02x of inode 0x%llx",
type, (unsigned long long)ni->mft_no);
iput(attr_vi);
return err;
}
if (err) {
- private->curr_pos = actor->pos;
- private->end_in_iterate = true;
+ if (private) {
+ private->curr_pos = actor->pos;
+ private->end_in_iterate = true;
+ }
err = 0;
}
ntfs_index_ctx_put(ictx);
* base inode before destroying it.
*/
base_ni = ni->ext.base_ntfs_ino;
+ tmp_nis = base_ni->ext.extent_ntfs_inos;
+ if (!tmp_nis)
+ goto out;
for (i = 0; i < base_ni->nr_extents; ++i) {
- tmp_nis = base_ni->ext.extent_ntfs_inos;
if (tmp_nis[i] != ni)
continue;
/* Found it. Disconnect. */
break;
}
+out:
if (NInoDirty(ni))
ntfs_error(ni->vol->sb, "Releasing dirty inode %llu!\n",
ni->mft_no);
{
struct runlist_element *i_rl, *new_rl, *src_rl_origin = src_rl;
struct runlist_element dst_rl_split;
- s64 start_vcn = src_rl[0].vcn;
+ s64 start_vcn;
int new_1st_cnt, new_2nd_cnt, new_3rd_cnt, new_cnt;
if (!dst_rl || !src_rl || !new_rl_cnt)