StoneNeedle_kernel

base: linux 3.13 kernel (https://mirrors.edge.kernel.org/pub/linux/kernel/v3.x/)

Adding Ctags & Cscope

make ctags
find "$PWD" -name "*.c" -o -name "*.h" | cscope -q -R -b

unsigned int 형으로 buffer_head->ext4_type_for_stoneneedle 랑 bio->ext4_type_for_stoneneedle 라는 필드 파놓음

0 : undefined
1 : superblock Link, Code.
2 : group descriptor - ext4_fill_super(), Link, Code.
3 : block bitmap Code.
4 : inode bitmap Code.
5 : regular file inode Link.
6 : directory inode
create - ext4_add_entry(), Link.
mkdir - ext4_append(), Link.
rename Link.
Link.
7 : regular file data block Link.
8 : directory data block
9 : journal data Code.

bh의 필드에 type 남기는 법 (예시)

	/* journal data 일 경우 */
	bh->ext4_type_for_stoneneedle = 9; 

아래 코드로 StoneNeedle 모듈이 bio 로부터 type 받으니 참고

  	/* superblock */
  	if (bio->ext4_type_for_stoneneedle == 1)
		calc_bucket_account(io_data->write_ext4_sb_per_chunk, bio,
			    io_data->bucket_size);
	/* group descriptor */
	else if (bio->ext4_type_for_stoneneedle == 2) 
		calc_bucket_account(io_data->write_ext4_grdesc_per_chunk, bio,
			    io_data->bucket_size);	
	/* block bitmap */
	else if (bio->ext4_type_for_stoneneedle == 3) 
		calc_bucket_account(io_data->write_ext4_bbmap_per_chunk, bio,
			    io_data->bucket_size);
	/* inode bitmap */
	else if (bio->ext4_type_for_stoneneedle == 4) 
		calc_bucket_account(io_data->write_ext4_ibmap_per_chunk, bio,
			    io_data->bucket_size);
	/* regular file inode */
	else if (bio->ext4_type_for_stoneneedle == 5) 
		calc_bucket_account(io_data->write_ext4_rinode_per_chunk, bio,
			    io_data->bucket_size);
	/* directory inode */
	else if (bio->ext4_type_for_stoneneedle == 6) 
		calc_bucket_account(io_data->write_ext4_dinode_per_chunk, bio,
			    io_data->bucket_size);
	/* regular file data block */
	else if (bio->ext4_type_for_stoneneedle == 7) 
		calc_bucket_account(io_data->write_ext4_rblock_per_chunk, bio,
			    io_data->bucket_size);
	/* directory data block */
	else if (bio->ext4_type_for_stoneneedle == 8) 
		calc_bucket_account(io_data->write_ext4_dblock_per_chunk, bio,
			    io_data->bucket_size);
	/* journal data */
	else if (bio->ext4_type_for_stoneneedle == 9) 
		calc_bucket_account(io_data->write_ext4_journal_per_chunk, bio,
			    io_data->bucket_size);
	/* undefined */
	else  
		return 0;