Ticket #5698: reiserfs-label.patch
File reiserfs-label.patch, 2.9 KB (added by , 14 years ago) |
---|
-
src/add-ons/kernel/file_systems/reiserfs/Volume.cpp
262 262 void 263 263 Volume::UpdateName(partition_id partitionID) 264 264 { 265 if (fSuperBlock->GetLabel(fVolumeName, sizeof(fVolumeName)) == B_OK) 266 return; 265 267 if (get_default_partition_content_name(partitionID, "ReiserFS", 266 fVolumeName, sizeof(fVolumeName)) != B_OK) {267 strlcpy(fVolumeName, "ReiserFS Volume", sizeof(fVolumeName));268 }268 fVolumeName, sizeof(fVolumeName)) == B_OK) 269 return; 270 strlcpy(fVolumeName, "ReiserFS Volume", sizeof(fVolumeName)); 269 271 } 270 272 271 273 -
src/add-ons/kernel/file_systems/reiserfs/SuperBlock.h
85 85 : le2h(fOldData->s_tree_height)); 86 86 } 87 87 88 status_t GetLabel(char* buffer, size_t bufferSize) const; 89 88 90 private: 89 91 uint32 fFormatVersion; 90 92 union { -
src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp
109 109 fFormatVersion = REISERFS_3_5; 110 110 // try new version and new layout 111 111 } else if (read_super_block(device, REISERFS_DISK_OFFSET_IN_BYTES + offset, 112 REISER2FS_SUPER_MAGIC_STRING, &f OldData) == B_OK) {112 REISER2FS_SUPER_MAGIC_STRING, &fCurrentData) == B_OK) { 113 113 PRINT(("SuperBlock: ReiserFS 3.6\n")); 114 114 fFormatVersion = REISERFS_3_6; 115 115 // failure … … 119 119 return error; 120 120 } 121 121 122 123 // GetLabel 124 status_t 125 SuperBlock::GetLabel(char* buffer, size_t bufferSize) const 126 { 127 if (GetFormatVersion() == REISERFS_3_6 && fCurrentData->s_label[0]) { 128 size_t len = MIN(sizeof(fCurrentData->s_label), bufferSize - 1); 129 memcpy(buffer, fCurrentData->s_label, len); 130 buffer[len] = '\0'; 131 return B_OK; 132 } 133 return B_ENTRY_NOT_FOUND; 134 } -
src/add-ons/kernel/file_systems/reiserfs/reiserfs.h
272 272 superblock. -Hans */ 273 273 uint16 s_reserved; 274 274 uint32 s_inode_generation; 275 char s_unused[124] ; /* zero filled by mkreiserfs */ 275 uint32 s_flags; 276 char s_uuid[16]; 277 char s_label[16]; 278 uint16 s_mnt_count; 279 uint16 s_max_mnt_count; 280 uint32 s_lastcheck; 281 uint32 s_check_interval; 282 char s_unused[76] ; /* zero filled by mkreiserfs */ 276 283 } _PACKED; 277 284 278 285 #define SB_SIZE (sizeof(struct reiserfs_super_block))