diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 22:09:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 22:09:16 -0400 |
commit | 73a0e405dce7d720808536b708f7c738b413b1a2 (patch) | |
tree | 60cc93e993e89b0c83a549bd65647879ce37d9cc | |
parent | 03529d9f66b7995c67ddceb8f83258df3c9915da (diff) | |
parent | 5493a0fcba8a94baa5c1d80aca21d6ae4b3b573e (diff) |
Merge git://oss.sgi.com:8090/nathans/xfs-2.6
* git://oss.sgi.com:8090/nathans/xfs-2.6:
[XFS] Fixup whitespace damage in log_write, remove final warning.
[XFS] Rework code snippets slightly to remove remaining recent-gcc
[XFS] Fix realtime subvolume expansion, a porting bug b0rked it. Coverity
[XFS] Remove a race condition where a linked inode could BUG_ON in
[XFS] Remove redundant directory checks from inode link operation.
[XFS] Remove a couple of no-longer-used macros.
[XFS] Reduce size of xfs_trans_t structure. * remove ->t_forw, ->t_back --
[XFS] remove unused behaviour lock - shrink XFS vnode as a side effect.
[XFS] * There is trivial "inode => vnode => inode" conversion, but only
[XFS] link(2) on directory is banned in VFS.
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 9 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_linux.h | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_behavior.h | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_rtalloc.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_trans.h | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 11 |
11 files changed, 21 insertions, 25 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 12810baeb5d4..d9180020de63 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -419,16 +419,15 @@ xfs_vn_link( | |||
419 | int error; | 419 | int error; |
420 | 420 | ||
421 | ip = old_dentry->d_inode; /* inode being linked to */ | 421 | ip = old_dentry->d_inode; /* inode being linked to */ |
422 | if (S_ISDIR(ip->i_mode)) | ||
423 | return -EPERM; | ||
424 | |||
425 | tdvp = vn_from_inode(dir); | 422 | tdvp = vn_from_inode(dir); |
426 | vp = vn_from_inode(ip); | 423 | vp = vn_from_inode(ip); |
427 | 424 | ||
425 | VN_HOLD(vp); | ||
428 | error = bhv_vop_link(tdvp, vp, dentry, NULL); | 426 | error = bhv_vop_link(tdvp, vp, dentry, NULL); |
429 | if (likely(!error)) { | 427 | if (unlikely(error)) { |
428 | VN_RELE(vp); | ||
429 | } else { | ||
430 | VMODIFY(tdvp); | 430 | VMODIFY(tdvp); |
431 | VN_HOLD(vp); | ||
432 | xfs_validate_fields(ip, &vattr); | 431 | xfs_validate_fields(ip, &vattr); |
433 | d_instantiate(dentry, ip); | 432 | d_instantiate(dentry, ip); |
434 | } | 433 | } |
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index aa26ab906c88..028eb17ec2ed 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h | |||
@@ -140,9 +140,7 @@ BUFFER_FNS(PrivateStart, unwritten); | |||
140 | #define current_pid() (current->pid) | 140 | #define current_pid() (current->pid) |
141 | #define current_fsuid(cred) (current->fsuid) | 141 | #define current_fsuid(cred) (current->fsuid) |
142 | #define current_fsgid(cred) (current->fsgid) | 142 | #define current_fsgid(cred) (current->fsgid) |
143 | #define current_set_flags(f) (current->flags |= (f)) | ||
144 | #define current_test_flags(f) (current->flags & (f)) | 143 | #define current_test_flags(f) (current->flags & (f)) |
145 | #define current_clear_flags(f) (current->flags & ~(f)) | ||
146 | #define current_set_flags_nested(sp, f) \ | 144 | #define current_set_flags_nested(sp, f) \ |
147 | (*(sp) = current->flags, current->flags |= (f)) | 145 | (*(sp) = current->flags, current->flags |= (f)) |
148 | #define current_clear_flags_nested(sp, f) \ | 146 | #define current_clear_flags_nested(sp, f) \ |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 35c6a01963a7..c42b3221b20c 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -93,7 +93,7 @@ typedef enum { | |||
93 | */ | 93 | */ |
94 | static inline struct bhv_vnode *vn_from_inode(struct inode *inode) | 94 | static inline struct bhv_vnode *vn_from_inode(struct inode *inode) |
95 | { | 95 | { |
96 | return (bhv_vnode_t *)list_entry(inode, bhv_vnode_t, v_inode); | 96 | return container_of(inode, bhv_vnode_t, v_inode); |
97 | } | 97 | } |
98 | static inline struct inode *vn_to_inode(struct bhv_vnode *vnode) | 98 | static inline struct inode *vn_to_inode(struct bhv_vnode *vnode) |
99 | { | 99 | { |
diff --git a/fs/xfs/xfs_behavior.h b/fs/xfs/xfs_behavior.h index 1d8ff103201c..6e6e56fb352d 100644 --- a/fs/xfs/xfs_behavior.h +++ b/fs/xfs/xfs_behavior.h | |||
@@ -78,15 +78,12 @@ | |||
78 | * | 78 | * |
79 | */ | 79 | */ |
80 | 80 | ||
81 | struct bhv_head_lock; | ||
82 | |||
83 | /* | 81 | /* |
84 | * Behavior head. Head of the chain of behaviors. | 82 | * Behavior head. Head of the chain of behaviors. |
85 | * Contained within each virtualized object data structure. | 83 | * Contained within each virtualized object data structure. |
86 | */ | 84 | */ |
87 | typedef struct bhv_head { | 85 | typedef struct bhv_head { |
88 | struct bhv_desc *bh_first; /* first behavior in chain */ | 86 | struct bhv_desc *bh_first; /* first behavior in chain */ |
89 | struct bhv_head_lock *bh_lockp; /* pointer to lock info struct */ | ||
90 | } bhv_head_t; | 87 | } bhv_head_t; |
91 | 88 | ||
92 | /* | 89 | /* |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5fa0adb7e173..86c1bf0bba9e 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -1961,9 +1961,9 @@ xfs_iunlink_remove( | |||
1961 | xfs_agino_t agino; | 1961 | xfs_agino_t agino; |
1962 | xfs_agino_t next_agino; | 1962 | xfs_agino_t next_agino; |
1963 | xfs_buf_t *last_ibp; | 1963 | xfs_buf_t *last_ibp; |
1964 | xfs_dinode_t *last_dip; | 1964 | xfs_dinode_t *last_dip = NULL; |
1965 | short bucket_index; | 1965 | short bucket_index; |
1966 | int offset, last_offset; | 1966 | int offset, last_offset = 0; |
1967 | int error; | 1967 | int error; |
1968 | int agi_ok; | 1968 | int agi_ok; |
1969 | 1969 | ||
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index d8f5d4cbe8b7..e730328636c3 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1740,10 +1740,10 @@ xlog_write(xfs_mount_t * mp, | |||
1740 | xlog_in_core_t **commit_iclog, | 1740 | xlog_in_core_t **commit_iclog, |
1741 | uint flags) | 1741 | uint flags) |
1742 | { | 1742 | { |
1743 | xlog_t *log = mp->m_log; | 1743 | xlog_t *log = mp->m_log; |
1744 | xlog_ticket_t *ticket = (xlog_ticket_t *)tic; | 1744 | xlog_ticket_t *ticket = (xlog_ticket_t *)tic; |
1745 | xlog_in_core_t *iclog = NULL; /* ptr to current in-core log */ | ||
1745 | xlog_op_header_t *logop_head; /* ptr to log operation header */ | 1746 | xlog_op_header_t *logop_head; /* ptr to log operation header */ |
1746 | xlog_in_core_t *iclog; /* ptr to current in-core log */ | ||
1747 | __psint_t ptr; /* copy address into data region */ | 1747 | __psint_t ptr; /* copy address into data region */ |
1748 | int len; /* # xlog_write() bytes 2 still copy */ | 1748 | int len; /* # xlog_write() bytes 2 still copy */ |
1749 | int index; /* region index currently copying */ | 1749 | int index; /* region index currently copying */ |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 55b4237c2153..3cb678e3a132 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -990,6 +990,8 @@ xlog_find_zeroed( | |||
990 | xfs_daddr_t num_scan_bblks; | 990 | xfs_daddr_t num_scan_bblks; |
991 | int error, log_bbnum = log->l_logBBsize; | 991 | int error, log_bbnum = log->l_logBBsize; |
992 | 992 | ||
993 | *blk_no = 0; | ||
994 | |||
993 | /* check totally zeroed log */ | 995 | /* check totally zeroed log */ |
994 | bp = xlog_get_bp(log, 1); | 996 | bp = xlog_get_bp(log, 1); |
995 | if (!bp) | 997 | if (!bp) |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index ed7579beb6b0..4be5c0b2d296 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -2028,7 +2028,7 @@ xfs_icsb_balance_counter( | |||
2028 | xfs_sb_field_t field, | 2028 | xfs_sb_field_t field, |
2029 | int flags) | 2029 | int flags) |
2030 | { | 2030 | { |
2031 | uint64_t count, resid = 0; | 2031 | uint64_t count, resid; |
2032 | int weight = num_online_cpus(); | 2032 | int weight = num_online_cpus(); |
2033 | int s; | 2033 | int s; |
2034 | 2034 | ||
@@ -2060,6 +2060,7 @@ xfs_icsb_balance_counter( | |||
2060 | break; | 2060 | break; |
2061 | default: | 2061 | default: |
2062 | BUG(); | 2062 | BUG(); |
2063 | count = resid = 0; /* quiet, gcc */ | ||
2063 | break; | 2064 | break; |
2064 | } | 2065 | } |
2065 | 2066 | ||
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 0c1e42b037ef..5a0b678956e0 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
@@ -1929,7 +1929,7 @@ xfs_growfs_rt( | |||
1929 | /* | 1929 | /* |
1930 | * Initial error checking. | 1930 | * Initial error checking. |
1931 | */ | 1931 | */ |
1932 | if (mp->m_rtdev_targp || mp->m_rbmip == NULL || | 1932 | if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL || |
1933 | (nrblocks = in->newblocks) <= sbp->sb_rblocks || | 1933 | (nrblocks = in->newblocks) <= sbp->sb_rblocks || |
1934 | (sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize))) | 1934 | (sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize))) |
1935 | return XFS_ERROR(EINVAL); | 1935 | return XFS_ERROR(EINVAL); |
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index cb65c3a603f5..9dc88b380608 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h | |||
@@ -338,8 +338,6 @@ typedef void (*xfs_trans_callback_t)(struct xfs_trans *, void *); | |||
338 | typedef struct xfs_trans { | 338 | typedef struct xfs_trans { |
339 | unsigned int t_magic; /* magic number */ | 339 | unsigned int t_magic; /* magic number */ |
340 | xfs_log_callback_t t_logcb; /* log callback struct */ | 340 | xfs_log_callback_t t_logcb; /* log callback struct */ |
341 | struct xfs_trans *t_forw; /* async list pointers */ | ||
342 | struct xfs_trans *t_back; /* async list pointers */ | ||
343 | unsigned int t_type; /* transaction type */ | 341 | unsigned int t_type; /* transaction type */ |
344 | unsigned int t_log_res; /* amt of log space resvd */ | 342 | unsigned int t_log_res; /* amt of log space resvd */ |
345 | unsigned int t_log_count; /* count for perm log res */ | 343 | unsigned int t_log_count; /* count for perm log res */ |
@@ -364,9 +362,11 @@ typedef struct xfs_trans { | |||
364 | long t_res_fdblocks_delta; /* on-disk only chg */ | 362 | long t_res_fdblocks_delta; /* on-disk only chg */ |
365 | long t_frextents_delta;/* superblock freextents chg*/ | 363 | long t_frextents_delta;/* superblock freextents chg*/ |
366 | long t_res_frextents_delta; /* on-disk only chg */ | 364 | long t_res_frextents_delta; /* on-disk only chg */ |
365 | #ifdef DEBUG | ||
367 | long t_ag_freeblks_delta; /* debugging counter */ | 366 | long t_ag_freeblks_delta; /* debugging counter */ |
368 | long t_ag_flist_delta; /* debugging counter */ | 367 | long t_ag_flist_delta; /* debugging counter */ |
369 | long t_ag_btree_delta; /* debugging counter */ | 368 | long t_ag_btree_delta; /* debugging counter */ |
369 | #endif | ||
370 | long t_dblocks_delta;/* superblock dblocks change */ | 370 | long t_dblocks_delta;/* superblock dblocks change */ |
371 | long t_agcount_delta;/* superblock agcount change */ | 371 | long t_agcount_delta;/* superblock agcount change */ |
372 | long t_imaxpct_delta;/* superblock imaxpct change */ | 372 | long t_imaxpct_delta;/* superblock imaxpct change */ |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 00a6b7dc24a0..23cfa5837728 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -2603,8 +2603,7 @@ xfs_link( | |||
2603 | vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); | 2603 | vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); |
2604 | 2604 | ||
2605 | target_namelen = VNAMELEN(dentry); | 2605 | target_namelen = VNAMELEN(dentry); |
2606 | if (VN_ISDIR(src_vp)) | 2606 | ASSERT(!VN_ISDIR(src_vp)); |
2607 | return XFS_ERROR(EPERM); | ||
2608 | 2607 | ||
2609 | sip = xfs_vtoi(src_vp); | 2608 | sip = xfs_vtoi(src_vp); |
2610 | tdp = XFS_BHVTOI(target_dir_bdp); | 2609 | tdp = XFS_BHVTOI(target_dir_bdp); |
@@ -2699,9 +2698,8 @@ xfs_link( | |||
2699 | xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); | 2698 | xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); |
2700 | 2699 | ||
2701 | error = xfs_bumplink(tp, sip); | 2700 | error = xfs_bumplink(tp, sip); |
2702 | if (error) { | 2701 | if (error) |
2703 | goto abort_return; | 2702 | goto abort_return; |
2704 | } | ||
2705 | 2703 | ||
2706 | /* | 2704 | /* |
2707 | * If this is a synchronous mount, make sure that the | 2705 | * If this is a synchronous mount, make sure that the |
@@ -2719,9 +2717,8 @@ xfs_link( | |||
2719 | } | 2717 | } |
2720 | 2718 | ||
2721 | error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL); | 2719 | error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL); |
2722 | if (error) { | 2720 | if (error) |
2723 | goto std_return; | 2721 | goto std_return; |
2724 | } | ||
2725 | 2722 | ||
2726 | /* Fall through to std_return with error = 0. */ | 2723 | /* Fall through to std_return with error = 0. */ |
2727 | std_return: | 2724 | std_return: |
@@ -2742,6 +2739,8 @@ std_return: | |||
2742 | xfs_trans_cancel(tp, cancel_flags); | 2739 | xfs_trans_cancel(tp, cancel_flags); |
2743 | goto std_return; | 2740 | goto std_return; |
2744 | } | 2741 | } |
2742 | |||
2743 | |||
2745 | /* | 2744 | /* |
2746 | * xfs_mkdir | 2745 | * xfs_mkdir |
2747 | * | 2746 | * |