diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-09-30 23:43:31 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-09-30 23:43:31 -0400 |
commit | 6af502de224c3742936d54eee7e3690c09822934 (patch) | |
tree | 9988331693952348503d64764ff81dc3b5d801ab /fs/hfsplus/dir.c | |
parent | dd73a01a30d729e8fa6f829c4582650e258e36f9 (diff) |
hfsplus: fix HFSPLUS_I calling convention
HFSPLUS_I doesn't return a pointer to the hfsplus-specific inode
information like all other FOO_I macros, but dereference the pointer in a way
that made it look like a direct struct derefence. This only works as long
as the HFSPLUS_I macro is used directly and prevents us from keepig a local
hfsplus_inode_info pointer. Fix the calling convention and introduce a local
hip variable in all functions that use it constantly.
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/dir.c')
-rw-r--r-- | fs/hfsplus/dir.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 584777ddb0b9..5ca8308f9eb7 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
@@ -68,8 +68,8 @@ again: | |||
68 | cnid = be32_to_cpu(entry.file.id); | 68 | cnid = be32_to_cpu(entry.file.id); |
69 | if (entry.file.user_info.fdType == cpu_to_be32(HFSP_HARDLINK_TYPE) && | 69 | if (entry.file.user_info.fdType == cpu_to_be32(HFSP_HARDLINK_TYPE) && |
70 | entry.file.user_info.fdCreator == cpu_to_be32(HFSP_HFSPLUS_CREATOR) && | 70 | entry.file.user_info.fdCreator == cpu_to_be32(HFSP_HFSPLUS_CREATOR) && |
71 | (entry.file.create_date == HFSPLUS_I(HFSPLUS_SB(sb)->hidden_dir).create_date || | 71 | (entry.file.create_date == HFSPLUS_I(HFSPLUS_SB(sb)->hidden_dir)->create_date || |
72 | entry.file.create_date == HFSPLUS_I(sb->s_root->d_inode).create_date) && | 72 | entry.file.create_date == HFSPLUS_I(sb->s_root->d_inode)->create_date) && |
73 | HFSPLUS_SB(sb)->hidden_dir) { | 73 | HFSPLUS_SB(sb)->hidden_dir) { |
74 | struct qstr str; | 74 | struct qstr str; |
75 | char name[32]; | 75 | char name[32]; |
@@ -102,7 +102,7 @@ again: | |||
102 | if (IS_ERR(inode)) | 102 | if (IS_ERR(inode)) |
103 | return ERR_CAST(inode); | 103 | return ERR_CAST(inode); |
104 | if (S_ISREG(inode->i_mode)) | 104 | if (S_ISREG(inode->i_mode)) |
105 | HFSPLUS_I(inode).dev = linkid; | 105 | HFSPLUS_I(inode)->dev = linkid; |
106 | out: | 106 | out: |
107 | d_add(dentry, inode); | 107 | d_add(dentry, inode); |
108 | return NULL; | 108 | return NULL; |
@@ -219,7 +219,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
219 | } | 219 | } |
220 | filp->private_data = rd; | 220 | filp->private_data = rd; |
221 | rd->file = filp; | 221 | rd->file = filp; |
222 | list_add(&rd->list, &HFSPLUS_I(inode).open_dir_list); | 222 | list_add(&rd->list, &HFSPLUS_I(inode)->open_dir_list); |
223 | } | 223 | } |
224 | memcpy(&rd->key, fd.key, sizeof(struct hfsplus_cat_key)); | 224 | memcpy(&rd->key, fd.key, sizeof(struct hfsplus_cat_key)); |
225 | out: | 225 | out: |
@@ -287,7 +287,7 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir, | |||
287 | if (res != -EEXIST) | 287 | if (res != -EEXIST) |
288 | return res; | 288 | return res; |
289 | } | 289 | } |
290 | HFSPLUS_I(inode).dev = id; | 290 | HFSPLUS_I(inode)->dev = id; |
291 | cnid = sbi->next_cnid++; | 291 | cnid = sbi->next_cnid++; |
292 | src_dentry->d_fsdata = (void *)(unsigned long)cnid; | 292 | src_dentry->d_fsdata = (void *)(unsigned long)cnid; |
293 | res = hfsplus_create_cat(cnid, src_dir, &src_dentry->d_name, inode); | 293 | res = hfsplus_create_cat(cnid, src_dir, &src_dentry->d_name, inode); |
@@ -326,7 +326,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) | |||
326 | 326 | ||
327 | cnid = (u32)(unsigned long)dentry->d_fsdata; | 327 | cnid = (u32)(unsigned long)dentry->d_fsdata; |
328 | if (inode->i_ino == cnid && | 328 | if (inode->i_ino == cnid && |
329 | atomic_read(&HFSPLUS_I(inode).opencnt)) { | 329 | atomic_read(&HFSPLUS_I(inode)->opencnt)) { |
330 | str.name = name; | 330 | str.name = name; |
331 | str.len = sprintf(name, "temp%lu", inode->i_ino); | 331 | str.len = sprintf(name, "temp%lu", inode->i_ino); |
332 | res = hfsplus_rename_cat(inode->i_ino, | 332 | res = hfsplus_rename_cat(inode->i_ino, |
@@ -347,7 +347,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) | |||
347 | if (!inode->i_nlink) { | 347 | if (!inode->i_nlink) { |
348 | if (inode->i_ino != cnid) { | 348 | if (inode->i_ino != cnid) { |
349 | sbi->file_count--; | 349 | sbi->file_count--; |
350 | if (!atomic_read(&HFSPLUS_I(inode).opencnt)) { | 350 | if (!atomic_read(&HFSPLUS_I(inode)->opencnt)) { |
351 | res = hfsplus_delete_cat(inode->i_ino, | 351 | res = hfsplus_delete_cat(inode->i_ino, |
352 | sbi->hidden_dir, | 352 | sbi->hidden_dir, |
353 | NULL); | 353 | NULL); |