]> git.karo-electronics.de Git - mv-sheeva.git/commit
cifs: fix flags handling in cifs_posix_open
authorJeff Layton <jlayton@redhat.com>
Fri, 15 Oct 2010 19:33:56 +0000 (15:33 -0400)
committerSteve French <sfrench@us.ibm.com>
Mon, 18 Oct 2010 00:34:29 +0000 (00:34 +0000)
commit608712fe8609492a8670638ea86b97fafe49ebba
treeb175e2ac5e71ab8d6541a82d496d5dc6cc812acf
parent2f4f26fcf393ef4a44abe10e79c1966e64e86055
cifs: fix flags handling in cifs_posix_open

The way flags are passed and converted for cifs_posix_open is rather
non-sensical. Some callers call cifs_posix_convert_flags on the flags
before they pass them to cifs_posix_open, whereas some don't. Two flag
conversion steps is just confusing though.

Change the function instead to clearly expect input in f_flags format,
and fix the callers to pass that in. Then, have cifs_posix_open call
cifs_convert_posix_flags to do the conversion. Move cifs_posix_open to
file.c as well so we can keep cifs_convert_posix_flags as a static
function.

Fix it also to not ignore O_CREAT, O_EXCL and O_TRUNC, and instead have
cifs_reopen_file mask those bits off before calling cifs_posix_open.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsproto.h
fs/cifs/dir.c
fs/cifs/file.c