From: Lai Siyao Date: Tue, 3 Jun 2014 08:40:00 +0000 (+0800) Subject: LU-3544 nfs: don't store parent fid X-Git-Tag: 2.6.0-RC1~73 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=6512bfc74b152efd6bff748e60818db860df123d LU-3544 nfs: don't store parent fid It's not necessary to store parent fid in lli_pfid, because MDT can get it's parent fid from linkea, and now that DNE stripe directory stores master inode fid in lli_pfid, stop storing parent fid to avoid conflict. Signed-off-by: Lai Siyao Change-Id: I924c29a1d58b008026d37265978c81ca1aa21ebb Reviewed-on: http://review.whamcloud.com/10692 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: wangdi Reviewed-by: Nathaniel Clark Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 6111900..7f60bed 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -440,28 +440,6 @@ static int ll_intent_file_open(struct file *file, void *lmm, int lmmsize, op_data->op_data = lmm; op_data->op_data_size = lmmsize; - if (parent == de) { - /* - * Fixup for NFS export open. - * - * We're called in the context of NFS export, and parent - * unknown, use parent fid saved in lli_pfid which will - * be used by MDS to create data. - */ - struct ll_inode_info *lli = ll_i2info(de->d_inode); - - spin_lock(&lli->lli_lock); - op_data->op_fid1 = lli->lli_pfid; - spin_unlock(&lli->lli_lock); - - LASSERT(fid_is_sane(&op_data->op_fid1)); - /** We ignore parent's capability temporary. */ - if (op_data->op_capa1 != NULL) { - capa_put(op_data->op_capa1); - op_data->op_capa1 = NULL; - } - } - rc = md_intent_lock(sbi->ll_md_exp, op_data, itp, &req, &ll_md_blocking_ast, 0); ll_finish_md_op_data(op_data); diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index ab1a43d..2d992c1 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -135,34 +135,33 @@ struct ll_inode_info { struct hlist_head *lli_remote_perms; struct mutex lli_rmtperm_mutex; - /* identifying fields for both metadata and data stacks. */ - struct lu_fid lli_fid; - /* Parent fid for accessing default stripe data on parent directory - * for allocating OST objects after a mknod() and later open-by-FID. */ - struct lu_fid lli_pfid; + /* identifying fields for both metadata and data stacks. */ + struct lu_fid lli_fid; + /* master inode fid for stripe directory */ + struct lu_fid lli_pfid; struct list_head lli_close_list; struct list_head lli_oss_capas; /* open count currently used by capability only, indicate whether * capability needs renewal */ - atomic_t lli_open_count; - struct obd_capa *lli_mds_capa; - cfs_time_t lli_rmtperm_time; - - /* handle is to be sent to MDS later on done_writing and setattr. - * Open handle data are needed for the recovery to reconstruct - * the inode state on the MDS. XXX: recovery is not ready yet. */ - struct obd_client_handle *lli_pending_och; - - /* We need all three because every inode may be opened in different - * modes */ - struct obd_client_handle *lli_mds_read_och; - struct obd_client_handle *lli_mds_write_och; - struct obd_client_handle *lli_mds_exec_och; - __u64 lli_open_fd_read_count; - __u64 lli_open_fd_write_count; - __u64 lli_open_fd_exec_count; - /* Protects access to och pointers and their usage counters */ + atomic_t lli_open_count; + struct obd_capa *lli_mds_capa; + cfs_time_t lli_rmtperm_time; + + /* handle is to be sent to MDS later on done_writing and setattr. + * Open handle data are needed for the recovery to reconstruct + * the inode state on the MDS. XXX: recovery is not ready yet. */ + struct obd_client_handle *lli_pending_och; + + /* We need all three because every inode may be opened in different + * modes */ + struct obd_client_handle *lli_mds_read_och; + struct obd_client_handle *lli_mds_write_och; + struct obd_client_handle *lli_mds_exec_och; + __u64 lli_open_fd_read_count; + __u64 lli_open_fd_write_count; + __u64 lli_open_fd_exec_count; + /* Protects access to och pointers and their usage counters */ struct mutex lli_och_mutex; struct inode lli_vfs_inode; diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c index bc56fbf..8b1f2a6 100644 --- a/lustre/llite/llite_nfs.c +++ b/lustre/llite/llite_nfs.c @@ -142,19 +142,6 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren RETURN(result); } - /** - * In case d_obtain_alias() found a disconnected dentry, always update - * lli_pfid to allow later operation (normally open) have parent fid, - * which may be used by MDS to create data. - */ - if (parent != NULL) { - struct ll_inode_info *lli = ll_i2info(inode); - - spin_lock(&lli->lli_lock); - lli->lli_pfid = *parent; - spin_unlock(&lli->lli_lock); - } - RETURN(result); }