kernels/linux-2.4.0/fs/smbfs/proc.c
/*
 * Called with the server locked. Because of bugs in the
 * core protocol, we use this only to set attributes. See
 * smb_proc_settime() below for timestamp handling.
 *
 * Bugs Noted:
 * (1) If mtime is non-zero, both Win 3.1 and Win 95 fail
 * with an undocumented error (ERRDOS code 50). Setting
 * mtime to 0 allows the attributes to be set.
 * (2) The extra parameters following the name string aren't
 * in the CIFS docs, but seem to be necessary for operation.
 */
Called with the server locked. Because of bugs in the
core protocol, we use this only to set attributes. See
smb_proc_settime() below for timestamp handling.

Bugs Noted:
(1) If mtime is non-zero, both Win 3.1 and Win 95 fail
with an undocumented error (ERRDOS code 50). Setting
mtime to 0 allows the attributes to be set.
(2) The extra parameters following the name string aren't
in the CIFS docs, but seem to be necessary for operation.
Called with the server locked . Because of bugs in the core protocol we use this only to set attributes . See smb_proc_settime () below for timestamp handling . Bugs Noted : ( 1 ) If mtime is non - zero both Win 3 . 1 and Win 95 fail with an undocumented error ( ERRDOS code 50 ) . Setting mtime to 0 allows the attributes to be set . ( 2 ) The extra parameters following the name string aren ' t in the CIFS docs but seem to be necessary for operation .
static int
smb_proc_setattr_core(struct smb_sb_info *server, struct dentry *dentry,
		      __u16 attr)
{
	char *p;
	int result;
      retry:
	p = smb_setup_header(server, SMBsetatr, 8, 0);
	WSET(server->packet, smb_vwv0, attr);
	DSET(server->packet, smb_vwv1, 0); 
	WSET(server->packet, smb_vwv3, 0); 
	WSET(server->packet, smb_vwv4, 0);
	WSET(server->packet, smb_vwv5, 0);
	WSET(server->packet, smb_vwv6, 0);
	WSET(server->packet, smb_vwv7, 0);
	*p++ = 4;
	result = smb_encode_path(server, p, dentry, NULL);
	if (result < 0)
		goto out;
	p += result;
	*p++ = 4;
	*p++ = 0;
	smb_setup_bcc(server, p);
	result = smb_request_ok(server, SMBsetatr, 0, 0);
	if (result < 0) {
		if (smb_retry(server))
			goto retry;
		goto out;
	}
	result = 0;
out:
	return result;
}
static int smb_proc_setattr_core ( struct smb_sb_info * server , struct dentry * dentry , __u16 attr ) { char * p ; int result ; retry : p = smb_setup_header ( server , SMBsetatr , 8 , 0 ) ; WSET ( server -> packet , smb_vwv0 , attr ) ; DSET ( server -> packet , smb_vwv1 , 0 ) ; WSET ( server -> packet , smb_vwv3 , 0 ) ; WSET ( server -> packet , smb_vwv4 , 0 ) ; WSET ( server -> packet , smb_vwv5 , 0 ) ; WSET ( server -> packet , smb_vwv6 , 0 ) ; WSET ( server -> packet , smb_vwv7 , 0 ) ; * p ++ = 4 ; result = smb_encode_path ( server , p , dentry , NULL ) ; if ( result < 0 ) goto out ; p += result ; * p ++ = 4 ; * p ++ = 0 ; smb_setup_bcc ( server , p ) ; result = smb_request_ok ( server , SMBsetatr , 0 , 0 ) ; if ( result < 0 ) { if ( smb_retry ( server ) ) goto retry ; goto out ; } result = 0 ; out : return result ; }
Called with the server locked.
Called with the server locked .
/* mtime */ /* reserved values */