a few patches for 2.6.37
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 1/3 xfs: tell lockdep about parent iolock usage in filestreams
The filestreams code may take the iolock on the parent inode while holding it on a child. This is the only place in XFS where we take both the child and parent iolock, so just telling lockdep about it is enough. The lock flag required for that was already added as part of the ilock lockdep annotations and unused so far.
fs/xfs/xfs_filestream.c +7 -1
@@ -744,9 +744,15 @@ xfs_filestream_new_ag(* If the file's parent directory is known, take its iolock in exclusive * mode to prevent two sibling files from racing each other to migrate * themselves and their parent to different AGs. +* +* Note that we lock the parent directory iolock inside the child +* iolock here. That's fine as we never hold both parent and child +* iolock in any other place. This is different from the ilock, +* which requires locking of the child after the parent for namespace +* operations. */ if (pip) -xfs_ilock (pip,XFS_IOLOCK_EXCL ); +xfs_ilock (pip,XFS_IOLOCK_EXCL |XFS_IOLOCK_PARENT );/* * A new AG needs to be found for the file. If the file's parent
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/3 xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n
In reply to Christoph HellwigAndi Kleen reported that gcc-4.5 gives lots of warnings for him inside the XFS code. It turned out most of them are due to the quota stubs beeing macros, and gcc now complaining about macros evaluating to 0 that are not assigned to variables.
fs/xfs/xfs_quota.h +16 -4
@@ -346,8 +346,17 @@ xfs_qm_vop_dqalloc(struct xfs_inode *ip,#define xfs_trans_mod_dquot_byino (tp, ip, fields, delta)#define xfs_trans_apply_dquot_deltas (tp)#define xfs_trans_unreserve_and_mod_dquots (tp) -#define xfs_trans_reserve_quota_nblks (tp, ip, nblks, ninos, flags) (0) -#define xfs_trans_reserve_quota_bydquots (tp, mp, u, g, nb, ni, fl) (0) +static inline int xfs_trans_reserve_quota_nblks (struct xfs_trans *tp, +struct xfs_inode *ip,long nblks,long ninos,uint flags) +{ +return 0 ; +} +static inline int xfs_trans_reserve_quota_bydquots (struct xfs_trans *tp, +struct xfs_mount *mp,struct xfs_dquot *udqp, +struct xfs_dquot *gdqp,long nblks,long nions,uint flags) +{ +return 0 ; +}#define xfs_qm_vop_create_dqattach (tp, ip, u, g)#define xfs_qm_vop_rename_dqattach (it) (0)#define xfs_qm_vop_chown (tp, ip, old, new) (NULL)
@@ -357,11 +366,14 @@ xfs_qm_vop_dqalloc(struct xfs_inode *ip,#define xfs_qm_dqdetach (ip)#define xfs_qm_dqrele (d)#define xfs_qm_statvfs (ip, s) -#define xfs_qm_sync (mp, fl) (0) +static inline int xfs_qm_sync (struct xfs_mount *mp,int flags) +{ +return 0 ; +}#define xfs_qm_newmount (mp, a, b) (0)#define xfs_qm_mount_quotas (mp)#define xfs_qm_unmount (mp) -#define xfs_qm_unmount_quotas (mp) (0) +#define xfs_qm_unmount_quotas (mp)#endif /* CONFIG_XFS_QUOTA */ #define xfs_trans_unreserve_quota_nblks (tp, ip, nblks, ninos, flags) \
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n
Quoted 4 lines · Christoph Hellwig
Andi Kleen reported that gcc-4.5 gives lots of warnings for him inside the XFS code. It turned out most of them are due to the quota stubs beeing macros, and gcc now complaining about macros evaluating to 0 that are not assigned to variables.
Thanks. BTW I believe this was already fixed in my big warning patchkit from some time ago, unfortunately that didn't make it in :-/
A gcc 4.6 build is also still incredibly noisy.
-Andi
Signature · 6 lines
[email protected] -- Speaking for myself only. _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n
Quoted 11 lines · Andi Kleen
Quoted 4 lines · Christoph Hellwig
Andi Kleen reported that gcc-4.5 gives lots of warnings for him inside the XFS code. It turned out most of them are due to the quota stubs beeing macros, and gcc now complaining about macros evaluating to 0 that are not assigned to variables.
Thanks. BTW I believe this was already fixed in my big warning patchkit from some time ago, unfortunately that didn't make it in :-/
A gcc 4.6 build is also still incredibly noisy.
I'll tacked the dir warnings your reported next, and after that I'll look into more of the gcc 4.6 warnings. But that's 2.6.38 material, while this one is simple enough to still sneak it into 2.6.37.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/3 xfs: use hlist_add_fake
In reply to Christoph HellwigXFS does not need it's inodes to actuall be hashed in the VFS inode cache, but we require the inode to be marked hashed for the writeback code to work.
Insted of using insert_inode_hash, which requires a second inode_lock roundtrip after the partial merge of the inode scalability patches in 2.6.37-rc simply use the new hlist_add_fake helper to mark it hashed without requiring a lock or touching a global cache line.
fs/xfs/linux-2.6/xfs_iops.c +2 -1
@@ -762,7 +762,8 @@ xfs_setup_inode( inode->i_state =I_NEW ;inode_sb_list_add (inode); -insert_inode_hash (inode); +/* make the inode look hashed for the writeback code */ +hlist_add_fake (&inode->i_hash); inode->i_mode = ip->i_d.di_mode; inode->i_nlink = ip->i_d.di_nlink;
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs