Re: [PATCH 01/45] CIFS: Make CAP_* checks protocol independent

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

 



On Wed, 18 Jul 2012 19:48:17 +0400
Pavel Shilovsky <pshilovsky@xxxxxxxxx> wrote:

> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -385,9 +385,8 @@ int cifs_open(struct inode *inode, struct file *file)
>  		oplock = 0;
>  
>  	if (!tcon->broken_posix_open && tcon->unix_ext &&
> -	    (tcon->ses->capabilities & CAP_UNIX) &&
> -	    (CIFS_UNIX_POSIX_PATH_OPS_CAP &
> -			le64_to_cpu(tcon->fsUnixInfo.Capability))) {
> +	    cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP &
> +				le64_to_cpu(tcon->fsUnixInfo.Capability))) {
>  		/* can not refresh inode info since size could be stale */
>  		rc = cifs_posix_open(full_path, &inode, inode->i_sb,
>  				cifs_sb->mnt_file_mode /* ignored */,

While I'm in general OK with abstracting out things like this with a
set of operations, I'm not sure it makes much sense to make things so
granular in the name of code-sharing

Would it be better for instance, to simply have a different f_ops->open
routine for SMB2, and simply check the right bit for CAP_UNIX in each
one?

-- 
Jeff Layton <jlayton@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux