Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262648
b: refs/heads/master
c: 8ff660a
h: refs/heads/master
v: v3
  • Loading branch information
Boaz Harrosh committed Aug 7, 2011
1 parent 8bc5aff commit 5fca90b
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 256 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9e9db45649eb5d3ee5622fdad741914ecf1016a0
refs/heads/master: 8ff660ab85f524bdc7652eb5d38aaef1d66aa9c7
2 changes: 1 addition & 1 deletion trunk/fs/exofs/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
# Kbuild - Gets included from the Kernels Makefile and build system
#

exofs-y := ios.o inode.o file.o symlink.o namei.o dir.o super.o
exofs-y := ore.o inode.o file.o symlink.o namei.o dir.o super.o
obj-$(CONFIG_EXOFS_FS) += exofs.o
119 changes: 12 additions & 107 deletions trunk/fs/exofs/exofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#include <linux/fs.h>
#include <linux/time.h>
#include <linux/backing-dev.h>
#include <linux/pnfs_osd_xdr.h>
#include <scsi/osd_ore.h>

#include "common.h"

#define EXOFS_ERR(fmt, a...) printk(KERN_ERR "exofs: " fmt, ##a)
Expand All @@ -52,33 +53,6 @@
/* u64 has problems with printk this will cast it to unsigned long long */
#define _LLU(x) (unsigned long long)(x)

struct exofs_comp {
struct osd_obj_id obj;
u8 cred[OSD_CAP_LEN];
};

struct exofs_layout {
/* Our way of looking at the data_map */
unsigned stripe_unit;
unsigned mirrors_p1;

unsigned group_width;
u64 group_depth;
unsigned group_count;
};

struct exofs_components {
unsigned numdevs; /* Num of devices in array */
/* If @single_comp == EC_SINGLE_COMP, @comps points to a single
* component. else there are @numdevs components
*/
enum EC_COMP_USAGE {
EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff
} single_comp;
struct exofs_comp *comps;
struct osd_dev **ods; /* osd_dev array */
};

/*
* our extension to the in-memory superblock
*/
Expand All @@ -95,9 +69,9 @@ struct exofs_sb_info {
struct pnfs_osd_data_map data_map; /* Default raid to use
* FIXME: Needed ?
*/
struct exofs_layout layout; /* Default files layout */
struct exofs_comp one_comp; /* id & cred of partition id=0*/
struct exofs_components comps; /* comps for the partition */
struct ore_layout layout; /* Default files layout */
struct ore_comp one_comp; /* id & cred of partition id=0*/
struct ore_components comps; /* comps for the partition */
struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
};

Expand All @@ -111,62 +85,15 @@ struct exofs_i_info {
uint32_t i_data[EXOFS_IDATA];/*short symlink names and device #s*/
uint32_t i_dir_start_lookup; /* which page to start lookup */
uint64_t i_commit_size; /* the object's written length */
struct exofs_comp one_comp; /* same component for all devices */
struct exofs_components comps; /* inode view of the device table */
struct ore_comp one_comp; /* same component for all devices */
struct ore_components comps; /* inode view of the device table */
};

static inline osd_id exofs_oi_objno(struct exofs_i_info *oi)
{
return oi->vfs_inode.i_ino + EXOFS_OBJ_OFF;
}

struct exofs_io_state;
typedef void (*exofs_io_done_fn)(struct exofs_io_state *ios, void *private);

struct exofs_io_state {
struct kref kref;

void *private;
exofs_io_done_fn done;

struct exofs_layout *layout;
struct exofs_components *comps;

/* Global read/write IO*/
loff_t offset;
unsigned long length;
void *kern_buff;

struct page **pages;
unsigned nr_pages;
unsigned pgbase;
unsigned pages_consumed;

/* Attributes */
unsigned in_attr_len;
struct osd_attr *in_attr;
unsigned out_attr_len;
struct osd_attr *out_attr;

bool reading;

/* Variable array of size numdevs */
unsigned numdevs;
struct exofs_per_dev_state {
struct osd_request *or;
struct bio *bio;
loff_t offset;
unsigned length;
unsigned dev;
} per_dev[];
};

static inline unsigned exofs_io_state_size(unsigned numdevs)
{
return sizeof(struct exofs_io_state) +
sizeof(struct exofs_per_dev_state) * numdevs;
}

/*
* our inode flags
*/
Expand Down Expand Up @@ -219,30 +146,8 @@ static inline struct exofs_i_info *exofs_i(struct inode *inode)
* function declarations *
*************************/

/* ios.c */
int exofs_get_rw_state(struct exofs_layout *layout,
struct exofs_components *comps,
bool is_reading, u64 offset, u64 length,
struct exofs_io_state **ios);
int exofs_get_io_state(struct exofs_layout *layout,
struct exofs_components *comps,
struct exofs_io_state **ios);
void exofs_put_io_state(struct exofs_io_state *ios);

int exofs_check_io(struct exofs_io_state *ios, u64 *resid);

int exofs_sbi_create(struct exofs_io_state *ios);
int exofs_sbi_remove(struct exofs_io_state *ios);
int exofs_sbi_write(struct exofs_io_state *ios);
int exofs_sbi_read(struct exofs_io_state *ios);
int exofs_truncate(struct exofs_layout *layout, struct exofs_components *comps,
u64 size);

int extract_attr_from_ios(struct exofs_io_state *ios, struct osd_attr *attr);
extern const struct osd_attr g_attr_logical_length;

/* inode.c */
unsigned exofs_max_io_pages(struct exofs_layout *layout,
unsigned exofs_max_io_pages(struct ore_layout *layout,
unsigned expected_pages);
int exofs_setattr(struct dentry *, struct iattr *);
int exofs_write_begin(struct file *file, struct address_space *mapping,
Expand Down Expand Up @@ -292,8 +197,8 @@ extern const struct inode_operations exofs_special_inode_operations;
extern const struct inode_operations exofs_symlink_inode_operations;
extern const struct inode_operations exofs_fast_symlink_inode_operations;

/* exofs_init_comps will initialize an exofs_components device array
* pointing to a single exofs_comp struct, and a round-robin view
/* exofs_init_comps will initialize an ore_components device array
* pointing to a single ore_comp struct, and a round-robin view
* of the device table.
* The first device of each inode is the [inode->ino % num_devices]
* and the rest of the devices sequentially following where the
Expand All @@ -302,8 +207,8 @@ extern const struct inode_operations exofs_fast_symlink_inode_operations;
* bigger and that the device table repeats twice.
* See: exofs_read_lookup_dev_table()
*/
static inline void exofs_init_comps(struct exofs_components *comps,
struct exofs_comp *one_comp,
static inline void exofs_init_comps(struct ore_components *comps,
struct ore_comp *one_comp,
struct exofs_sb_info *sbi, osd_id oid)
{
unsigned dev_mod = (unsigned)oid, first_dev;
Expand Down
Loading

0 comments on commit 5fca90b

Please sign in to comment.