make exec_permission(dir) really equivalent to inode_permission(dir, MAY_EXEC)

capability overrides apply only to the default case; if fs has ->permission()
that does _not_ call generic_permission(), we have no business doing them.
Moreover, if it has ->permission() that does call generic_permission(), we
have no need to recheck capabilities.

Besides, the capability overrides should apply only if we got EACCES from
acl_permission_check(); any other value (-EIO, etc.) should be returned
to caller, capabilities or not capabilities.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
switch path_init() to exec_permission()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
kill file_permission() completely

convert the last remaining caller to inode_permission()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
move exec_permission() up to the rest of permission-related functions

... and convert the comment before it into linuxdoc form.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
lockless get_write_access/deny_write_access

new helpers: atomic_inc_unless_negative()/atomic_dec_unless_positive()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
kill check_acl callback of generic_permission()

its value depends only on inode and does not change; we might as
well store it in ->i_op->check_acl and be done with that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
->permission() sanitizing: MAY_NOT_BLOCK

Duplicate the flags argument into mask bitmap.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dan Trifan <jimsth@gmail.com>