xfs: global error sign conversion
[deliverable/linux.git] / fs / xfs / xfs_super.c
index 3494eff8e4ebfbce7256fd8d95769e2a1799619c..f2e5f8a503d2f8c40c0f90fd791ad77f30c56c88 100644 (file)
@@ -185,7 +185,7 @@ xfs_parseargs(
         */
        mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL);
        if (!mp->m_fsname)
-               return ENOMEM;
+               return -ENOMEM;
        mp->m_fsname_len = strlen(mp->m_fsname) + 1;
 
        /*
@@ -227,57 +227,57 @@ xfs_parseargs(
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        if (kstrtoint(value, 10, &mp->m_logbufs))
-                               return EINVAL;
+                               return -EINVAL;
                } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) {
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        if (suffix_kstrtoint(value, 10, &mp->m_logbsize))
-                               return EINVAL;
+                               return -EINVAL;
                } else if (!strcmp(this_char, MNTOPT_LOGDEV)) {
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
                        if (!mp->m_logname)
-                               return ENOMEM;
+                               return -ENOMEM;
                } else if (!strcmp(this_char, MNTOPT_MTPT)) {
                        xfs_warn(mp, "%s option not allowed on this system",
                                this_char);
-                       return EINVAL;
+                       return -EINVAL;
                } else if (!strcmp(this_char, MNTOPT_RTDEV)) {
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
                        if (!mp->m_rtname)
-                               return ENOMEM;
+                               return -ENOMEM;
                } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) {
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        if (kstrtoint(value, 10, &iosize))
-                               return EINVAL;
+                               return -EINVAL;
                        iosizelog = ffs(iosize) - 1;
                } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        if (suffix_kstrtoint(value, 10, &iosize))
-                               return EINVAL;
+                               return -EINVAL;
                        iosizelog = ffs(iosize) - 1;
                } else if (!strcmp(this_char, MNTOPT_GRPID) ||
                           !strcmp(this_char, MNTOPT_BSDGROUPS)) {
@@ -297,18 +297,18 @@ xfs_parseargs(
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        if (kstrtoint(value, 10, &dsunit))
-                               return EINVAL;
+                               return -EINVAL;
                } else if (!strcmp(this_char, MNTOPT_SWIDTH)) {
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
-                               return EINVAL;
+                               return -EINVAL;
                        }
                        if (kstrtoint(value, 10, &dswidth))
-                               return EINVAL;
+                               return -EINVAL;
                } else if (!strcmp(this_char, MNTOPT_32BITINODE)) {
                        mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
                } else if (!strcmp(this_char, MNTOPT_64BITINODE)) {
@@ -316,7 +316,7 @@ xfs_parseargs(
 #if !XFS_BIG_INUMS
                        xfs_warn(mp, "%s option not allowed on this system",
                                this_char);
-                       return EINVAL;
+                       return -EINVAL;
 #endif
                } else if (!strcmp(this_char, MNTOPT_NOUUID)) {
                        mp->m_flags |= XFS_MOUNT_NOUUID;
@@ -390,7 +390,7 @@ xfs_parseargs(
        "irixsgid is now a sysctl(2) variable, option is deprecated.");
                } else {
                        xfs_warn(mp, "unknown mount option [%s].", this_char);
-                       return EINVAL;
+                       return -EINVAL;
                }
        }
 
@@ -400,32 +400,32 @@ xfs_parseargs(
        if ((mp->m_flags & XFS_MOUNT_NORECOVERY) &&
            !(mp->m_flags & XFS_MOUNT_RDONLY)) {
                xfs_warn(mp, "no-recovery mounts must be read-only.");
-               return EINVAL;
+               return -EINVAL;
        }
 
        if ((mp->m_flags & XFS_MOUNT_NOALIGN) && (dsunit || dswidth)) {
                xfs_warn(mp,
        "sunit and swidth options incompatible with the noalign option");
-               return EINVAL;
+               return -EINVAL;
        }
 
 #ifndef CONFIG_XFS_QUOTA
        if (XFS_IS_QUOTA_RUNNING(mp)) {
                xfs_warn(mp, "quota support not available in this kernel.");
-               return EINVAL;
+               return -EINVAL;
        }
 #endif
 
        if ((dsunit && !dswidth) || (!dsunit && dswidth)) {
                xfs_warn(mp, "sunit and swidth must be specified together");
-               return EINVAL;
+               return -EINVAL;
        }
 
        if (dsunit && (dswidth % dsunit != 0)) {
                xfs_warn(mp,
        "stripe width (%d) must be a multiple of the stripe unit (%d)",
                        dswidth, dsunit);
-               return EINVAL;
+               return -EINVAL;
        }
 
 done:
@@ -446,7 +446,7 @@ done:
             mp->m_logbufs > XLOG_MAX_ICLOGS)) {
                xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]",
                        mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS);
-               return XFS_ERROR(EINVAL);
+               return -EINVAL;
        }
        if (mp->m_logbsize != -1 &&
            mp->m_logbsize !=  0 &&
@@ -456,7 +456,7 @@ done:
                xfs_warn(mp,
                        "invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]",
                        mp->m_logbsize);
-               return XFS_ERROR(EINVAL);
+               return -EINVAL;
        }
 
        if (iosizelog) {
@@ -465,7 +465,7 @@ done:
                        xfs_warn(mp, "invalid log iosize: %d [not %d-%d]",
                                iosizelog, XFS_MIN_IO_LOG,
                                XFS_MAX_IO_LOG);
-                       return XFS_ERROR(EINVAL);
+                       return -EINVAL;
                }
 
                mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE;
@@ -686,7 +686,7 @@ xfs_blkdev_get(
                xfs_warn(mp, "Invalid device [%s], error=%d\n", name, error);
        }
 
-       return -error;
+       return error;
 }
 
 STATIC void
@@ -756,7 +756,7 @@ xfs_open_devices(
                if (rtdev == ddev || rtdev == logdev) {
                        xfs_warn(mp,
        "Cannot mount filesystem with identical rtdev and ddev/logdev.");
-                       error = EINVAL;
+                       error = -EINVAL;
                        goto out_close_rtdev;
                }
        }
@@ -764,21 +764,19 @@ xfs_open_devices(
        /*
         * Setup xfs_mount buffer target pointers
         */
-       error = ENOMEM;
-       mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev, 0, mp->m_fsname);
+       error = -ENOMEM;
+       mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev);
        if (!mp->m_ddev_targp)
                goto out_close_rtdev;
 
        if (rtdev) {
-               mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev, 1,
-                                                       mp->m_fsname);
+               mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev);
                if (!mp->m_rtdev_targp)
                        goto out_free_ddev_targ;
        }
 
        if (logdev && logdev != ddev) {
-               mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev, 1,
-                                                       mp->m_fsname);
+               mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev);
                if (!mp->m_logdev_targp)
                        goto out_free_rtdev_targ;
        } else {
@@ -811,8 +809,7 @@ xfs_setup_devices(
 {
        int                     error;
 
-       error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize,
-                                   mp->m_sb.sb_sectsize);
+       error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize);
        if (error)
                return error;
 
@@ -822,14 +819,12 @@ xfs_setup_devices(
                if (xfs_sb_version_hassector(&mp->m_sb))
                        log_sector_size = mp->m_sb.sb_logsectsize;
                error = xfs_setsize_buftarg(mp->m_logdev_targp,
-                                           mp->m_sb.sb_blocksize,
                                            log_sector_size);
                if (error)
                        return error;
        }
        if (mp->m_rtdev_targp) {
                error = xfs_setsize_buftarg(mp->m_rtdev_targp,
-                                           mp->m_sb.sb_blocksize,
                                            mp->m_sb.sb_sectsize);
                if (error)
                        return error;
@@ -1300,7 +1295,7 @@ xfs_fs_freeze(
 
        xfs_save_resvblks(mp);
        xfs_quiesce_attr(mp);
-       return -xfs_fs_log_dummy(mp);
+       return xfs_fs_log_dummy(mp);
 }
 
 STATIC int
@@ -1319,7 +1314,7 @@ xfs_fs_show_options(
        struct seq_file         *m,
        struct dentry           *root)
 {
-       return -xfs_showargs(XFS_M(root->d_sb), m);
+       return xfs_showargs(XFS_M(root->d_sb), m);
 }
 
 /*
@@ -1341,14 +1336,14 @@ xfs_finish_flags(
                           mp->m_logbsize < mp->m_sb.sb_logsunit) {
                        xfs_warn(mp,
                "logbuf size must be greater than or equal to log stripe size");
-                       return XFS_ERROR(EINVAL);
+                       return -EINVAL;
                }
        } else {
                /* Fail a mount if the logbuf is larger than 32K */
                if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) {
                        xfs_warn(mp,
                "logbuf size for version 1 logs must be 16K or 32K");
-                       return XFS_ERROR(EINVAL);
+                       return -EINVAL;
                }
        }
 
@@ -1360,7 +1355,7 @@ xfs_finish_flags(
                xfs_warn(mp,
 "Cannot mount a V5 filesystem as %s. %s is always enabled for V5 filesystems.",
                        MNTOPT_NOATTR2, MNTOPT_ATTR2);
-               return XFS_ERROR(EINVAL);
+               return -EINVAL;
        }
 
        /*
@@ -1377,7 +1372,7 @@ xfs_finish_flags(
        if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) {
                xfs_warn(mp,
                        "cannot mount a read-only filesystem as read-write");
-               return XFS_ERROR(EROFS);
+               return -EROFS;
        }
 
        if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) &&
@@ -1385,7 +1380,7 @@ xfs_finish_flags(
            !xfs_sb_version_has_pquotino(&mp->m_sb)) {
                xfs_warn(mp,
                  "Super block does not support project and group quota together");
-               return XFS_ERROR(EINVAL);
+               return -EINVAL;
        }
 
        return 0;
@@ -1399,7 +1394,7 @@ xfs_fs_fill_super(
 {
        struct inode            *root;
        struct xfs_mount        *mp = NULL;
-       int                     flags = 0, error = ENOMEM;
+       int                     flags = 0, error = -ENOMEM;
 
        mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
        if (!mp)
@@ -1433,11 +1428,11 @@ xfs_fs_fill_super(
        if (error)
                goto out_free_fsname;
 
-       error = -xfs_init_mount_workqueues(mp);
+       error = xfs_init_mount_workqueues(mp);
        if (error)
                goto out_close_devices;
 
-       error = -xfs_icsb_init_counters(mp);
+       error = xfs_icsb_init_counters(mp);
        if (error)
                goto out_destroy_workqueues;
 
@@ -1479,12 +1474,12 @@ xfs_fs_fill_super(
 
        root = igrab(VFS_I(mp->m_rootip));
        if (!root) {
-               error = ENOENT;
+               error = -ENOENT;
                goto out_unmount;
        }
        sb->s_root = d_make_root(root);
        if (!sb->s_root) {
-               error = ENOMEM;
+               error = -ENOMEM;
                goto out_unmount;
        }
 
@@ -1504,7 +1499,7 @@ out_destroy_workqueues:
        xfs_free_fsname(mp);
        kfree(mp);
  out:
-       return -error;
+       return error;
 
  out_unmount:
        xfs_filestream_unmount(mp);
@@ -1754,13 +1749,9 @@ init_xfs_fs(void)
        if (error)
                goto out_destroy_wq;
 
-       error = xfs_filestream_init();
-       if (error)
-               goto out_mru_cache_uninit;
-
        error = xfs_buf_init();
        if (error)
-               goto out_filestream_uninit;
+               goto out_mru_cache_uninit;
 
        error = xfs_init_procfs();
        if (error)
@@ -1787,8 +1778,6 @@ init_xfs_fs(void)
        xfs_cleanup_procfs();
  out_buf_terminate:
        xfs_buf_terminate();
- out_filestream_uninit:
-       xfs_filestream_uninit();
  out_mru_cache_uninit:
        xfs_mru_cache_uninit();
  out_destroy_wq:
@@ -1807,7 +1796,6 @@ exit_xfs_fs(void)
        xfs_sysctl_unregister();
        xfs_cleanup_procfs();
        xfs_buf_terminate();
-       xfs_filestream_uninit();
        xfs_mru_cache_uninit();
        xfs_destroy_workqueues();
        xfs_destroy_zones();
This page took 0.039513 seconds and 5 git commands to generate.