We actually want to retain i_sem for directory operations anyway (ie the
rw-semaphore would be an addition, not a replacement), so the easiest
transition would probably be to move the i_sem thing into the filesystems
when the rwsem thing is done (the same way the BKL removal worked), and
then let the filesystems make their own decisions on when they need it
(and the decision might well be to take it in the "create = 1" case, which
is likely to be fairly rare for non-extending writes)
The other alternative is to move this _all_ into the filesystem entirely,
and not have "generic_file_write()" take any lock at all. Let the
filesystem first take whatever lock it thinks it needs, and then call
"generic_file_write()". Filesystems migh choose to just get i_sem
unconditionally both for extending and non-extending writes.
That would mean that the filesystems would have to always wrap their use
of "generic_file_write()", but a number of them do so anyway because they
want to do some other book-keeping. I dunno.
Linus
-
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/