Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. diff --git a/src/config.h b/src/config.h
  2. index 3d6e7c5..345512e 100644
  3. --- a/src/config.h
  4. +++ b/src/config.h
  5. @@ -56,6 +56,7 @@ struct rfs_list;
  6. + sizeof(uint64_t) /* ctime */ \
  7. + sizeof(uint32_t) /* blocks */ \
  8. + + sizeof(uint64_t) /* ino */ \
  9.  
  10. #ifdef RFS_DEBUG
  11. #define DEFAULT_PASSWD_FILE "./rfs-passwd"
  12. diff --git a/src/handlers/utils.c b/src/handlers/utils.c
  13. index 1870a11..4e59d56 100644
  14. --- a/src/handlers/utils.c
  15. +++ b/src/handlers/utils.c
  16. @@ -46,6 +46,7 @@ char* pack_stat(struct stat *stbuf, char *buffer)
  17. uint64_t ctime = stbuf->st_ctime;
  18. uint32_t nlink = stbuf->st_nlink;
  19. uint32_t blocks = stbuf->st_blocks;
  20. + uint64_t ino = stbuf->st_ino;
  21.  
  22. pack_32(&blocks,
  23. pack_32(&nlink,
  24. @@ -53,8 +54,9 @@ char* pack_stat(struct stat *stbuf, char *buffer)
  25. pack_64(&mtime,
  26. pack_64(&atime,
  27. pack_64(&size,
  28. - pack_32(&mode, buffer
  29. - )))))));
  30. + pack_32(&mode,
  31. + pack_64(&ino, buffer
  32. + ))))))));
  33.  
  34. #ifdef RFS_DEBUG
  35. dump(buffer, STAT_BLOCK_SIZE);
  36. diff --git a/src/operations/utils.c b/src/operations/utils.c
  37. index be9ff1a..5c78db5 100644
  38. --- a/src/operations/utils.c
  39. +++ b/src/operations/utils.c
  40. @@ -59,6 +59,7 @@ const char* unpack_stat(struct stat *result, const char *buffer)
  41. uint64_t ctime = 0;
  42. uint32_t nlink = 0;
  43. uint32_t blocks = 0;
  44. + uint64_t ino = 0;
  45.  
  46. #ifdef RFS_DEBUG
  47. dump(buffer, STAT_BLOCK_SIZE);
  48. @@ -70,8 +71,9 @@ const char* unpack_stat(struct stat *result, const char *buffer)
  49. unpack_64(&mtime,
  50. unpack_64(&atime,
  51. unpack_64(&size,
  52. - unpack_32(&mode, buffer
  53. - )))))));
  54. + unpack_32(&mode,
  55. + unpack_64(&ino, buffer
  56. + ))))))));
  57.  
  58. result->st_mode = mode;
  59. result->st_size = size;
  60. @@ -80,6 +82,7 @@ const char* unpack_stat(struct stat *result, const char *buffer)
  61. result->st_ctime = ctime;
  62. result->st_nlink = nlink;
  63. result->st_blocks = blocks;
  64. + result->st_ino = ino;
  65.  
  66. return buffer + STAT_BLOCK_SIZE;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement