My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 32: Data Structures : design meeting on 12th Jan, 2009
1 person starred this issue and may be notified of changes. Back to list
 
Reported by postri...@gmail.com, Jan 12, 2009
Following data structures have beed decided for relocation process.

struct ohsm_reloc_policy{

	reloc_policy_id;	/* policy number in the policy file */
	
	src_tier;		/* the source tier number */

	dest_tier;		/* the destination tier number */

	reloc_criteria_bitmap;	/* relocation criteria bitmap */
	
	values[5];		/* values of the criterias entered for relocation */

	rel_ops[5];		/* flags depicting the relations like less than, greater
than, equal to*/

}

	
Jan 13, 2009
Project Member #1 sandeepksinha
Rishi,
Can you provide all the relevant information that we decided upon in the meeting
yesterday?

Only the data structures and not algorithms please. Also, write comments for use of
each members and the overall structure as well.
Summary: Data Structures : design meeting on 12th Jan, 2009
Status: Started
Labels: -Priority-Medium Priority-Critical Milestone-Release1.0 Usability Design-Related-Issue Component-Docs
Jan 27, 2009
#2 postri...@gmail.com
#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/types.h>




#define OHSM_MOUNT_POINT_LENGTH 20
#define MAX_TIER_ALLOWED 10
#define MAX_DISK_ALLOWED 10
#define map_info_ready_t unsigned char
#define table_ready_t	unsigned char
#define TRUE 1
#define FALSE 0
#define OHSM_UPDATE_TARGET_INFO 41
#define OHSM_MAX_TARGET_ALLOWED 10
#define MAX_DISK 10
#define MAX_DEV_NAME_LEN 20
#define MAX_EXTENTION_LENGTH 5
#define OHSM_NUMBER_OF_CRITERIAS 5
#define OHSM_SET_POLICY 1
#define FSIZE 1
#define FAA 2
#define FMA 4
#define FIOT 8
#define FAT 16
#define LT 1 
#define GT 2 
#define EQ 3
#define NEQ 4
#define LE 5
#define GE 6
#define TRUE 1
#define FALSE 0

These are the final data structures decided.
Structures related to the XML parser

There are three files which the GUI or the CLI will create.

-> allocation policy file	/* file entered for allocation */

-> relocation policy file	/* file entered for relocation */
	
-> tier device xml file		/* file having information related to tier and device */


The structures required to parse the allocation policy file and send the policy in
the kernel space are:



Structure required for the work queue

struct ohsm_work {
	struct work_struct work;
	unsigned long src_ind;
	int retval;
	
};


structures required for allocation policy file


struct ohsm_uid_tier
{

	uid_t uid;		/* user id */
	unsigned char tier;	/* respective tier of the user */
};

struct ohsm_gid_tier
{

	gid_t gid;		/* group id*/
	unsigned char tier;	/* respective tier of the group */

};



struct ohsm_type_tier
{

	char type[MAX_EXTENTION_LENGTH];	/* file extention */
	unsigned  char tier;			/* respective tier for the file type */

};


struct ohsm_allocation_policy
{
	
	struct ohsm_uid_tier *ptr_uid;		/* address of dyamically created ohsm_uid_tier */ 
	struct ohsm_gid_tier *ptr_gid;		/* address of dynamically created ohsm_gid_tier */
	struct ohsm_type_tier *ptr_type;	/* address of dynamically created ohsm_type_tier*/
	int cnt_users;				/* count of users for which tier has been specified*/
	int cnt_groups;				/* count of groups for which tier has been specified*/
	int cnt_types;				/* count of file types for which tier has been specified*/
};

 the parsing of the relocation policy file will result in an array of the following
structure
 the base address of the array will be passed into the kernel space


struct ohsm_relocation_policy
{

	unsigned char reloc_criteria_bitmap;			/* bitmap for criterias specified in the policy*/
	unsigned char src_tier;					/* the source tier for this policy */
	unsigned char dest_tier;				/* the destination tier for this table */
	unsigned char rel_ops[OHSM_NUMBER_OF_CRITERIAS];	/* the relational operators for the
criterias entered*/
	long long values[OHSM_NUMBER_OF_CRITERIAS];		/* the values for the criterias of the
policy*/
};


struct ohsm_struct_single_rule
{
	struct ohsm_relocation_policy *table_policies;
	int cnt_policies;
};

struct ohsm_struct_rules
{
	struct ohsm_struct_single_rule *table_rules;
	int cnt_rules;
};



The structures required for the tier device xml file:

following structures will be filled while parsing the xml file having tier device info


struct ohsm_tier_bg_start_end {
	unsigned char tier;
	unsigned long blkgrp_start;
	unsigned long blkgrp_end;
};


struct ohsm_dev_name_tier
{
	unsigned char tier;			/* tier number*/ 
	char dev_name[MAX_DEV_NAME_LEN];	/* device name*/
};

struct ohsm_tier_dev_name
{
	struct ohsm_dev_name_tier *table;	/* address of dynamically created
ohsm_dev_name_tier */
	int cnt_tiers;				/* number of tiers*/
	int cnt_devices;				/* number of devices*/
};

struct ohsm_major_minor_dev_name
{
  char dev_name[20];
  unsigned int major_no;
  unsigned int minor_no;
};

following structures will filled in user space and will map into tier number - device
number table

struct ohsm_tier_dev_number
{
	unsigned char tier;		/* tier number */
	unsigned int dev_num;		/* device number */
};

this structure will be send to kernel space

struct ohsm_tier_device_count
{
	struct ohsm_tier_dev_number *table;	/* address of dynamically created
ohsm_tier_dev_number */
	unsigned int count;			/* count of entries */
};


The structure required for device mapper related functions:

struct ohsm_disk_info {
	dev_t dev_num;
	unsigned long begin;
	unsigned long len;
	unsigned int blkgrp_start;
	unsigned int blkgrp_end;
};

struct ohsm_tier_map_table {
	int tier_id;
	int nr_disk;
	struct ohsm_disk_info tier_disk[MAX_DISK];
};

/*
 * This table holds the complete filesystem-device mapper
 * mappings. it also holds the number of blocks in a particular tier.
 */

struct ohsm_disk_info mapper_table[MAX_TIER_ALLOWED];
/*
 * This flag indicates if the table holds any valid info about the
 * mapping of the devcies.
 * If not, then we issue a command to get that info from devcie mapper.
 */

	map_info_ready_t mapper_flag = FALSE;

/* This flag is an indicator, if the table is complete and running,
 * if map_info_ready_t is SET and this flag is not SET means that we
 * need to fetch the block group info and update teh table.
 * We also set this flag to TRUE after doing so.
 */
	
	table_ready_t map_table_flag = FALSE; 

/* Global Variable to store the number of targets in DM*/

	extern unsigned int ohsm_nr_targets;

/* This structure is used by OHSM in the device mapper code */

struct ohsm_map_table_t {
	dev_t dev_num;
	unsigned long begin;
	unsigned long len;
};





extern struct ohsm_map_table_t ohsm_map_table[OHSM_MAX_TARGET_ALLOWED];

extern int ohsm_set_dm_info_table(struct ohsm_disk_info **mapper_table);
///////////////////////////////////////////////////*/


/*
The SAM Table:

-> It is a two dimensional array of unsigned long data type.
-> Number of rows is equal to the number of tiers in the system + 1
-> The zeroth row has values in three columns 
	-> col 0 - number of devices on the system + 1
	-> col 1 - the start block group of the file system
	-> col 2 - the end block group of the file system

-> For other rows
	-> Number of columns is the number of devices in the tier*2  + 3 
	-> The first column stores the number of disks on that tier + 1
	-> The block group range for any tier say "x" is stored in the "x"th row of the SAM
table
	-> The last two elements in any column has the start and end block group range of
the file system
*/


struct ohsm_struct_for_ioctl
{
	struct ohsm_tier_device_count *ptr_dev_file;
	struct ohsm_struct_rules *ptr_reloc_policy;	
	struct ohsm_allocation_policy *ptr_alloc_policy;
	char mountpoint[OHSM_MOUNT_POINT_LENGTH];
};


void debug_print_and_test_type (struct ohsm_type_tier *ptr, unsigned int number);
void
debug_print_and_test_user (struct ohsm_uid_tier *ptr, unsigned int number);
void
debug_print_and_test_group (struct ohsm_gid_tier *ptr, unsigned int number);
Status: Done

Powered by Google Project Hosting