GIT a1197e7014c9966077d3abea0dfcf2187c6b3d26 git://oss.sgi.com:8090/xfs-2.6.git commit a1197e7014c9966077d3abea0dfcf2187c6b3d26 Author: Alexey Dobriyan Date: Thu Jun 22 19:40:59 2006 +1000 [XFS] Reduce size of xfs_trans_t structure. * remove ->t_forw, ->t_back -- unused * ->t_ag_freeblks_delta, ->t_ag_flist_delta, ->t_ag_btree_delta are debugging aid -- wrap them in everyone's favourite way. As a result, cut "xfs_trans" slab object size from 592 to 572 bytes here. SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26319a Signed-off-by: Alexey Dobriyan Signed-off-by: Nathan Scott commit 02b7556327cfb578f03c84d28067a4bd268d6f46 Author: Alexey Dobriyan Date: Thu Jun 22 13:07:51 2006 +1000 [XFS] remove unused behaviour lock - shrink XFS vnode as a side effect. SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26299a Signed-off-by: Alexey Dobriyan Signed-off-by: Nathan Scott commit 346bf639f2e5107d69e681f71d48104d9842b28a Author: Alexey Dobriyan Date: Thu Jun 22 13:07:42 2006 +1000 [XFS] * There is trivial "inode => vnode => inode" conversion, but only flags and mode of final inode are looked at. Pass original inode instead. * Two occurences of bhv_vnode_t go out. SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26298a Signed-off-by: Alexey Dobriyan Signed-off-by: Nathan Scott commit 0d2ea5586c449a5076c279fcf557f0ec26a4391b Author: Alexey Dobriyan Date: Thu Jun 22 13:07:26 2006 +1000 [XFS] link(2) on directory is banned in VFS. SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26293a Signed-off-by: Alexey Dobriyan Signed-off-by: Nathan Scott --- diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 35c6a01..c42b322 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h @@ -93,7 +93,7 @@ #define vn_bhv_lookup_unlocked(bhp,ops) */ 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) { diff --git a/fs/xfs/xfs_behavior.h b/fs/xfs/xfs_behavior.h index 1d8ff10..6e6e56f 100644 --- a/fs/xfs/xfs_behavior.h +++ b/fs/xfs/xfs_behavior.h @@ -78,15 +78,12 @@ #define __XFS_BEHAVIOR_H__ * */ -struct bhv_head_lock; - /* * Behavior head. Head of the chain of behaviors. * Contained within each virtualized object data structure. */ typedef struct bhv_head { struct bhv_desc *bh_first; /* first behavior in chain */ - struct bhv_head_lock *bh_lockp; /* pointer to lock info struct */ } bhv_head_t; /* diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index cb65c3a..9dc88b3 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -338,8 +338,6 @@ typedef void (*xfs_trans_callback_t)(str typedef struct xfs_trans { unsigned int t_magic; /* magic number */ 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_log_res; /* amt of log space resvd */ 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_frextents_delta;/* superblock freextents chg*/ long t_res_frextents_delta; /* on-disk only chg */ +#ifdef DEBUG long t_ag_freeblks_delta; /* debugging counter */ long t_ag_flist_delta; /* debugging counter */ long t_ag_btree_delta; /* debugging counter */ +#endif long t_dblocks_delta;/* superblock dblocks change */ long t_agcount_delta;/* superblock agcount change */ long t_imaxpct_delta;/* superblock imaxpct change */ diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 00a6b7d..23cfa58 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2603,8 +2603,7 @@ xfs_link( vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); target_namelen = VNAMELEN(dentry); - if (VN_ISDIR(src_vp)) - return XFS_ERROR(EPERM); + ASSERT(!VN_ISDIR(src_vp)); sip = xfs_vtoi(src_vp); tdp = XFS_BHVTOI(target_dir_bdp); @@ -2699,9 +2698,8 @@ xfs_link( xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); error = xfs_bumplink(tp, sip); - if (error) { + if (error) goto abort_return; - } /* * 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); - if (error) { + if (error) goto std_return; - } /* Fall through to std_return with error = 0. */ std_return: @@ -2742,6 +2739,8 @@ std_return: xfs_trans_cancel(tp, cancel_flags); goto std_return; } + + /* * xfs_mkdir *