Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: smfrench@gmail.com
Cc: linux-cifs@vger.kernel.org
Subject: Re: [PATCH 5/7] smb: client: allow creating special files via reparse points
Date: Wed, 22 Nov 2023 12:16:01 -0300	[thread overview]
Message-ID: <e18f51d8eca56a0f948ff6b9fa37f61c@manguebit.com> (raw)
In-Reply-To: <20231121231258.29562-5-pc@manguebit.com>

Paulo Alcantara <pc@manguebit.com> writes:

> +static int create_nfs_reparse(const unsigned int xid,
> +			      struct cifs_tcon *tcon,
> +			      struct cifs_sb_info *cifs_sb,
> +			      const char *full_path, mode_t mode,
> +			      struct reparse_posix_data *buf)
> +{
> +	u64 type;
> +	u16 len, dlen;
> +
> +	len = sizeof(*buf);
> +
> +	switch ((type = mode_nfs_type(mode))) {
> +	case NFS_SPECFILE_BLK:
> +	case NFS_SPECFILE_CHR:
> +		dlen = sizeof(__le64);
> +		break;
> +	case NFS_SPECFILE_FIFO:
> +	case NFS_SPECFILE_SOCK:
> +		dlen = 0;
> +		break;
> +	default:
> +		return -EOPNOTSUPP;
> +	}
> +
> +	buf->ReparseTag = cpu_to_le32(IO_REPARSE_TAG_NFS);
> +	buf->InodeType = cpu_to_le64(type);
> +	buf->ReparseDataLength = cpu_to_le16(len + dlen -
> +					     sizeof(struct reparse_data_buffer));

Err, forgot having @buf->Reserved set to 0 here, sorry.  MS-FSCC
doesnt't say we _must_ to, however it's better not sending garbage over
the wire.

Let me know if you'd need v2 for the above.

  reply	other threads:[~2023-11-22 15:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-19 18:22 [PATCH 1/3] smb: client: implement ->query_reparse_point() for SMB1 Paulo Alcantara
2023-11-19 18:22 ` [PATCH 2/3] smb: client: introduce ->parse_reparse_point() Paulo Alcantara
2023-11-19 18:22 ` [PATCH 3/3] smb: client: set correct file type from NFS reparse points Paulo Alcantara
2023-11-19 21:44 ` [PATCH v2 1/3] smb: client: implement ->query_reparse_point() for SMB1 Paulo Alcantara
2023-11-19 21:44   ` [PATCH v2 2/3] smb: client: introduce ->parse_reparse_point() Paulo Alcantara
2023-11-19 21:44   ` [PATCH v2 3/3] smb: client: set correct file type from NFS reparse points Paulo Alcantara
2023-11-20  5:49     ` Ralph Boehme
2023-11-20 14:17       ` Paulo Alcantara
2023-11-20 14:27         ` Ralph Boehme
2023-11-21 23:12 ` [PATCH 1/7] smb: client: implement ->query_reparse_point() for SMB1 Paulo Alcantara
2023-11-21 23:12   ` [PATCH 2/7] smb: client: introduce ->parse_reparse_point() Paulo Alcantara
2023-11-21 23:12   ` [PATCH 3/7] smb: client: set correct file type from NFS reparse points Paulo Alcantara
2023-11-21 23:12   ` [PATCH 4/7] smb: client: introduce cifs_sfu_make_node() Paulo Alcantara
2023-11-21 23:12   ` [PATCH 5/7] smb: client: allow creating special files via reparse points Paulo Alcantara
2023-11-22 15:16     ` Paulo Alcantara [this message]
2023-11-21 23:12   ` [PATCH 6/7] smb: client: allow creating symlinks " Paulo Alcantara
2023-11-21 23:12   ` [PATCH 7/7] smb: client: handle reparse points over SMB3 POSIX Paulo Alcantara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e18f51d8eca56a0f948ff6b9fa37f61c@manguebit.com \
    --to=pc@manguebit.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox