diff options
author | David Howells <dhowells@redhat.com> | 2015-03-17 18:25:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-15 15:06:57 -0400 |
commit | 2b0143b5c986be1ce8408b3aadc4709e0a94429d (patch) | |
tree | 98b1dee70f3d5d9ac9309f4638e41864ddcd0952 /fs/xfs | |
parent | ce0b16ddf18df35026164fda4a642ef10c01f442 (diff) |
VFS: normal filesystems (and lustre): d_inode() annotations
that's the bulk of filesystem drivers dealing with inodes of their own
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_export.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_filestream.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 18 | ||||
-rw-r--r-- | fs/xfs/xfs_ioctl32.c | 12 | ||||
-rw-r--r-- | fs/xfs/xfs_iops.c | 20 | ||||
-rw-r--r-- | fs/xfs/xfs_super.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_xattr.c | 6 |
7 files changed, 31 insertions, 31 deletions
diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c index b97359ba2648..652cd3c5b58c 100644 --- a/fs/xfs/xfs_export.c +++ b/fs/xfs/xfs_export.c | |||
@@ -215,7 +215,7 @@ xfs_fs_get_parent( | |||
215 | int error; | 215 | int error; |
216 | struct xfs_inode *cip; | 216 | struct xfs_inode *cip; |
217 | 217 | ||
218 | error = xfs_lookup(XFS_I(child->d_inode), &xfs_name_dotdot, &cip, NULL); | 218 | error = xfs_lookup(XFS_I(d_inode(child)), &xfs_name_dotdot, &cip, NULL); |
219 | if (unlikely(error)) | 219 | if (unlikely(error)) |
220 | return ERR_PTR(error); | 220 | return ERR_PTR(error); |
221 | 221 | ||
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c index a2e86e8a0fea..22807e1e9cca 100644 --- a/fs/xfs/xfs_filestream.c +++ b/fs/xfs/xfs_filestream.c | |||
@@ -294,7 +294,7 @@ xfs_filestream_get_parent( | |||
294 | if (!parent) | 294 | if (!parent) |
295 | goto out_dput; | 295 | goto out_dput; |
296 | 296 | ||
297 | dir = igrab(parent->d_inode); | 297 | dir = igrab(d_inode(parent)); |
298 | dput(parent); | 298 | dput(parent); |
299 | 299 | ||
300 | out_dput: | 300 | out_dput: |
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index ac4feae45eb3..ed97bd48cf32 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -82,7 +82,7 @@ xfs_find_handle( | |||
82 | error = user_lpath((const char __user *)hreq->path, &path); | 82 | error = user_lpath((const char __user *)hreq->path, &path); |
83 | if (error) | 83 | if (error) |
84 | return error; | 84 | return error; |
85 | inode = path.dentry->d_inode; | 85 | inode = d_inode(path.dentry); |
86 | } | 86 | } |
87 | ip = XFS_I(inode); | 87 | ip = XFS_I(inode); |
88 | 88 | ||
@@ -210,7 +210,7 @@ xfs_open_by_handle( | |||
210 | dentry = xfs_handlereq_to_dentry(parfilp, hreq); | 210 | dentry = xfs_handlereq_to_dentry(parfilp, hreq); |
211 | if (IS_ERR(dentry)) | 211 | if (IS_ERR(dentry)) |
212 | return PTR_ERR(dentry); | 212 | return PTR_ERR(dentry); |
213 | inode = dentry->d_inode; | 213 | inode = d_inode(dentry); |
214 | 214 | ||
215 | /* Restrict xfs_open_by_handle to directories & regular files. */ | 215 | /* Restrict xfs_open_by_handle to directories & regular files. */ |
216 | if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) { | 216 | if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) { |
@@ -303,7 +303,7 @@ xfs_readlink_by_handle( | |||
303 | goto out_dput; | 303 | goto out_dput; |
304 | } | 304 | } |
305 | 305 | ||
306 | error = xfs_readlink(XFS_I(dentry->d_inode), link); | 306 | error = xfs_readlink(XFS_I(d_inode(dentry)), link); |
307 | if (error) | 307 | if (error) |
308 | goto out_kfree; | 308 | goto out_kfree; |
309 | error = readlink_copy(hreq->ohandle, olen, link); | 309 | error = readlink_copy(hreq->ohandle, olen, link); |
@@ -376,7 +376,7 @@ xfs_fssetdm_by_handle( | |||
376 | return PTR_ERR(dentry); | 376 | return PTR_ERR(dentry); |
377 | } | 377 | } |
378 | 378 | ||
379 | if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode)) { | 379 | if (IS_IMMUTABLE(d_inode(dentry)) || IS_APPEND(d_inode(dentry))) { |
380 | error = -EPERM; | 380 | error = -EPERM; |
381 | goto out; | 381 | goto out; |
382 | } | 382 | } |
@@ -386,7 +386,7 @@ xfs_fssetdm_by_handle( | |||
386 | goto out; | 386 | goto out; |
387 | } | 387 | } |
388 | 388 | ||
389 | error = xfs_set_dmattrs(XFS_I(dentry->d_inode), fsd.fsd_dmevmask, | 389 | error = xfs_set_dmattrs(XFS_I(d_inode(dentry)), fsd.fsd_dmevmask, |
390 | fsd.fsd_dmstate); | 390 | fsd.fsd_dmstate); |
391 | 391 | ||
392 | out: | 392 | out: |
@@ -429,7 +429,7 @@ xfs_attrlist_by_handle( | |||
429 | goto out_dput; | 429 | goto out_dput; |
430 | 430 | ||
431 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; | 431 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; |
432 | error = xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen, | 432 | error = xfs_attr_list(XFS_I(d_inode(dentry)), kbuf, al_hreq.buflen, |
433 | al_hreq.flags, cursor); | 433 | al_hreq.flags, cursor); |
434 | if (error) | 434 | if (error) |
435 | goto out_kfree; | 435 | goto out_kfree; |
@@ -559,7 +559,7 @@ xfs_attrmulti_by_handle( | |||
559 | switch (ops[i].am_opcode) { | 559 | switch (ops[i].am_opcode) { |
560 | case ATTR_OP_GET: | 560 | case ATTR_OP_GET: |
561 | ops[i].am_error = xfs_attrmulti_attr_get( | 561 | ops[i].am_error = xfs_attrmulti_attr_get( |
562 | dentry->d_inode, attr_name, | 562 | d_inode(dentry), attr_name, |
563 | ops[i].am_attrvalue, &ops[i].am_length, | 563 | ops[i].am_attrvalue, &ops[i].am_length, |
564 | ops[i].am_flags); | 564 | ops[i].am_flags); |
565 | break; | 565 | break; |
@@ -568,7 +568,7 @@ xfs_attrmulti_by_handle( | |||
568 | if (ops[i].am_error) | 568 | if (ops[i].am_error) |
569 | break; | 569 | break; |
570 | ops[i].am_error = xfs_attrmulti_attr_set( | 570 | ops[i].am_error = xfs_attrmulti_attr_set( |
571 | dentry->d_inode, attr_name, | 571 | d_inode(dentry), attr_name, |
572 | ops[i].am_attrvalue, ops[i].am_length, | 572 | ops[i].am_attrvalue, ops[i].am_length, |
573 | ops[i].am_flags); | 573 | ops[i].am_flags); |
574 | mnt_drop_write_file(parfilp); | 574 | mnt_drop_write_file(parfilp); |
@@ -578,7 +578,7 @@ xfs_attrmulti_by_handle( | |||
578 | if (ops[i].am_error) | 578 | if (ops[i].am_error) |
579 | break; | 579 | break; |
580 | ops[i].am_error = xfs_attrmulti_attr_remove( | 580 | ops[i].am_error = xfs_attrmulti_attr_remove( |
581 | dentry->d_inode, attr_name, | 581 | d_inode(dentry), attr_name, |
582 | ops[i].am_flags); | 582 | ops[i].am_flags); |
583 | mnt_drop_write_file(parfilp); | 583 | mnt_drop_write_file(parfilp); |
584 | break; | 584 | break; |
diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index bfc7c7c8a0c8..b88bdc85dd3d 100644 --- a/fs/xfs/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c | |||
@@ -375,7 +375,7 @@ xfs_compat_attrlist_by_handle( | |||
375 | goto out_dput; | 375 | goto out_dput; |
376 | 376 | ||
377 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; | 377 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; |
378 | error = xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen, | 378 | error = xfs_attr_list(XFS_I(d_inode(dentry)), kbuf, al_hreq.buflen, |
379 | al_hreq.flags, cursor); | 379 | al_hreq.flags, cursor); |
380 | if (error) | 380 | if (error) |
381 | goto out_kfree; | 381 | goto out_kfree; |
@@ -445,7 +445,7 @@ xfs_compat_attrmulti_by_handle( | |||
445 | switch (ops[i].am_opcode) { | 445 | switch (ops[i].am_opcode) { |
446 | case ATTR_OP_GET: | 446 | case ATTR_OP_GET: |
447 | ops[i].am_error = xfs_attrmulti_attr_get( | 447 | ops[i].am_error = xfs_attrmulti_attr_get( |
448 | dentry->d_inode, attr_name, | 448 | d_inode(dentry), attr_name, |
449 | compat_ptr(ops[i].am_attrvalue), | 449 | compat_ptr(ops[i].am_attrvalue), |
450 | &ops[i].am_length, ops[i].am_flags); | 450 | &ops[i].am_length, ops[i].am_flags); |
451 | break; | 451 | break; |
@@ -454,7 +454,7 @@ xfs_compat_attrmulti_by_handle( | |||
454 | if (ops[i].am_error) | 454 | if (ops[i].am_error) |
455 | break; | 455 | break; |
456 | ops[i].am_error = xfs_attrmulti_attr_set( | 456 | ops[i].am_error = xfs_attrmulti_attr_set( |
457 | dentry->d_inode, attr_name, | 457 | d_inode(dentry), attr_name, |
458 | compat_ptr(ops[i].am_attrvalue), | 458 | compat_ptr(ops[i].am_attrvalue), |
459 | ops[i].am_length, ops[i].am_flags); | 459 | ops[i].am_length, ops[i].am_flags); |
460 | mnt_drop_write_file(parfilp); | 460 | mnt_drop_write_file(parfilp); |
@@ -464,7 +464,7 @@ xfs_compat_attrmulti_by_handle( | |||
464 | if (ops[i].am_error) | 464 | if (ops[i].am_error) |
465 | break; | 465 | break; |
466 | ops[i].am_error = xfs_attrmulti_attr_remove( | 466 | ops[i].am_error = xfs_attrmulti_attr_remove( |
467 | dentry->d_inode, attr_name, | 467 | d_inode(dentry), attr_name, |
468 | ops[i].am_flags); | 468 | ops[i].am_flags); |
469 | mnt_drop_write_file(parfilp); | 469 | mnt_drop_write_file(parfilp); |
470 | break; | 470 | break; |
@@ -504,7 +504,7 @@ xfs_compat_fssetdm_by_handle( | |||
504 | if (IS_ERR(dentry)) | 504 | if (IS_ERR(dentry)) |
505 | return PTR_ERR(dentry); | 505 | return PTR_ERR(dentry); |
506 | 506 | ||
507 | if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode)) { | 507 | if (IS_IMMUTABLE(d_inode(dentry)) || IS_APPEND(d_inode(dentry))) { |
508 | error = -EPERM; | 508 | error = -EPERM; |
509 | goto out; | 509 | goto out; |
510 | } | 510 | } |
@@ -514,7 +514,7 @@ xfs_compat_fssetdm_by_handle( | |||
514 | goto out; | 514 | goto out; |
515 | } | 515 | } |
516 | 516 | ||
517 | error = xfs_set_dmattrs(XFS_I(dentry->d_inode), fsd.fsd_dmevmask, | 517 | error = xfs_set_dmattrs(XFS_I(d_inode(dentry)), fsd.fsd_dmevmask, |
518 | fsd.fsd_dmstate); | 518 | fsd.fsd_dmstate); |
519 | 519 | ||
520 | out: | 520 | out: |
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index e53a90331422..54b95232d946 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -301,7 +301,7 @@ xfs_vn_link( | |||
301 | struct inode *dir, | 301 | struct inode *dir, |
302 | struct dentry *dentry) | 302 | struct dentry *dentry) |
303 | { | 303 | { |
304 | struct inode *inode = old_dentry->d_inode; | 304 | struct inode *inode = d_inode(old_dentry); |
305 | struct xfs_name name; | 305 | struct xfs_name name; |
306 | int error; | 306 | int error; |
307 | 307 | ||
@@ -326,7 +326,7 @@ xfs_vn_unlink( | |||
326 | 326 | ||
327 | xfs_dentry_to_name(&name, dentry, 0); | 327 | xfs_dentry_to_name(&name, dentry, 0); |
328 | 328 | ||
329 | error = xfs_remove(XFS_I(dir), &name, XFS_I(dentry->d_inode)); | 329 | error = xfs_remove(XFS_I(dir), &name, XFS_I(d_inode(dentry))); |
330 | if (error) | 330 | if (error) |
331 | return error; | 331 | return error; |
332 | 332 | ||
@@ -384,7 +384,7 @@ xfs_vn_rename( | |||
384 | struct dentry *ndentry, | 384 | struct dentry *ndentry, |
385 | unsigned int flags) | 385 | unsigned int flags) |
386 | { | 386 | { |
387 | struct inode *new_inode = ndentry->d_inode; | 387 | struct inode *new_inode = d_inode(ndentry); |
388 | int omode = 0; | 388 | int omode = 0; |
389 | struct xfs_name oname; | 389 | struct xfs_name oname; |
390 | struct xfs_name nname; | 390 | struct xfs_name nname; |
@@ -394,12 +394,12 @@ xfs_vn_rename( | |||
394 | 394 | ||
395 | /* if we are exchanging files, we need to set i_mode of both files */ | 395 | /* if we are exchanging files, we need to set i_mode of both files */ |
396 | if (flags & RENAME_EXCHANGE) | 396 | if (flags & RENAME_EXCHANGE) |
397 | omode = ndentry->d_inode->i_mode; | 397 | omode = d_inode(ndentry)->i_mode; |
398 | 398 | ||
399 | xfs_dentry_to_name(&oname, odentry, omode); | 399 | xfs_dentry_to_name(&oname, odentry, omode); |
400 | xfs_dentry_to_name(&nname, ndentry, odentry->d_inode->i_mode); | 400 | xfs_dentry_to_name(&nname, ndentry, d_inode(odentry)->i_mode); |
401 | 401 | ||
402 | return xfs_rename(XFS_I(odir), &oname, XFS_I(odentry->d_inode), | 402 | return xfs_rename(XFS_I(odir), &oname, XFS_I(d_inode(odentry)), |
403 | XFS_I(ndir), &nname, | 403 | XFS_I(ndir), &nname, |
404 | new_inode ? XFS_I(new_inode) : NULL, flags); | 404 | new_inode ? XFS_I(new_inode) : NULL, flags); |
405 | } | 405 | } |
@@ -421,7 +421,7 @@ xfs_vn_follow_link( | |||
421 | if (!link) | 421 | if (!link) |
422 | goto out_err; | 422 | goto out_err; |
423 | 423 | ||
424 | error = xfs_readlink(XFS_I(dentry->d_inode), link); | 424 | error = xfs_readlink(XFS_I(d_inode(dentry)), link); |
425 | if (unlikely(error)) | 425 | if (unlikely(error)) |
426 | goto out_kfree; | 426 | goto out_kfree; |
427 | 427 | ||
@@ -441,7 +441,7 @@ xfs_vn_getattr( | |||
441 | struct dentry *dentry, | 441 | struct dentry *dentry, |
442 | struct kstat *stat) | 442 | struct kstat *stat) |
443 | { | 443 | { |
444 | struct inode *inode = dentry->d_inode; | 444 | struct inode *inode = d_inode(dentry); |
445 | struct xfs_inode *ip = XFS_I(inode); | 445 | struct xfs_inode *ip = XFS_I(inode); |
446 | struct xfs_mount *mp = ip->i_mount; | 446 | struct xfs_mount *mp = ip->i_mount; |
447 | 447 | ||
@@ -968,14 +968,14 @@ xfs_vn_setattr( | |||
968 | struct dentry *dentry, | 968 | struct dentry *dentry, |
969 | struct iattr *iattr) | 969 | struct iattr *iattr) |
970 | { | 970 | { |
971 | struct xfs_inode *ip = XFS_I(dentry->d_inode); | 971 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); |
972 | int error; | 972 | int error; |
973 | 973 | ||
974 | if (iattr->ia_valid & ATTR_SIZE) { | 974 | if (iattr->ia_valid & ATTR_SIZE) { |
975 | uint iolock = XFS_IOLOCK_EXCL; | 975 | uint iolock = XFS_IOLOCK_EXCL; |
976 | 976 | ||
977 | xfs_ilock(ip, iolock); | 977 | xfs_ilock(ip, iolock); |
978 | error = xfs_break_layouts(dentry->d_inode, &iolock); | 978 | error = xfs_break_layouts(d_inode(dentry), &iolock); |
979 | if (!error) | 979 | if (!error) |
980 | error = xfs_setattr_size(ip, iattr); | 980 | error = xfs_setattr_size(ip, iattr); |
981 | xfs_iunlock(ip, iolock); | 981 | xfs_iunlock(ip, iolock); |
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 8fcc4ccc5c79..72e97e31d3b1 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -1083,7 +1083,7 @@ xfs_fs_statfs( | |||
1083 | { | 1083 | { |
1084 | struct xfs_mount *mp = XFS_M(dentry->d_sb); | 1084 | struct xfs_mount *mp = XFS_M(dentry->d_sb); |
1085 | xfs_sb_t *sbp = &mp->m_sb; | 1085 | xfs_sb_t *sbp = &mp->m_sb; |
1086 | struct xfs_inode *ip = XFS_I(dentry->d_inode); | 1086 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); |
1087 | __uint64_t fakeinos, id; | 1087 | __uint64_t fakeinos, id; |
1088 | xfs_extlen_t lsize; | 1088 | xfs_extlen_t lsize; |
1089 | __int64_t ffree; | 1089 | __int64_t ffree; |
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index 69f6e475de97..c036815183cb 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c | |||
@@ -35,7 +35,7 @@ static int | |||
35 | xfs_xattr_get(struct dentry *dentry, const char *name, | 35 | xfs_xattr_get(struct dentry *dentry, const char *name, |
36 | void *value, size_t size, int xflags) | 36 | void *value, size_t size, int xflags) |
37 | { | 37 | { |
38 | struct xfs_inode *ip = XFS_I(dentry->d_inode); | 38 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); |
39 | int error, asize = size; | 39 | int error, asize = size; |
40 | 40 | ||
41 | if (strcmp(name, "") == 0) | 41 | if (strcmp(name, "") == 0) |
@@ -57,7 +57,7 @@ static int | |||
57 | xfs_xattr_set(struct dentry *dentry, const char *name, const void *value, | 57 | xfs_xattr_set(struct dentry *dentry, const char *name, const void *value, |
58 | size_t size, int flags, int xflags) | 58 | size_t size, int flags, int xflags) |
59 | { | 59 | { |
60 | struct xfs_inode *ip = XFS_I(dentry->d_inode); | 60 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); |
61 | 61 | ||
62 | if (strcmp(name, "") == 0) | 62 | if (strcmp(name, "") == 0) |
63 | return -EINVAL; | 63 | return -EINVAL; |
@@ -197,7 +197,7 @@ xfs_vn_listxattr(struct dentry *dentry, char *data, size_t size) | |||
197 | { | 197 | { |
198 | struct xfs_attr_list_context context; | 198 | struct xfs_attr_list_context context; |
199 | struct attrlist_cursor_kern cursor = { 0 }; | 199 | struct attrlist_cursor_kern cursor = { 0 }; |
200 | struct inode *inode = dentry->d_inode; | 200 | struct inode *inode = d_inode(dentry); |
201 | int error; | 201 | int error; |
202 | 202 | ||
203 | /* | 203 | /* |