]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: drop unused safezero argument
authorEric Blake <eblake@redhat.com>
Wed, 6 Jul 2011 22:32:10 +0000 (16:32 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 7 Jul 2011 20:15:38 +0000 (14:15 -0600)
No caller was using the flags argument, and this function is internal
only, so we might as well skip it.

* src/util/util.h (safezero): Update signature.
* src/util/util.c (safezero): Update function.
* src/locking/lock_driver_sanlock.c
(virLockManagerSanlockSetupLockspace)
(virLockManagerSanlockCreateLease): Update all callers.
* src/storage/storage_backend.c (createRawFile): Likewise.

src/locking/lock_driver_sanlock.c
src/storage/storage_backend.c
src/util/util.c
src/util/util.h

index 567221c92a55c055dd7ddfcf2410d87b1b3bc7d9..cd2bbb5560f0d0318d5296a07ac11371d6bf99b6 100644 (file)
@@ -196,7 +196,7 @@ static int virLockManagerSanlockSetupLockspace(void)
             /*
              * Pre allocate enough data for 1 block of leases at preferred alignment
              */
-            if (safezero(fd, 0, 0, rv) < 0) {
+            if (safezero(fd, 0, rv) < 0) {
                 virReportSystemError(errno,
                                      _("Unable to allocate lockspace %s"),
                                      path);
@@ -567,7 +567,7 @@ static int virLockManagerSanlockCreateLease(struct sanlk_resource *res)
             /*
              * Pre allocate enough data for 1 block of leases at preferred alignment
              */
-            if (safezero(fd, 0, 0, rv) < 0) {
+            if (safezero(fd, 0, rv) < 0) {
                 virReportSystemError(errno,
                                      _("Unable to allocate lease %s"),
                                      res->disks[0].path);
index 708d7b28ca247a34d5cb6f1b35915eadbc7c4a7d..671b88ede3ef411cf7c8b82042af6fe941c5dedb 100644 (file)
@@ -331,7 +331,7 @@ createRawFile(int fd, virStorageVolDefPtr vol,
 
                 if (bytes > remain)
                     bytes = remain;
-                if (safezero(fd, 0, vol->allocation - remain, bytes) < 0) {
+                if (safezero(fd, vol->allocation - remain, bytes) < 0) {
                     ret = -errno;
                     virReportSystemError(errno, _("cannot fill file '%s'"),
                                          vol->target.path);
@@ -340,7 +340,7 @@ createRawFile(int fd, virStorageVolDefPtr vol,
                 remain -= bytes;
             }
         } else { /* No progress bars to be shown */
-            if (safezero(fd, 0, 0, remain) < 0) {
+            if (safezero(fd, 0, remain) < 0) {
                 ret = -errno;
                 virReportSystemError(errno, _("cannot fill file '%s'"),
                                      vol->target.path);
index 55425577d344b8fe4a8a51946df35159be917100..3d0ceea4a80b572ff08b8817505858458e040e33 100644 (file)
@@ -133,7 +133,7 @@ safewrite(int fd, const void *buf, size_t count)
 }
 
 #ifdef HAVE_POSIX_FALLOCATE
-int safezero(int fd, int flags ATTRIBUTE_UNUSED, off_t offset, off_t len)
+int safezero(int fd, off_t offset, off_t len)
 {
     int ret = posix_fallocate(fd, offset, len);
     if (ret == 0)
@@ -144,7 +144,7 @@ int safezero(int fd, int flags ATTRIBUTE_UNUSED, off_t offset, off_t len)
 #else
 
 # ifdef HAVE_MMAP
-int safezero(int fd, int flags ATTRIBUTE_UNUSED, off_t offset, off_t len)
+int safezero(int fd, off_t offset, off_t len)
 {
     int r;
     char *buf;
@@ -168,7 +168,7 @@ int safezero(int fd, int flags ATTRIBUTE_UNUSED, off_t offset, off_t len)
 
 # else /* HAVE_MMAP */
 
-int safezero(int fd, int flags ATTRIBUTE_UNUSED, off_t offset, off_t len)
+int safezero(int fd, off_t offset, off_t len)
 {
     int r;
     char *buf;
index 7a1eb11523672c20400ff5d2766e52a626f04c35..6f07f8c8368a44c1bd9c1811d1c79b46b0dd5575 100644 (file)
@@ -39,7 +39,7 @@
 ssize_t saferead(int fd, void *buf, size_t count) ATTRIBUTE_RETURN_CHECK;
 ssize_t safewrite(int fd, const void *buf, size_t count)
     ATTRIBUTE_RETURN_CHECK;
-int safezero(int fd, int flags, off_t offset, off_t len)
+int safezero(int fd, off_t offset, off_t len)
     ATTRIBUTE_RETURN_CHECK;
 
 int virSetBlocking(int fd, bool blocking) ATTRIBUTE_RETURN_CHECK;