login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
September
»
20
Re: [PATCH] Consolidate sleeping routines in file locking code
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
J. Bruce Fields <bfields@...>
To: Pavel Emelyanov <xemul@...>
Cc: Andrew Morton <akpm@...>, Linux Kernel Mailing List <linux-kernel@...>, <devel@...>
Subject:
Re: [PATCH] Consolidate sleeping routines in file locking code
Date: Thursday, September 20, 2007 - 4:39 pm
On Thu, Sep 20, 2007 at 01:09:51PM +0400, Pavel Emelyanov wrote:
quoted text
> J. Bruce Fields wrote: > > On Tue, Sep 18, 2007 at 05:41:08PM +0400, Pavel Emelyanov wrote: > >> This is the next step in fs/locks.c cleanup before turning > >> it into using the struct pid *. > >> > >> This time I found, that there are some places that do a > >> similar thing - they try to apply a lock on a file and go > >> to sleep on error till the blocker exits. > >> > >> All these places can be easily consolidated, saving 28 > >> lines of code and more than 600 bytes from the .text, > >> but there is one minor note. > > > > I'm not opposed to consolidating this code, but would it be possible to > > do so in a more straightforward way, without passing in a callback > > function? E.g. a single __posix_lock_file_wait that just took an inode > > instead of a filp and called __posix_lock_file() could be called from > > both posix_lock_file_wait() and locks_mandatory_locked, right? > > Well, the locks_mandatory_area() has to check for inode mode change > in my lock callback, the fcntl_setlk() has to call the vfs_lock_file, > and flock_lock_file_wait() has to call the flock_lock_file, so > I don't see the ways of having one routine to lock the file. > > If you don't mind, I'd port the patch with this approach (with the > "trylock" callback) on the latest Andrew's tree.
OK.
quoted text
> >> The locks_mandatory_area() code becomes a bit different > >> after this patch - it no longer checks for the inode's > >> permissions change. Nevertheless, this check is useless > >> without my another patch that wakes the waiter up in the > >> notify_change(), which is not considered to be useful for > >> now. > > > > OK. Might be better to submit this as a separate patch, though. > > This one is already accepted, but I have just noticed that > the check for __mandatory_lock() in wait_event_interruptible > is ambiguous :(
I'm not sure what you mean here.... Do you have a fix? --b. -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] Consolidate sleeping routines in file locking code
, Pavel Emelyanov
, (Tue Sep 18, 9:41 am)
Re: [PATCH] Consolidate sleeping routines in file locking code
, J. Bruce Fields
, (Wed Sep 19, 2:37 pm)
Re: [PATCH] Consolidate sleeping routines in file locking code
, Pavel Emelyanov
, (Thu Sep 20, 5:09 am)
Re: [PATCH] Consolidate sleeping routines in file locking code
, J. Bruce Fields
, (Thu Sep 20, 4:39 pm)
Re: [PATCH] Consolidate sleeping routines in file locking code
, Pavel Emelyanov
, (Fri Sep 21, 2:57 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Michal Piotrowski
Re: [BUG] fs/xfs/xfs_bmap_btree.c:2312: error: 'b' undeclared (first use in this f...
debian developer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Paul Jackson
[PATCH 0/5 v2] x86 boot: various E820 & EFI related fixes - what changed in v2
git
:
openbsd-misc
:
linux-netdev
:
Paweł Staszewski
Re: rib_trie / Fix inflate_threshold_root. Now=15 size=11 bits
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Jarek Poplawski
Re: Data corruption issue with splice() on 2.6.27.10
Colocation donated by:
Who's online
There are currently
1 user
and
838 guests
online.
Online users
zeekec
Syndicate