[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] cluster/gfs-kernel/src/gfs inode.h ops_export.c



Hi,

Just wondering why this:

On Tue, 2007-01-16 at 20:39 +0000, wcheng sourceware org wrote:
[snip]
> --- cluster/gfs-kernel/src/gfs/ops_export.c	2007/01/11 18:52:18	1.3.2.2
> +++ cluster/gfs-kernel/src/gfs/ops_export.c	2007/01/16 20:39:03	1.3.2.3
> @@ -280,62 +280,57 @@
>  }
>  
>  /**
> - * gfs_get_dentry -
> - * @param1: description
> - * @param2: description
> - * @param3: description
> + * gfs_refresh_iobj -
> + *  @sdp: pointer to struct gfs_sbd
> + *  @inum: pointer to struct gfs_inum
> + *  @refresh: set to true if inode refreshed
> + *  return: pointer to struct inode or errno
>   *
> - * Function description
> + *  This function was part of gfs_get_dentry where it
> + *  - allocated a gfs_inode "ip"
> + *  - disk-read in "ip"
> + *  - allocated a vfs inode for this "ip".
>   *
> - * Returns: what is returned
> + *  We yank it out to allow gfs_rename() to re-use
> + *  this logic.
>   */
>  
> -struct dentry *
> -gfs_get_dentry(struct super_block *sb, void *inump)
> +struct inode *gfs_refresh_iobj(struct gfs_sbd *sdp, void *inum_obj, int *miss)
>  {
> -	struct gfs_sbd *sdp = vfs2sdp(sb);
> -	struct inode_cookie *cookie = (struct inode_cookie *)inump;
> -	struct gfs_inum inum;
>  	struct gfs_holder i_gh, ri_gh, rgd_gh;
>  	struct gfs_rgrpd *rgd;
>  	struct buffer_head *bh;
>  	struct gfs_dinode *di;
>  	struct gfs_inode *ip;
>  	struct inode *inode;
> -	struct dentry *dentry;
> +	struct gfs_inum *inum = (struct gfs_inum *) inum_obj;
>  	int error;
>  
> -	atomic_inc(&sdp->sd_ops_export);
> -
> -	if (!cookie->formal_ino ||
> -	    cookie->formal_ino == sdp->sd_jiinode->i_num.no_formal_ino ||
> -	    cookie->formal_ino == sdp->sd_riinode->i_num.no_formal_ino ||
> -	    cookie->formal_ino == sdp->sd_qinode->i_num.no_formal_ino ||
> -	    cookie->formal_ino == sdp->sd_linode->i_num.no_formal_ino)
> -		return ERR_PTR(-EINVAL);
> -
> -	inum.no_formal_ino = cookie->formal_ino;
> -	inum.no_addr = cookie->formal_ino;
> -
>  	error = gfs_glock_nq_num(sdp,
> -				 inum.no_formal_ino, &gfs_inode_glops,
> +				 inum->no_formal_ino, &gfs_inode_glops,
>  				 LM_ST_SHARED, LM_FLAG_ANY | GL_LOCAL_EXCL,
>  				 &i_gh);
needs the GL_LOCAL_EXCL flag. I would have thought an ordinary shared
lock would be enough?

In GFS2 I'd like to try and eliminate this flag since it would be just
as easy to use a combination of a mutex or rwsem and a glock to achieve
the same thing and it makes the glock code simpler. Its only used in
about three places anyway and I'm not so sure that its required at all
in this case,

Steve.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]