X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdfilter%2Ffilter_internal.h;h=d6140a76b4d39795314a5b1c68b998072a1dd3b9;hb=d2ec13308d6dc936a9d8c624aad3c80f2d90c678;hp=055232d04148d48dec098ff2e1b9a438bcc0af35;hpb=7ce2000eb0f4e7b7ea1f362c17099881098cfef7;p=fs%2Flustre-release.git diff --git a/lustre/obdfilter/filter_internal.h b/lustre/obdfilter/filter_internal.h index 055232d..d6140a7 100644 --- a/lustre/obdfilter/filter_internal.h +++ b/lustre/obdfilter/filter_internal.h @@ -16,16 +16,6 @@ #include #include -#define FILTER_LAYOUT_VERSION "2" - -#ifndef OBD_FILTER_DEVICENAME -# define OBD_FILTER_DEVICENAME "obdfilter" -#endif - -#ifndef OBD_FILTER_SAN_DEVICENAME -# define OBD_FILTER_SAN_DEVICENAME "sanobdfilter" -#endif - #define LAST_RCVD "last_rcvd" #define FILTER_INIT_OBJID 0 @@ -36,10 +26,6 @@ /* This limit is arbitrary, but for now we fit it in 1 page (32k clients) */ #define FILTER_LR_MAX_CLIENTS (PAGE_SIZE * 8) -#define FILTER_LR_MAX_CLIENT_WORDS (FILTER_LR_MAX_CLIENTS/sizeof(unsigned long)) - -#define FILTER_SUBDIR_COUNT 32 /* set to zero for no subdirs */ -#define FILTER_GROUPS 3 /* must be at least 3; not dynamic yet */ #define FILTER_RECOVERY_TIMEOUT (obd_timeout * 5 * HZ / 2) /* *waves hands* */ @@ -75,7 +61,8 @@ struct filter_client_data { __u8 fcd_uuid[40]; /* client UUID */ __u64 fcd_last_rcvd; /* last completed transaction ID */ __u64 fcd_last_xid; /* client RPC xid for the last transaction */ - __u8 fcd_padding[FILTER_LR_CLIENT_SIZE - 56]; + __u32 fcd_group; /* client group num*/ + __u8 fcd_padding[FILTER_LR_CLIENT_SIZE - 60]; }; #define FILTER_DENTRY_MAGIC 0x9efba101 @@ -92,25 +79,41 @@ enum { LPROC_FILTER_LAST, }; -#define FILTER_MAX_CACHE_SIZE OBD_OBJECT_EOF +#define FILTER_MAX_CACHE_SIZE (32 * 1024 * 1024) /* was OBD_OBJECT_EOF */ + +/* We have to pass a 'created' array to fsfilt_map_inode_pages() which we + * then ignore. So we pre-allocate one that everyone can use... */ +#define OBDFILTER_CREATED_SCRATCHPAD_ENTRIES 1024 +extern int *obdfilter_created_scratchpad; /* filter.c */ void f_dput(struct dentry *); -struct dentry *filter_fid2dentry(struct obd_device *, struct dentry *dir, - obd_gr group, obd_id id); +struct dentry *filter_id2dentry(struct obd_device *, struct dentry *dir, + obd_gr group, obd_id id); struct dentry *__filter_oa2dentry(struct obd_device *obd, struct obdo *oa, const char *what); #define filter_oa2dentry(obd, oa) __filter_oa2dentry(obd, oa, __FUNCTION__) int filter_finish_transno(struct obd_export *, struct obd_trans_info *, int rc); -__u64 filter_next_id(struct filter_obd *, struct obdo *); -__u64 filter_last_id(struct filter_obd *, struct obdo *); +__u64 filter_next_id(struct filter_obd *, int group); +__u64 filter_last_id(struct filter_obd *, int group); int filter_update_server_data(struct obd_device *, struct file *, struct filter_server_data *, int force_sync); int filter_update_last_objid(struct obd_device *, obd_gr, int force_sync); int filter_common_setup(struct obd_device *, obd_count len, void *buf, char *option); +struct dentry *filter_crow_object(struct obd_device *obd, struct obdo *oa); + +int filter_setattr_internal(struct obd_export *exp, struct dentry *dentry, + struct obdo *oa, struct obd_trans_info *oti); + +int filter_setattr(struct obd_export *exp, struct obdo *oa, + struct lov_stripe_md *md, struct obd_trans_info *oti, + struct lustre_capa *capa); + +int filter_create_object(struct obd_device *obd, struct obdo *oa); + /* filter_lvb.c */ extern struct ldlm_valblock_ops filter_lvbo; @@ -118,18 +121,23 @@ extern struct ldlm_valblock_ops filter_lvbo; /* filter_io.c */ int filter_preprw(int cmd, struct obd_export *, struct obdo *, int objcount, struct obd_ioobj *, int niocount, struct niobuf_remote *, - struct niobuf_local *, struct obd_trans_info *); + struct niobuf_local *, struct obd_trans_info *, + struct lustre_capa *capa); int filter_commitrw(int cmd, struct obd_export *, struct obdo *, int objcount, struct obd_ioobj *, int niocount, struct niobuf_local *, struct obd_trans_info *, int rc); +int filter_write_extents(struct obd_export *exp, struct obd_ioobj *obj, + int objcount, int niocount,struct niobuf_local *local, + int rc); +int filter_do_cow(struct obd_export *exp, struct obd_ioobj *obj, + int nioo, struct niobuf_remote *rnb); int filter_brw(int cmd, struct obd_export *, struct obdo *, struct lov_stripe_md *, obd_count oa_bufs, struct brw_page *, struct obd_trans_info *); void flip_into_page_cache(struct inode *inode, struct page *new_page); -void filter_release_read_page(struct filter_obd *filter, struct inode *inode, - struct page *page); -void filter_release_write_page(struct filter_obd *filter, struct inode *inode, - struct niobuf_local *lnb, int rc); + +void filter_free_dio_pages(int objcount, struct obd_ioobj *obj, + int niocount, struct niobuf_local *res); /* filter_io_*.c */ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount, @@ -142,15 +150,24 @@ long filter_grant(struct obd_export *exp, obd_size current_grant, void filter_grant_commit(struct obd_export *exp, int niocount, struct niobuf_local *res); +int filter_alloc_iobuf(int rw, int num_pages, void **ret); +void filter_free_iobuf(void *iobuf); +int filter_iobuf_add_page(struct obd_device *obd, void *iobuf, + struct inode *inode, struct page *page); +int filter_direct_io(int rw, struct dentry *dchild, void *iobuf, + struct obd_export *exp, struct iattr *attr, + struct obd_trans_info *oti, void **wait_handle); + /* filter_log.c */ struct ost_filterdata { __u32 ofd_epoch; }; -int filter_log_sz_change(struct llog_handle *cathandle, - struct ll_fid *mds_fid, - __u32 io_epoch, - struct llog_cookie *logcookie, + +int filter_log_sz_change(struct obd_device *obd, + struct lustre_id *id, __u32 io_epoch, + struct llog_cookie *logcookie, struct inode *inode); + //int filter_get_catalog(struct obd_device *); void filter_cancel_cookies_cb(struct obd_device *obd, __u64 transno, void *cb_data, int error); @@ -179,5 +196,12 @@ static inline void filter_tally_read(struct filter_obd *filter, static inline lproc_filter_attach_seqstat(struct obd_device *dev) {} #endif +/* filter_capa.c */ +int filter_init_capa_keys(struct obd_device *obd); +void filter_free_capa_keys(struct filter_obd *filter); +int filter_update_capa_key(struct obd_device *obd, struct lustre_capa_key *key); +int filter_verify_capa(int cmd, struct obd_export *exp, struct lustre_capa *capa); +int filter_verify_fid(struct obd_export *exp, struct inode *inode, + struct lustre_capa *capa); #endif