From: ericm Date: Tue, 25 Nov 2003 11:33:55 +0000 (+0000) Subject: merge b_devel to b_eq: 20031125. kernel part only. X-Git-Tag: v1_7_110~2^11~60 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=36808dbabda7395fb5458c4b63226face2cd6206;p=fs%2Flustre-release.git merge b_devel to b_eq: 20031125. kernel part only. --- diff --git a/lustre/include/linux/lustre_log.h b/lustre/include/linux/lustre_log.h index c6cbd64..fdc2255 100644 --- a/lustre/include/linux/lustre_log.h +++ b/lustre/include/linux/lustre_log.h @@ -55,7 +55,7 @@ struct cat_handle_data { /* In-memory descriptor for a log object or log catalog */ struct llog_handle { - struct semaphore lgh_lock; + struct rw_semaphore lgh_lock; struct llog_logid lgh_id; /* id of this log */ struct llog_log_hdr *lgh_hdr; struct file *lgh_file; @@ -116,6 +116,11 @@ int obd_llog_init(struct obd_device *obd, struct obd_device *disk_obd, int obd_llog_finish(struct obd_device *obd, int count); +/* llog_ioctl.c */ +int llog_ioctl(struct llog_ctxt *ctxt, int cmd, struct obd_ioctl_data *data); +int llog_catlog_list(struct obd_device *obd, int count, + struct obd_ioctl_data *data); + /* llog_net.c */ int llog_initiator_connect(struct llog_ctxt *ctxt); int llog_receptor_accept(struct llog_ctxt *ctxt, struct obd_import *imp); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 4e3210d..deaa355 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -26,11 +26,10 @@ #include #include #include + #include #include #include -#include -#include #include #include "llite_internal.h" @@ -174,6 +173,12 @@ int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc) GOTO(out_root, err = -EBADF); } + err = ll_close_thread_start(&sbi->ll_lcq); + if (err) { + CERROR("cannot start close thread: rc %d\n", err); + GOTO(out_root, err); + } + sb->s_root = d_alloc_root(root); RETURN(err); @@ -195,6 +200,8 @@ void lustre_common_put_super(struct super_block *sb) struct hlist_node *tmp, *next; ENTRY; + ll_close_thread_shutdown(sbi->ll_lcq); + list_del(&sbi->ll_conn_chain); obd_disconnect(sbi->ll_osc_exp, 0); @@ -291,6 +298,8 @@ void ll_lli_init(struct ll_inode_info *lli) sema_init(&lli->lli_open_sem, 1); lli->lli_flags = 0; lli->lli_maxbytes = PAGE_CACHE_MAXBYTES; + spin_lock_init(&lli->lli_lock); + INIT_LIST_HEAD(&lli->lli_pending_write_llaps); } int ll_fill_super(struct super_block *sb, void *data, int silent) @@ -512,6 +521,7 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent) cfg.cfg_instance = sbi->ll_instance; cfg.cfg_uuid = sbi->ll_sb_uuid; + cfg.cfg_local_nid = lmd->lmd_local_nid; err = lustre_process_log(lmd, lmd->lmd_profile, &cfg); if (err < 0) { CERROR("Unable to process log: %s\n", lmd->lmd_profile); @@ -812,7 +822,7 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) /* XXX when we fix the AST intents to pass the discard-range * XXX extent, make ast_flags always LDLM_AST_DISCARD_DATA * XXX here. */ - if (extent.start == 0) + if (attr->ia_size == 0) ast_flags = LDLM_AST_DISCARD_DATA; /* bug 1639: avoid write/truncate i_sem/DLM deadlock */ @@ -829,6 +839,8 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) set_bit(LLI_F_HAVE_OST_SIZE_LOCK, &ll_i2info(inode)->lli_flags); + //ll_try_done_writing(inode); + /* unlock now as we don't mind others file lockers racing with * the mds updates below? */ err = ll_extent_unlock(NULL, inode, lsm, LCK_PW, &lockh); @@ -1058,6 +1070,18 @@ void ll_read_inode2(struct inode *inode, void *opaque) kdev_t_to_nr(inode->i_rdev)); #else init_special_inode(inode, inode->i_mode, inode->i_rdev); + + lli->ll_save_ifop = inode->i_fop; + if (S_ISCHR(inode->i_mode)) { + inode->i_fop = &ll_special_chr_inode_fops; + }else if (S_ISBLK(inode->i_mode)) { + inode->i_fop = &ll_special_blk_inode_fops; + }else if (S_ISFIFO(inode->i_mode)){ + inode->i_fop = &ll_special_fifo_inode_fops; + }else if (S_ISSOCK(inode->i_mode)){ + inode->i_fop = &ll_special_sock_inode_fops; + } + inode->i_fop->owner = lli->ll_save_ifop->owner; #endif EXIT; } diff --git a/lustre/lov/lov_internal.h b/lustre/lov/lov_internal.h index 672a546..6c26a16 100644 --- a/lustre/lov/lov_internal.h +++ b/lustre/lov/lov_internal.h @@ -7,6 +7,11 @@ * See the file COPYING in this distribution */ +#ifndef LOV_INTERNAL_H +#define LOV_INTERNAL_H + +#include + #define LAP_MAGIC 8200 struct lov_async_page { @@ -41,3 +46,5 @@ int lov_getstripe(struct obd_export *exp, /* lproc_lov.c */ extern struct file_operations lov_proc_target_fops; + +#endif diff --git a/lustre/obdfilter/filter_internal.h b/lustre/obdfilter/filter_internal.h index d5bb1ea..da8faa3 100644 --- a/lustre/obdfilter/filter_internal.h +++ b/lustre/obdfilter/filter_internal.h @@ -52,8 +52,7 @@ /* Data stored per server at the head of the last_rcvd file. In le32 order. * Try to keep this the same as mds_server_data so we might one day merge. */ struct filter_server_data { - __u8 fsd_uuid[37]; /* server UUID */ - __u8 fsd_uuid_padding[3]; /* unused */ + __u8 fsd_uuid[40]; /* server UUID */ __u64 fsd_unused; /* was fsd_last_objid - don't use for now */ __u64 fsd_last_transno; /* last completed transaction ID */ __u64 fsd_mount_count; /* FILTER incarnation number */ @@ -66,15 +65,13 @@ struct filter_server_data { __u16 fsd_subdir_count; /* number of subdirectories for objects */ __u64 fsd_catalog_oid; /* recovery catalog object id */ __u32 fsd_catalog_ogen; /* recovery catalog inode generation */ - __u8 fsd_peeruuid[37]; /* UUID of MDS associated with this OST */ - __u8 peer_padding[3]; /* unused */ + __u8 fsd_peeruuid[40]; /* UUID of MDS associated with this OST */ __u8 fsd_padding[FILTER_LR_SERVER_SIZE - 140]; }; /* Data stored per client in the last_rcvd file. In le32 order. */ struct filter_client_data { - __u8 fcd_uuid[37]; /* client UUID */ - __u8 fcd_uuid_padding[3]; /* unused */ + __u8 fcd_uuid[40]; /* client UUID */ __u64 fcd_last_rcvd; /* last completed transaction ID */ __u64 fcd_mount_count; /* FILTER incarnation number */ __u64 fcd_last_xid; /* client RPC xid for the last transaction */ diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index 2b3dd1d..1ce8825 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -241,6 +241,7 @@ static int filter_start_page_write(struct inode *inode, CERROR("no memory for a temp page\n"); RETURN(lnb->rc = -ENOMEM); } + POISON_PAGE(page, 0xf1); page->index = lnb->offset >> PAGE_SHIFT; lnb->page = page;