Skip to content

Commit bb66873

Browse files
dhowellsAl Viro
authored andcommitted
VFS: assorted d_backing_inode() annotations
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent df2b1af commit bb66873

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

arch/x86/kvm/assigned-dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ static int probe_sysfs_permissions(struct pci_dev *dev)
666666
if (r)
667667
return r;
668668

669-
inode = path.dentry->d_inode;
669+
inode = d_backing_inode(path.dentry);
670670

671671
r = inode_permission(inode, MAY_READ | MAY_WRITE | MAY_ACCESS);
672672
path_put(&path);

drivers/mtd/ubi/build.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,9 +1164,9 @@ static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev)
11641164
return ERR_PTR(err);
11651165

11661166
/* MTD device number is defined by the major / minor numbers */
1167-
major = imajor(path.dentry->d_inode);
1168-
minor = iminor(path.dentry->d_inode);
1169-
mode = path.dentry->d_inode->i_mode;
1167+
major = imajor(d_backing_inode(path.dentry));
1168+
minor = iminor(d_backing_inode(path.dentry));
1169+
mode = d_backing_inode(path.dentry)->i_mode;
11701170
path_put(&path);
11711171
if (major != MTD_CHAR_MAJOR || !S_ISCHR(mode))
11721172
return ERR_PTR(-EINVAL);

drivers/mtd/ubi/kapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode)
314314
if (error)
315315
return ERR_PTR(error);
316316

317-
inode = path.dentry->d_inode;
317+
inode = d_backing_inode(path.dentry);
318318
mod = inode->i_mode;
319319
ubi_num = ubi_major2num(imajor(inode));
320320
vol_id = iminor(inode) - 1;

fs/block_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ struct block_device *lookup_bdev(const char *pathname)
17161716
if (error)
17171717
return ERR_PTR(error);
17181718

1719-
inode = path.dentry->d_inode;
1719+
inode = d_backing_inode(path.dentry);
17201720
error = -ENOTBLK;
17211721
if (!S_ISBLK(inode->i_mode))
17221722
goto fail;

fs/posix_acl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,12 @@ posix_acl_xattr_get(struct dentry *dentry, const char *name,
774774
struct posix_acl *acl;
775775
int error;
776776

777-
if (!IS_POSIXACL(dentry->d_inode))
777+
if (!IS_POSIXACL(d_backing_inode(dentry)))
778778
return -EOPNOTSUPP;
779779
if (d_is_symlink(dentry))
780780
return -EOPNOTSUPP;
781781

782-
acl = get_acl(dentry->d_inode, type);
782+
acl = get_acl(d_backing_inode(dentry), type);
783783
if (IS_ERR(acl))
784784
return PTR_ERR(acl);
785785
if (acl == NULL)
@@ -795,7 +795,7 @@ static int
795795
posix_acl_xattr_set(struct dentry *dentry, const char *name,
796796
const void *value, size_t size, int flags, int type)
797797
{
798-
struct inode *inode = dentry->d_inode;
798+
struct inode *inode = d_backing_inode(dentry);
799799
struct posix_acl *acl = NULL;
800800
int ret;
801801

@@ -834,7 +834,7 @@ posix_acl_xattr_list(struct dentry *dentry, char *list, size_t list_size,
834834
const char *xname;
835835
size_t size;
836836

837-
if (!IS_POSIXACL(dentry->d_inode))
837+
if (!IS_POSIXACL(d_backing_inode(dentry)))
838838
return -EOPNOTSUPP;
839839
if (d_is_symlink(dentry))
840840
return -EOPNOTSUPP;

fs/stat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ EXPORT_SYMBOL(generic_fillattr);
5151
*/
5252
int vfs_getattr_nosec(struct path *path, struct kstat *stat)
5353
{
54-
struct inode *inode = path->dentry->d_inode;
54+
struct inode *inode = d_backing_inode(path->dentry);
5555

5656
if (inode->i_op->getattr)
5757
return inode->i_op->getattr(path->mnt, path->dentry, stat);
@@ -326,7 +326,7 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
326326
retry:
327327
error = user_path_at_empty(dfd, pathname, lookup_flags, &path, &empty);
328328
if (!error) {
329-
struct inode *inode = path.dentry->d_inode;
329+
struct inode *inode = d_backing_inode(path.dentry);
330330

331331
error = empty ? -ENOENT : -EINVAL;
332332
if (inode->i_op->readlink) {

0 commit comments

Comments
 (0)