aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs.h7
-rw-r--r--src/fs/fs_publish.c4
-rw-r--r--src/fs/gnunet-service-fs_indexing.c6
-rw-r--r--src/include/gnunet_disk_lib.h2
-rw-r--r--src/util/disk.c15
5 files changed, 25 insertions, 9 deletions
diff --git a/src/fs/fs.h b/src/fs/fs.h
index b3bf24e2a..838d74a2a 100644
--- a/src/fs/fs.h
+++ b/src/fs/fs.h
@@ -1860,13 +1860,18 @@ struct IndexStartMessage
1860 struct GNUNET_MessageHeader header; 1860 struct GNUNET_MessageHeader header;
1861 1861
1862 /** 1862 /**
1863 * For alignment.
1864 */
1865 uint32_t reserved GNUNET_PACKED;
1866
1867 /**
1863 * ID of device containing the file, as seen by the client. This 1868 * ID of device containing the file, as seen by the client. This
1864 * device ID is obtained using a call like "statvfs" (and converting 1869 * device ID is obtained using a call like "statvfs" (and converting
1865 * the "f_fsid" field to a 32-bit big-endian number). Use 0 if the 1870 * the "f_fsid" field to a 32-bit big-endian number). Use 0 if the
1866 * OS does not support this, in which case the service must do a 1871 * OS does not support this, in which case the service must do a
1867 * full hash recomputation. 1872 * full hash recomputation.
1868 */ 1873 */
1869 uint32_t device GNUNET_PACKED; 1874 uint64_t device GNUNET_PACKED;
1870 1875
1871 /** 1876 /**
1872 * Inode of the file on the given device, as seen by the client 1877 * Inode of the file on the given device, as seen by the client
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 13701405e..71d309320 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -737,7 +737,7 @@ hash_for_index_cb (void *cls,
737 struct IndexStartMessage *ism; 737 struct IndexStartMessage *ism;
738 size_t slen; 738 size_t slen;
739 struct GNUNET_CLIENT_Connection *client; 739 struct GNUNET_CLIENT_Connection *client;
740 uint32_t dev; 740 uint64_t dev;
741 uint64_t ino; 741 uint64_t ino;
742 char *fn; 742 char *fn;
743 743
@@ -809,7 +809,7 @@ hash_for_index_cb (void *cls,
809 &dev, 809 &dev,
810 &ino)) 810 &ino))
811 { 811 {
812 ism->device = htonl (dev); 812 ism->device = GNUNET_htonll (dev);
813 ism->inode = GNUNET_htonll(ino); 813 ism->inode = GNUNET_htonll(ino);
814 } 814 }
815 else 815 else
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index b72c53fc0..0b815ed3b 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -342,9 +342,9 @@ GNUNET_FS_handle_index_start (void *cls,
342 uint16_t msize; 342 uint16_t msize;
343 struct IndexInfo *ii; 343 struct IndexInfo *ii;
344 size_t slen; 344 size_t slen;
345 uint32_t dev; 345 uint64_t dev;
346 uint64_t ino; 346 uint64_t ino;
347 uint32_t mydev; 347 uint64_t mydev;
348 uint64_t myino; 348 uint64_t myino;
349 349
350 msize = ntohs(message->size); 350 msize = ntohs(message->size);
@@ -364,7 +364,7 @@ GNUNET_FS_handle_index_start (void *cls,
364 GNUNET_SYSERR); 364 GNUNET_SYSERR);
365 return; 365 return;
366 } 366 }
367 dev = ntohl (ism->device); 367 dev = GNUNET_ntohll (ism->device);
368 ino = GNUNET_ntohll (ism->inode); 368 ino = GNUNET_ntohll (ism->inode);
369 ism = (const struct IndexStartMessage*) message; 369 ism = (const struct IndexStartMessage*) message;
370 slen = strlen (fn) + 1; 370 slen = strlen (fn) + 1;
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h
index 980f142c5..340c35a4e 100644
--- a/src/include/gnunet_disk_lib.h
+++ b/src/include/gnunet_disk_lib.h
@@ -288,7 +288,7 @@ int GNUNET_DISK_file_size (const char *filename,
288 * @return GNUNET_OK on success 288 * @return GNUNET_OK on success
289 */ 289 */
290int GNUNET_DISK_file_get_identifiers (const char *filename, 290int GNUNET_DISK_file_get_identifiers (const char *filename,
291 uint32_t *dev, 291 uint64_t *dev,
292 uint64_t *ino); 292 uint64_t *ino);
293 293
294 294
diff --git a/src/util/disk.c b/src/util/disk.c
index 2474f0f2a..ef4e33cd2 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -248,7 +248,7 @@ GNUNET_DISK_file_size (const char *filename,
248 */ 248 */
249int 249int
250GNUNET_DISK_file_get_identifiers (const char *filename, 250GNUNET_DISK_file_get_identifiers (const char *filename,
251 uint32_t * dev, uint64_t * ino) 251 uint64_t * dev, uint64_t * ino)
252{ 252{
253#if LINUX 253#if LINUX
254 struct stat sbuf; 254 struct stat sbuf;
@@ -256,10 +256,21 @@ GNUNET_DISK_file_get_identifiers (const char *filename,
256 256
257 if ((0 == stat (filename, &sbuf)) && (0 == statvfs (filename, &fbuf))) 257 if ((0 == stat (filename, &sbuf)) && (0 == statvfs (filename, &fbuf)))
258 { 258 {
259 *dev = (uint32_t) fbuf.f_fsid; 259 *dev = (uint64_t) fbuf.f_fsid;
260 *ino = (uint64_t) sbuf.st_ino; 260 *ino = (uint64_t) sbuf.st_ino;
261 return GNUNET_OK; 261 return GNUNET_OK;
262 } 262 }
263#elif SOMEBSD
264 struct stat sbuf;
265 struct statfs fbuf;
266
267 if ( (0 == stat (filename, &sbuf)) &&
268 (0 == statfs (filename, &fbuf) ) )
269 {
270 *dev = ((uint64_t) fbuf.f_fsid[0]) << 32 || ((uint64_t) fbuf.f_fsid[1]);
271 *ino = (uint64_t) sbuf.st_ino;
272 return GNUNET_OK;
273 }
263#elif WINDOWS 274#elif WINDOWS
264 // FIXME NILS: test this 275 // FIXME NILS: test this
265 struct GNUNET_DISK_FileHandle *fh; 276 struct GNUNET_DISK_FileHandle *fh;