* a few patches for 2.6.37
@ 2010-11-06 11:42 Christoph Hellwig
2010-11-06 11:42 ` [PATCH 1/3] xfs: tell lockdep about parent iolock usage in filestreams Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Christoph Hellwig @ 2010-11-06 11:42 UTC (permalink / raw)
To: xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/3] xfs: tell lockdep about parent iolock usage in filestreams 2010-11-06 11:42 a few patches for 2.6.37 Christoph Hellwig @ 2010-11-06 11:42 ` Christoph Hellwig 2010-11-06 11:42 ` [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n Christoph Hellwig 2010-11-06 11:43 ` [PATCH 3/3] xfs: use hlist_add_fake Christoph Hellwig 2 siblings, 0 replies; 6+ messages in thread From: Christoph Hellwig @ 2010-11-06 11:42 UTC (permalink / raw) To: xfs 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. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/xfs_filestream.c =================================================================== --- xfs.orig/fs/xfs/xfs_filestream.c 2010-11-02 14:28:57.888491016 -0400 +++ xfs/fs/xfs/xfs_filestream.c 2010-11-02 14:30:42.591824351 -0400 @@ -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 xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n 2010-11-06 11:42 a few patches for 2.6.37 Christoph Hellwig 2010-11-06 11:42 ` [PATCH 1/3] xfs: tell lockdep about parent iolock usage in filestreams Christoph Hellwig @ 2010-11-06 11:42 ` Christoph Hellwig 2010-11-06 17:51 ` Andi Kleen 2010-11-06 11:43 ` [PATCH 3/3] xfs: use hlist_add_fake Christoph Hellwig 2 siblings, 1 reply; 6+ messages in thread From: Christoph Hellwig @ 2010-11-06 11:42 UTC (permalink / raw) To: xfs 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. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/xfs_quota.h =================================================================== --- xfs.orig/fs/xfs/xfs_quota.h 2010-11-02 13:59:34.388491017 -0400 +++ xfs/fs/xfs/xfs_quota.h 2010-11-02 14:06:14.308491018 -0400 @@ -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 xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n 2010-11-06 11:42 ` [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n Christoph Hellwig @ 2010-11-06 17:51 ` Andi Kleen 2010-11-06 17:56 ` Christoph Hellwig 0 siblings, 1 reply; 6+ messages in thread From: Andi Kleen @ 2010-11-06 17:51 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs Christoph Hellwig <hch@infradead.org> writes: > 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 -- ak@linux.intel.com -- Speaking for myself only. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n 2010-11-06 17:51 ` Andi Kleen @ 2010-11-06 17:56 ` Christoph Hellwig 0 siblings, 0 replies; 6+ messages in thread From: Christoph Hellwig @ 2010-11-06 17:56 UTC (permalink / raw) To: Andi Kleen; +Cc: Christoph Hellwig, xfs On Sat, Nov 06, 2010 at 06:51:29PM +0100, Andi Kleen wrote: > Christoph Hellwig <hch@infradead.org> writes: > > > 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 xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] xfs: use hlist_add_fake 2010-11-06 11:42 a few patches for 2.6.37 Christoph Hellwig 2010-11-06 11:42 ` [PATCH 1/3] xfs: tell lockdep about parent iolock usage in filestreams Christoph Hellwig 2010-11-06 11:42 ` [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n Christoph Hellwig @ 2010-11-06 11:43 ` Christoph Hellwig 2 siblings, 0 replies; 6+ messages in thread From: Christoph Hellwig @ 2010-11-06 11:43 UTC (permalink / raw) To: xfs XFS 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. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: linux-2.6/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_iops.c 2010-11-05 19:17:18.511013308 +0100 +++ linux-2.6/fs/xfs/linux-2.6/xfs_iops.c 2010-11-05 19:23:31.772029658 +0100 @@ -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 xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-11-06 17:55 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-11-06 11:42 a few patches for 2.6.37 Christoph Hellwig 2010-11-06 11:42 ` [PATCH 1/3] xfs: tell lockdep about parent iolock usage in filestreams Christoph Hellwig 2010-11-06 11:42 ` [PATCH 2/3] xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n Christoph Hellwig 2010-11-06 17:51 ` Andi Kleen 2010-11-06 17:56 ` Christoph Hellwig 2010-11-06 11:43 ` [PATCH 3/3] xfs: use hlist_add_fake Christoph Hellwig
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox