fs: add ksys_fchmod() and do_fchmodat() helpers and ksys_chmod() wrapper; remove...
[linux-block.git] / init / initramfs.c
index 7e99a00389429d79281ac2663a6fb7a4bedaef1d..16c3c23076e25b42609362ce80a73ab42cf6ff7d 100644 (file)
@@ -27,7 +27,7 @@ static ssize_t __init xwrite(int fd, const char *p, size_t count)
 
        /* sys_write only can write MAX_RW_COUNT aka 2G-4K bytes at most */
        while (count) {
-               ssize_t rv = sys_write(fd, p, count);
+               ssize_t rv = ksys_write(fd, p, count);
 
                if (rv < 0) {
                        if (rv == -EINTR || rv == -EAGAIN)
@@ -306,7 +306,7 @@ static int __init maybe_link(void)
        if (nlink >= 2) {
                char *old = find_link(major, minor, ino, mode, collected);
                if (old)
-                       return (sys_link(old, collected) < 0) ? -1 : 1;
+                       return (ksys_link(old, collected) < 0) ? -1 : 1;
        }
        return 0;
 }
@@ -317,9 +317,9 @@ static void __init clean_path(char *path, umode_t fmode)
 
        if (!vfs_lstat(path, &st) && (st.mode ^ fmode) & S_IFMT) {
                if (S_ISDIR(st.mode))
-                       sys_rmdir(path);
+                       ksys_rmdir(path);
                else
-                       sys_unlink(path);
+                       ksys_unlink(path);
        }
 }
 
@@ -344,7 +344,7 @@ static int __init do_name(void)
 
                        if (wfd >= 0) {
                                sys_fchown(wfd, uid, gid);
-                               sys_fchmod(wfd, mode);
+                               ksys_fchmod(wfd, mode);
                                if (body_len)
                                        sys_ftruncate(wfd, body_len);
                                vcollected = kstrdup(collected, GFP_KERNEL);
@@ -352,16 +352,16 @@ static int __init do_name(void)
                        }
                }
        } else if (S_ISDIR(mode)) {
-               sys_mkdir(collected, mode);
+               ksys_mkdir(collected, mode);
                sys_chown(collected, uid, gid);
-               sys_chmod(collected, mode);
+               ksys_chmod(collected, mode);
                dir_add(collected, mtime);
        } else if (S_ISBLK(mode) || S_ISCHR(mode) ||
                   S_ISFIFO(mode) || S_ISSOCK(mode)) {
                if (maybe_link() == 0) {
-                       sys_mknod(collected, mode, rdev);
+                       ksys_mknod(collected, mode, rdev);
                        sys_chown(collected, uid, gid);
-                       sys_chmod(collected, mode);
+                       ksys_chmod(collected, mode);
                        do_utime(collected, mtime);
                }
        }
@@ -392,7 +392,7 @@ static int __init do_symlink(void)
 {
        collected[N_ALIGN(name_len) + body_len] = '\0';
        clean_path(collected, 0);
-       sys_symlink(collected + N_ALIGN(name_len), collected);
+       ksys_symlink(collected + N_ALIGN(name_len), collected);
        sys_lchown(collected, uid, gid);
        do_utime(collected, mtime);
        state = SkipIt;
@@ -589,9 +589,9 @@ static void __init clean_rootfs(void)
                        WARN_ON_ONCE(ret);
                        if (!ret) {
                                if (S_ISDIR(st.mode))
-                                       sys_rmdir(dirp->d_name);
+                                       ksys_rmdir(dirp->d_name);
                                else
-                                       sys_unlink(dirp->d_name);
+                                       ksys_unlink(dirp->d_name);
                        }
 
                        num -= dirp->d_reclen;