hostfs: No need to box and later unbox the file mode
[firefly-linux-kernel-4.4.55.git] / fs / hostfs / hostfs_user.c
index 9765dab95cbdaefa4e53d8fdd51a72ffca4e6061..34ab81b21c9300bfd09c22a46869caad612d261d 100644 (file)
@@ -175,21 +175,10 @@ void close_dir(void *stream)
        closedir(stream);
 }
 
-int file_create(char *name, int ur, int uw, int ux, int gr,
-               int gw, int gx, int or, int ow, int ox)
+int file_create(char *name, int mode)
 {
-       int mode, fd;
-
-       mode = 0;
-       mode |= ur ? S_IRUSR : 0;
-       mode |= uw ? S_IWUSR : 0;
-       mode |= ux ? S_IXUSR : 0;
-       mode |= gr ? S_IRGRP : 0;
-       mode |= gw ? S_IWGRP : 0;
-       mode |= gx ? S_IXGRP : 0;
-       mode |= or ? S_IROTH : 0;
-       mode |= ow ? S_IWOTH : 0;
-       mode |= ox ? S_IXOTH : 0;
+       int fd;
+
        fd = open64(name, O_CREAT | O_RDWR, mode);
        if (fd < 0)
                return -errno;