Merge tag 'staging-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux] / init / do_mounts_rd.c
index 99e0b64..12c1598 100644 (file)
@@ -90,8 +90,8 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
        /*
         * Read block 0 to test for compressed kernel
         */
-       sys_lseek(fd, start_block * BLOCK_SIZE, 0);
-       sys_read(fd, buf, size);
+       ksys_lseek(fd, start_block * BLOCK_SIZE, 0);
+       ksys_read(fd, buf, size);
 
        *decompressor = decompress_method(buf, size, &compress_name);
        if (compress_name) {
@@ -136,8 +136,8 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
        /*
         * Read 512 bytes further to check if cramfs is padded
         */
-       sys_lseek(fd, start_block * BLOCK_SIZE + 0x200, 0);
-       sys_read(fd, buf, size);
+       ksys_lseek(fd, start_block * BLOCK_SIZE + 0x200, 0);
+       ksys_read(fd, buf, size);
 
        if (cramfsb->magic == CRAMFS_MAGIC) {
                printk(KERN_NOTICE
@@ -150,8 +150,8 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
        /*
         * Read block 1 to test for minix and ext2 superblock
         */
-       sys_lseek(fd, (start_block+1) * BLOCK_SIZE, 0);
-       sys_read(fd, buf, size);
+       ksys_lseek(fd, (start_block+1) * BLOCK_SIZE, 0);
+       ksys_read(fd, buf, size);
 
        /* Try minix */
        if (minixsb->s_magic == MINIX_SUPER_MAGIC ||
@@ -178,7 +178,7 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
               start_block);
 
 done:
-       sys_lseek(fd, start_block * BLOCK_SIZE, 0);
+       ksys_lseek(fd, start_block * BLOCK_SIZE, 0);
        kfree(buf);
        return nblocks;
 }
@@ -196,11 +196,11 @@ int __init rd_load_image(char *from)
        char rotator[4] = { '|' , '/' , '-' , '\\' };
 #endif
 
-       out_fd = sys_open("/dev/ram", O_RDWR, 0);
+       out_fd = ksys_open("/dev/ram", O_RDWR, 0);
        if (out_fd < 0)
                goto out;
 
-       in_fd = sys_open(from, O_RDONLY, 0);
+       in_fd = ksys_open(from, O_RDONLY, 0);
        if (in_fd < 0)
                goto noclose_input;
 
@@ -218,7 +218,7 @@ int __init rd_load_image(char *from)
         * NOTE NOTE: nblocks is not actually blocks but
         * the number of kibibytes of data to load into a ramdisk.
         */
-       if (sys_ioctl(out_fd, BLKGETSIZE, (unsigned long)&rd_blocks) < 0)
+       if (ksys_ioctl(out_fd, BLKGETSIZE, (unsigned long)&rd_blocks) < 0)
                rd_blocks = 0;
        else
                rd_blocks >>= 1;
@@ -232,7 +232,7 @@ int __init rd_load_image(char *from)
        /*
         * OK, time to copy in the data
         */
-       if (sys_ioctl(in_fd, BLKGETSIZE, (unsigned long)&devblocks) < 0)
+       if (ksys_ioctl(in_fd, BLKGETSIZE, (unsigned long)&devblocks) < 0)
                devblocks = 0;
        else
                devblocks >>= 1;
@@ -257,20 +257,20 @@ int __init rd_load_image(char *from)
                if (i && (i % devblocks == 0)) {
                        printk("done disk #%d.\n", disk++);
                        rotate = 0;
-                       if (sys_close(in_fd)) {
+                       if (ksys_close(in_fd)) {
                                printk("Error closing the disk.\n");
                                goto noclose_input;
                        }
                        change_floppy("disk #%d", disk);
-                       in_fd = sys_open(from, O_RDONLY, 0);
+                       in_fd = ksys_open(from, O_RDONLY, 0);
                        if (in_fd < 0)  {
                                printk("Error opening disk.\n");
                                goto noclose_input;
                        }
                        printk("Loading disk #%d... ", disk);
                }
-               sys_read(in_fd, buf, BLOCK_SIZE);
-               sys_write(out_fd, buf, BLOCK_SIZE);
+               ksys_read(in_fd, buf, BLOCK_SIZE);
+               ksys_write(out_fd, buf, BLOCK_SIZE);
 #if !defined(CONFIG_S390)
                if (!(i % 16)) {
                        pr_cont("%c\b", rotator[rotate & 0x3]);
@@ -283,12 +283,12 @@ int __init rd_load_image(char *from)
 successful_load:
        res = 1;
 done:
-       sys_close(in_fd);
+       ksys_close(in_fd);
 noclose_input:
-       sys_close(out_fd);
+       ksys_close(out_fd);
 out:
        kfree(buf);
-       sys_unlink("/dev/ram");
+       ksys_unlink("/dev/ram");
        return res;
 }
 
@@ -307,7 +307,7 @@ static int crd_infd, crd_outfd;
 
 static long __init compr_fill(void *buf, unsigned long len)
 {
-       long r = sys_read(crd_infd, buf, len);
+       long r = ksys_read(crd_infd, buf, len);
        if (r < 0)
                printk(KERN_ERR "RAMDISK: error while reading compressed data");
        else if (r == 0)
@@ -317,7 +317,7 @@ static long __init compr_fill(void *buf, unsigned long len)
 
 static long __init compr_flush(void *window, unsigned long outcnt)
 {
-       long written = sys_write(crd_outfd, window, outcnt);
+       long written = ksys_write(crd_outfd, window, outcnt);
        if (written != outcnt) {
                if (decompress_error == 0)
                        printk(KERN_ERR