diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-08-28 02:12:30 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 02:54:29 -0400 |
commit | 993386c19afa53fa54d00c7721e56ba820b3400d (patch) | |
tree | 1715fdeb9cc5ea99466e179b54e84b168fd5e127 /fs/xfs/xfs_attr.c | |
parent | b93bd20cd59eb7ec172f95d08b100fea688d8bcf (diff) |
[XFS] decontaminate vnode operations from behavior details
All vnode ops now take struct xfs_inode pointers and the behaviour related
glue is split out into methods of it's own. This required fixing
xfs_create/mkdir/symlink to not mess with the inode pointer but rather use
a separate boolean for error handling. Thanks to Dave Chinner for that
fix.
SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29492a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_attr.c')
-rw-r--r-- | fs/xfs/xfs_attr.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 7ce44a7b88a2..1a10bffc7755 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -156,10 +156,14 @@ xfs_attr_fetch(xfs_inode_t *ip, const char *name, int namelen, | |||
156 | } | 156 | } |
157 | 157 | ||
158 | int | 158 | int |
159 | xfs_attr_get(bhv_desc_t *bdp, const char *name, char *value, int *valuelenp, | 159 | xfs_attr_get( |
160 | int flags, struct cred *cred) | 160 | xfs_inode_t *ip, |
161 | const char *name, | ||
162 | char *value, | ||
163 | int *valuelenp, | ||
164 | int flags, | ||
165 | cred_t *cred) | ||
161 | { | 166 | { |
162 | xfs_inode_t *ip = XFS_BHVTOI(bdp); | ||
163 | int error, namelen; | 167 | int error, namelen; |
164 | 168 | ||
165 | XFS_STATS_INC(xs_attr_get); | 169 | XFS_STATS_INC(xs_attr_get); |
@@ -417,10 +421,13 @@ out: | |||
417 | } | 421 | } |
418 | 422 | ||
419 | int | 423 | int |
420 | xfs_attr_set(bhv_desc_t *bdp, const char *name, char *value, int valuelen, int flags, | 424 | xfs_attr_set( |
421 | struct cred *cred) | 425 | xfs_inode_t *dp, |
426 | const char *name, | ||
427 | char *value, | ||
428 | int valuelen, | ||
429 | int flags) | ||
422 | { | 430 | { |
423 | xfs_inode_t *dp; | ||
424 | int namelen; | 431 | int namelen; |
425 | 432 | ||
426 | namelen = strlen(name); | 433 | namelen = strlen(name); |
@@ -429,7 +436,6 @@ xfs_attr_set(bhv_desc_t *bdp, const char *name, char *value, int valuelen, int f | |||
429 | 436 | ||
430 | XFS_STATS_INC(xs_attr_set); | 437 | XFS_STATS_INC(xs_attr_set); |
431 | 438 | ||
432 | dp = XFS_BHVTOI(bdp); | ||
433 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) | 439 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) |
434 | return (EIO); | 440 | return (EIO); |
435 | 441 | ||
@@ -563,10 +569,12 @@ out: | |||
563 | } | 569 | } |
564 | 570 | ||
565 | int | 571 | int |
566 | xfs_attr_remove(bhv_desc_t *bdp, const char *name, int flags, struct cred *cred) | 572 | xfs_attr_remove( |
573 | xfs_inode_t *dp, | ||
574 | const char *name, | ||
575 | int flags) | ||
567 | { | 576 | { |
568 | xfs_inode_t *dp; | 577 | int namelen; |
569 | int namelen; | ||
570 | 578 | ||
571 | namelen = strlen(name); | 579 | namelen = strlen(name); |
572 | if (namelen >= MAXNAMELEN) | 580 | if (namelen >= MAXNAMELEN) |
@@ -574,7 +582,6 @@ xfs_attr_remove(bhv_desc_t *bdp, const char *name, int flags, struct cred *cred) | |||
574 | 582 | ||
575 | XFS_STATS_INC(xs_attr_remove); | 583 | XFS_STATS_INC(xs_attr_remove); |
576 | 584 | ||
577 | dp = XFS_BHVTOI(bdp); | ||
578 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) | 585 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) |
579 | return (EIO); | 586 | return (EIO); |
580 | 587 | ||
@@ -702,11 +709,14 @@ xfs_attr_kern_list_sizes(xfs_attr_list_context_t *context, attrnames_t *namesp, | |||
702 | * success. | 709 | * success. |
703 | */ | 710 | */ |
704 | int | 711 | int |
705 | xfs_attr_list(bhv_desc_t *bdp, char *buffer, int bufsize, int flags, | 712 | xfs_attr_list( |
706 | attrlist_cursor_kern_t *cursor, struct cred *cred) | 713 | xfs_inode_t *dp, |
714 | char *buffer, | ||
715 | int bufsize, | ||
716 | int flags, | ||
717 | attrlist_cursor_kern_t *cursor) | ||
707 | { | 718 | { |
708 | xfs_attr_list_context_t context; | 719 | xfs_attr_list_context_t context; |
709 | xfs_inode_t *dp; | ||
710 | int error; | 720 | int error; |
711 | 721 | ||
712 | XFS_STATS_INC(xs_attr_list); | 722 | XFS_STATS_INC(xs_attr_list); |
@@ -731,7 +741,7 @@ xfs_attr_list(bhv_desc_t *bdp, char *buffer, int bufsize, int flags, | |||
731 | /* | 741 | /* |
732 | * Initialize the output buffer. | 742 | * Initialize the output buffer. |
733 | */ | 743 | */ |
734 | context.dp = dp = XFS_BHVTOI(bdp); | 744 | context.dp = dp; |
735 | context.cursor = cursor; | 745 | context.cursor = cursor; |
736 | context.count = 0; | 746 | context.count = 0; |
737 | context.dupcnt = 0; | 747 | context.dupcnt = 0; |