Patch review -- file_id_string_tos()?

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Oct 29 09:50:22 MDT 2012


On Mon, Oct 29, 2012 at 04:47:31PM +0100, Volker Lendecke wrote:
> Hi, Andrew!
> 
> The attached patch removes some code duplication. I send
> this to you because you introduced file_id_string() without
> _tos() recently.
> 
> Please review and push if it seems appropriate to you.

This time with the preceding patch, which might be required
to apply this patch without conflicts.

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 0fe0157c860e18e8be39bd70e5e39d3f418a0539 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 29 Oct 2012 16:35:49 +0100
Subject: [PATCH 1/2] s3: Fix some nonempty line endings

---
 source3/lib/file_id.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/source3/lib/file_id.c b/source3/lib/file_id.c
index 1640708..360b355 100644
--- a/source3/lib/file_id.c
+++ b/source3/lib/file_id.c
@@ -1,20 +1,20 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    file_id structure handling
 
    Copyright (C) Andrew Tridgell 2007
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -37,7 +37,7 @@ bool file_id_equal(const struct file_id *id1, const struct file_id *id2)
 const char *file_id_string_tos(const struct file_id *id)
 {
 	char *result = talloc_asprintf(talloc_tos(), "%llx:%llx:%llx",
-				       (unsigned long long)id->devid, 
+				       (unsigned long long)id->devid,
 				       (unsigned long long)id->inode,
 				       (unsigned long long)id->extid);
 	SMB_ASSERT(result != NULL);
-- 
1.7.9.5


From 4ce28482ac2673539362bbbf10a57d8f1730203d Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 29 Oct 2012 16:41:15 +0100
Subject: [PATCH 2/2] s3: Use file_id_string in file_id_string_tos

---
 source3/lib/file_id.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/source3/lib/file_id.c b/source3/lib/file_id.c
index 360b355..ba4b3a3 100644
--- a/source3/lib/file_id.c
+++ b/source3/lib/file_id.c
@@ -36,12 +36,7 @@ bool file_id_equal(const struct file_id *id1, const struct file_id *id2)
  */
 const char *file_id_string_tos(const struct file_id *id)
 {
-	char *result = talloc_asprintf(talloc_tos(), "%llx:%llx:%llx",
-				       (unsigned long long)id->devid,
-				       (unsigned long long)id->inode,
-				       (unsigned long long)id->extid);
-	SMB_ASSERT(result != NULL);
-	return result;
+	return file_id_string(talloc_tos(), id);
 }
 
 /*
-- 
1.7.9.5



More information about the samba-technical mailing list