mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 01:24:12 +08:00
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.
This commit is contained in:
commit
73a0e405dc
@ -419,16 +419,15 @@ xfs_vn_link(
|
|||||||
int error;
|
int error;
|
||||||
|
|
||||||
ip = old_dentry->d_inode; /* inode being linked to */
|
ip = old_dentry->d_inode; /* inode being linked to */
|
||||||
if (S_ISDIR(ip->i_mode))
|
|
||||||
return -EPERM;
|
|
||||||
|
|
||||||
tdvp = vn_from_inode(dir);
|
tdvp = vn_from_inode(dir);
|
||||||
vp = vn_from_inode(ip);
|
vp = vn_from_inode(ip);
|
||||||
|
|
||||||
|
VN_HOLD(vp);
|
||||||
error = bhv_vop_link(tdvp, vp, dentry, NULL);
|
error = bhv_vop_link(tdvp, vp, dentry, NULL);
|
||||||
if (likely(!error)) {
|
if (unlikely(error)) {
|
||||||
|
VN_RELE(vp);
|
||||||
|
} else {
|
||||||
VMODIFY(tdvp);
|
VMODIFY(tdvp);
|
||||||
VN_HOLD(vp);
|
|
||||||
xfs_validate_fields(ip, &vattr);
|
xfs_validate_fields(ip, &vattr);
|
||||||
d_instantiate(dentry, ip);
|
d_instantiate(dentry, ip);
|
||||||
}
|
}
|
||||||
|
@ -140,9 +140,7 @@ BUFFER_FNS(PrivateStart, unwritten);
|
|||||||
#define current_pid() (current->pid)
|
#define current_pid() (current->pid)
|
||||||
#define current_fsuid(cred) (current->fsuid)
|
#define current_fsuid(cred) (current->fsuid)
|
||||||
#define current_fsgid(cred) (current->fsgid)
|
#define current_fsgid(cred) (current->fsgid)
|
||||||
#define current_set_flags(f) (current->flags |= (f))
|
|
||||||
#define current_test_flags(f) (current->flags & (f))
|
#define current_test_flags(f) (current->flags & (f))
|
||||||
#define current_clear_flags(f) (current->flags & ~(f))
|
|
||||||
#define current_set_flags_nested(sp, f) \
|
#define current_set_flags_nested(sp, f) \
|
||||||
(*(sp) = current->flags, current->flags |= (f))
|
(*(sp) = current->flags, current->flags |= (f))
|
||||||
#define current_clear_flags_nested(sp, f) \
|
#define current_clear_flags_nested(sp, f) \
|
||||||
|
@ -93,7 +93,7 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
static inline struct bhv_vnode *vn_from_inode(struct inode *inode)
|
static inline struct bhv_vnode *vn_from_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
return (bhv_vnode_t *)list_entry(inode, bhv_vnode_t, v_inode);
|
return container_of(inode, bhv_vnode_t, v_inode);
|
||||||
}
|
}
|
||||||
static inline struct inode *vn_to_inode(struct bhv_vnode *vnode)
|
static inline struct inode *vn_to_inode(struct bhv_vnode *vnode)
|
||||||
{
|
{
|
||||||
|
@ -78,15 +78,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct bhv_head_lock;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Behavior head. Head of the chain of behaviors.
|
* Behavior head. Head of the chain of behaviors.
|
||||||
* Contained within each virtualized object data structure.
|
* Contained within each virtualized object data structure.
|
||||||
*/
|
*/
|
||||||
typedef struct bhv_head {
|
typedef struct bhv_head {
|
||||||
struct bhv_desc *bh_first; /* first behavior in chain */
|
struct bhv_desc *bh_first; /* first behavior in chain */
|
||||||
struct bhv_head_lock *bh_lockp; /* pointer to lock info struct */
|
|
||||||
} bhv_head_t;
|
} bhv_head_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1961,9 +1961,9 @@ xfs_iunlink_remove(
|
|||||||
xfs_agino_t agino;
|
xfs_agino_t agino;
|
||||||
xfs_agino_t next_agino;
|
xfs_agino_t next_agino;
|
||||||
xfs_buf_t *last_ibp;
|
xfs_buf_t *last_ibp;
|
||||||
xfs_dinode_t *last_dip;
|
xfs_dinode_t *last_dip = NULL;
|
||||||
short bucket_index;
|
short bucket_index;
|
||||||
int offset, last_offset;
|
int offset, last_offset = 0;
|
||||||
int error;
|
int error;
|
||||||
int agi_ok;
|
int agi_ok;
|
||||||
|
|
||||||
|
@ -1740,10 +1740,10 @@ xlog_write(xfs_mount_t * mp,
|
|||||||
xlog_in_core_t **commit_iclog,
|
xlog_in_core_t **commit_iclog,
|
||||||
uint flags)
|
uint flags)
|
||||||
{
|
{
|
||||||
xlog_t *log = mp->m_log;
|
xlog_t *log = mp->m_log;
|
||||||
xlog_ticket_t *ticket = (xlog_ticket_t *)tic;
|
xlog_ticket_t *ticket = (xlog_ticket_t *)tic;
|
||||||
|
xlog_in_core_t *iclog = NULL; /* ptr to current in-core log */
|
||||||
xlog_op_header_t *logop_head; /* ptr to log operation header */
|
xlog_op_header_t *logop_head; /* ptr to log operation header */
|
||||||
xlog_in_core_t *iclog; /* ptr to current in-core log */
|
|
||||||
__psint_t ptr; /* copy address into data region */
|
__psint_t ptr; /* copy address into data region */
|
||||||
int len; /* # xlog_write() bytes 2 still copy */
|
int len; /* # xlog_write() bytes 2 still copy */
|
||||||
int index; /* region index currently copying */
|
int index; /* region index currently copying */
|
||||||
|
@ -990,6 +990,8 @@ xlog_find_zeroed(
|
|||||||
xfs_daddr_t num_scan_bblks;
|
xfs_daddr_t num_scan_bblks;
|
||||||
int error, log_bbnum = log->l_logBBsize;
|
int error, log_bbnum = log->l_logBBsize;
|
||||||
|
|
||||||
|
*blk_no = 0;
|
||||||
|
|
||||||
/* check totally zeroed log */
|
/* check totally zeroed log */
|
||||||
bp = xlog_get_bp(log, 1);
|
bp = xlog_get_bp(log, 1);
|
||||||
if (!bp)
|
if (!bp)
|
||||||
|
@ -2028,7 +2028,7 @@ xfs_icsb_balance_counter(
|
|||||||
xfs_sb_field_t field,
|
xfs_sb_field_t field,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
uint64_t count, resid = 0;
|
uint64_t count, resid;
|
||||||
int weight = num_online_cpus();
|
int weight = num_online_cpus();
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
@ -2060,6 +2060,7 @@ xfs_icsb_balance_counter(
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BUG();
|
BUG();
|
||||||
|
count = resid = 0; /* quiet, gcc */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1929,7 +1929,7 @@ xfs_growfs_rt(
|
|||||||
/*
|
/*
|
||||||
* Initial error checking.
|
* Initial error checking.
|
||||||
*/
|
*/
|
||||||
if (mp->m_rtdev_targp || mp->m_rbmip == NULL ||
|
if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL ||
|
||||||
(nrblocks = in->newblocks) <= sbp->sb_rblocks ||
|
(nrblocks = in->newblocks) <= sbp->sb_rblocks ||
|
||||||
(sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize)))
|
(sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize)))
|
||||||
return XFS_ERROR(EINVAL);
|
return XFS_ERROR(EINVAL);
|
||||||
|
@ -338,8 +338,6 @@ typedef void (*xfs_trans_callback_t)(struct xfs_trans *, void *);
|
|||||||
typedef struct xfs_trans {
|
typedef struct xfs_trans {
|
||||||
unsigned int t_magic; /* magic number */
|
unsigned int t_magic; /* magic number */
|
||||||
xfs_log_callback_t t_logcb; /* log callback struct */
|
xfs_log_callback_t t_logcb; /* log callback struct */
|
||||||
struct xfs_trans *t_forw; /* async list pointers */
|
|
||||||
struct xfs_trans *t_back; /* async list pointers */
|
|
||||||
unsigned int t_type; /* transaction type */
|
unsigned int t_type; /* transaction type */
|
||||||
unsigned int t_log_res; /* amt of log space resvd */
|
unsigned int t_log_res; /* amt of log space resvd */
|
||||||
unsigned int t_log_count; /* count for perm log res */
|
unsigned int t_log_count; /* count for perm log res */
|
||||||
@ -364,9 +362,11 @@ typedef struct xfs_trans {
|
|||||||
long t_res_fdblocks_delta; /* on-disk only chg */
|
long t_res_fdblocks_delta; /* on-disk only chg */
|
||||||
long t_frextents_delta;/* superblock freextents chg*/
|
long t_frextents_delta;/* superblock freextents chg*/
|
||||||
long t_res_frextents_delta; /* on-disk only chg */
|
long t_res_frextents_delta; /* on-disk only chg */
|
||||||
|
#ifdef DEBUG
|
||||||
long t_ag_freeblks_delta; /* debugging counter */
|
long t_ag_freeblks_delta; /* debugging counter */
|
||||||
long t_ag_flist_delta; /* debugging counter */
|
long t_ag_flist_delta; /* debugging counter */
|
||||||
long t_ag_btree_delta; /* debugging counter */
|
long t_ag_btree_delta; /* debugging counter */
|
||||||
|
#endif
|
||||||
long t_dblocks_delta;/* superblock dblocks change */
|
long t_dblocks_delta;/* superblock dblocks change */
|
||||||
long t_agcount_delta;/* superblock agcount change */
|
long t_agcount_delta;/* superblock agcount change */
|
||||||
long t_imaxpct_delta;/* superblock imaxpct change */
|
long t_imaxpct_delta;/* superblock imaxpct change */
|
||||||
|
@ -2603,8 +2603,7 @@ xfs_link(
|
|||||||
vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address);
|
vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address);
|
||||||
|
|
||||||
target_namelen = VNAMELEN(dentry);
|
target_namelen = VNAMELEN(dentry);
|
||||||
if (VN_ISDIR(src_vp))
|
ASSERT(!VN_ISDIR(src_vp));
|
||||||
return XFS_ERROR(EPERM);
|
|
||||||
|
|
||||||
sip = xfs_vtoi(src_vp);
|
sip = xfs_vtoi(src_vp);
|
||||||
tdp = XFS_BHVTOI(target_dir_bdp);
|
tdp = XFS_BHVTOI(target_dir_bdp);
|
||||||
@ -2699,9 +2698,8 @@ xfs_link(
|
|||||||
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
|
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
|
||||||
|
|
||||||
error = xfs_bumplink(tp, sip);
|
error = xfs_bumplink(tp, sip);
|
||||||
if (error) {
|
if (error)
|
||||||
goto abort_return;
|
goto abort_return;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is a synchronous mount, make sure that the
|
* If this is a synchronous mount, make sure that the
|
||||||
@ -2719,9 +2717,8 @@ xfs_link(
|
|||||||
}
|
}
|
||||||
|
|
||||||
error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
|
error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
|
||||||
if (error) {
|
if (error)
|
||||||
goto std_return;
|
goto std_return;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fall through to std_return with error = 0. */
|
/* Fall through to std_return with error = 0. */
|
||||||
std_return:
|
std_return:
|
||||||
@ -2742,6 +2739,8 @@ std_return:
|
|||||||
xfs_trans_cancel(tp, cancel_flags);
|
xfs_trans_cancel(tp, cancel_flags);
|
||||||
goto std_return;
|
goto std_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xfs_mkdir
|
* xfs_mkdir
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user