Messages in this thread | | | Date | Wed, 2 Jan 2008 21:33:57 +0100 | From | Christoph Hellwig <> | Subject | Re: getting rid of filp search in fs_may_remount_ro() |
| |
On Mon, Dec 31, 2007 at 02:54:48PM -0800, Dave Hansen wrote: > Here's one blatantly untested idea I have. The idea is to keep track if > anyone might be writing to a mnt. We keep track on a flag in the mnt. > When we set the flag, we increment a counter in the sb and decrement > when the flag is cleared. > > We can't simply look at mnt->__mnt_writers because there might be > "checked-out" writers in the mnt_writers[] array. We also have to keep > new writers from coming in while we do this, so we use the spinlocks in > the mnt_writers[] array for exclusion. This is a pretty heavyweight > lock, but it only gets used at rw->ro transitions.
This idea looks good to me, but if you're going to a final version please just inline fs_may_remount_ro into its only caller.
| |