Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5837ea27
Commit
5837ea27
authored
Jun 01, 2004
by
Steve French
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://cifs.bkbits.net/linux-2.5cifs
into steveft21.ltcsamba:/usr/src/bk/linux-2.5cifs
parents
390bb9ba
ca2c8ae5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
20 deletions
+107
-20
fs/cifs/cifspdu.h
fs/cifs/cifspdu.h
+37
-17
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+3
-0
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+50
-2
fs/cifs/fcntl.c
fs/cifs/fcntl.c
+17
-1
No files found.
fs/cifs/cifspdu.h
View file @
5837ea27
...
...
@@ -862,6 +862,10 @@ typedef struct smb_com_create_directory_rsp {
__u16
ByteCount
;
/* bct = 0 */
}
CREATE_DIRECTORY_RSP
;
/***************************************************/
/* NT Transact structure defintions follow */
/* Currently only ioctl and notify are implemented */
/***************************************************/
typedef
struct
smb_com_transaction_ioctl_req
{
struct
smb_hdr
hdr
;
/* wct = 23 */
__u8
MaxSetupCount
;
...
...
@@ -904,29 +908,45 @@ typedef struct smb_com_transaction_ioctl_rsp {
}
TRANSACT_IOCTL_RSP
;
typedef
struct
smb_com_transaction_change_notify_req
{
struct
smb_hdr
hdr
;
/* wct = 23 */
__u8
MaxSetupCount
;
__u16
Reserved
;
__u32
TotalParameterCount
;
__u32
TotalDataCount
;
__u32
MaxParameterCount
;
__u32
MaxDataCount
;
__u32
ParameterCount
;
__u32
ParameterOffset
;
__u32
DataCount
;
__u32
DataOffset
;
__u8
SetupCount
;
/* four setup words follow subcommand */
/* SNIA spec incorrectly included spurious pad here */
__u16
SubCommand
;
/* 4 = Change Notify */
struct
smb_hdr
hdr
;
/* wct = 23 */
__u8
MaxSetupCount
;
__u16
Reserved
;
__u32
TotalParameterCount
;
__u32
TotalDataCount
;
__u32
MaxParameterCount
;
__u32
MaxDataCount
;
__u32
ParameterCount
;
__u32
ParameterOffset
;
__u32
DataCount
;
__u32
DataOffset
;
__u8
SetupCount
;
/* four setup words follow subcommand */
/* SNIA spec incorrectly included spurious pad here */
__u16
SubCommand
;
/* 4 = Change Notify */
__u32
CompletionFilter
;
/* operation to monitor */
__u16
Fid
;
__u8
WatchTree
;
/* 1 = Monitor subdirectories */
__u8
Reserved2
;
__u16
ByteCount
;
__u8
Pad
[
3
];
__u8
Data
[
1
];
/* __u8 Pad[3];*/
/* __u8 Data[1];*/
}
TRANSACT_CHANGE_NOTIFY_REQ
;
/* Completion Filter flags */
typedef
struct
smb_com_transaction_change_notify_rsp
{
struct
smb_hdr
hdr
;
/* wct = 18 */
__u8
Reserved
[
3
];
__u32
TotalParameterCount
;
__u32
TotalDataCount
;
__u32
ParameterCount
;
__u32
ParameterOffset
;
__u32
ParameterDisplacement
;
__u32
DataCount
;
__u32
DataOffset
;
__u32
DataDisplacement
;
__u8
SetupCount
;
/* 0 */
__u16
ByteCount
;
/* __u8 Pad[3]; */
}
TRANSACT_CHANGE_NOTIFY_RSP
;
/* Completion Filter flags for Notify */
#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
#define FILE_NOTIFY_CHANGE_NAME 0x00000003
...
...
fs/cifs/cifsproto.h
View file @
5837ea27
...
...
@@ -244,4 +244,7 @@ extern int CIFSSMBCopy(int xid,
const
__u16
target_tid
,
const
char
*
toName
,
const
int
flags
,
const
struct
nls_table
*
nls_codepage
);
extern
int
CIFSSMBNotify
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
int
notify_subdirs
,
const
__u16
netfid
,
__u32
filter
,
const
struct
nls_table
*
nls_codepage
);
#endif
/* _CIFSPROTO_H */
fs/cifs/cifssmb.c
View file @
5837ea27
...
...
@@ -1464,9 +1464,9 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
pSMB
->
TotalParameterCount
=
0
;
pSMB
->
TotalDataCount
=
0
;
pSMB
->
MaxParameterCount
=
cpu_to_le
16
(
2
);
pSMB
->
MaxParameterCount
=
cpu_to_le
32
(
2
);
/* BB find exact data count max from sess structure BB */
pSMB
->
MaxDataCount
=
cpu_to_le
16
(
4000
);
pSMB
->
MaxDataCount
=
cpu_to_le
32
(
4000
);
pSMB
->
MaxSetupCount
=
4
;
pSMB
->
Reserved
=
0
;
pSMB
->
ParameterOffset
=
0
;
...
...
@@ -2828,3 +2828,51 @@ CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
goto
setPermsRetry
;
return
rc
;
}
int
CIFSSMBNotify
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
int
notify_subdirs
,
const
__u16
netfid
,
__u32
filter
,
const
struct
nls_table
*
nls_codepage
)
{
int
rc
=
0
;
struct
smb_com_transaction_change_notify_req
*
pSMB
=
NULL
;
struct
smb_com_transaction_change_notify_rsp
*
pSMBr
=
NULL
;
int
bytes_returned
;
cFYI
(
1
,
(
"In CIFSSMBNotify for file handle %d"
,(
int
)
netfid
));
rc
=
smb_init
(
SMB_COM_NT_TRANSACT
,
23
,
tcon
,
(
void
**
)
&
pSMB
,
(
void
**
)
&
pSMBr
);
if
(
rc
)
return
rc
;
pSMB
->
TotalParameterCount
=
0
;
pSMB
->
TotalDataCount
=
0
;
pSMB
->
MaxParameterCount
=
cpu_to_le32
(
2
);
/* BB find exact data count max from sess structure BB */
pSMB
->
MaxDataCount
=
0
;
/* same in little endian or be */
pSMB
->
MaxSetupCount
=
4
;
pSMB
->
Reserved
=
0
;
pSMB
->
ParameterOffset
=
0
;
pSMB
->
DataCount
=
0
;
pSMB
->
DataOffset
=
0
;
pSMB
->
SetupCount
=
4
;
/* single byte does not need le conversion */
pSMB
->
SubCommand
=
cpu_to_le16
(
NT_TRANSACT_NOTIFY_CHANGE
);
pSMB
->
ParameterCount
=
pSMB
->
TotalParameterCount
;
if
(
notify_subdirs
)
pSMB
->
WatchTree
=
1
;
/* one byte - no le conversion needed */
pSMB
->
Reserved2
=
0
;
pSMB
->
CompletionFilter
=
cpu_to_le32
(
filter
);
pSMB
->
Fid
=
netfid
;
/* file handle always le */
pSMB
->
ByteCount
=
0
;
pSMB
->
hdr
.
smb_buf_length
+=
pSMB
->
ByteCount
;
rc
=
SendReceive
(
xid
,
tcon
->
ses
,
(
struct
smb_hdr
*
)
pSMB
,
(
struct
smb_hdr
*
)
pSMBr
,
&
bytes_returned
,
0
);
if
(
rc
)
{
cFYI
(
1
,
(
"Error in Notify = %d"
,
rc
));
}
if
(
pSMB
)
cifs_buf_release
(
pSMB
);
/* if (rc == -EAGAIN)
goto NotifyRetry; */
return
rc
;
}
fs/cifs/fcntl.c
View file @
5837ea27
...
...
@@ -32,9 +32,12 @@ int cifs_directory_notify(unsigned long arg, struct file * file)
{
int
xid
;
int
rc
=
-
EINVAL
;
int
oplock
=
FALSE
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifsTconInfo
*
pTcon
;
char
*
full_path
=
NULL
;
__u32
filter
=
FILE_NOTIFY_CHANGE_NAME
|
FILE_NOTIFY_CHANGE_ATTRIBUTES
;
__u16
netfid
;
xid
=
GetXid
();
cifs_sb
=
CIFS_SB
(
file
->
f_dentry
->
d_sb
);
...
...
@@ -48,7 +51,20 @@ int cifs_directory_notify(unsigned long arg, struct file * file)
rc
=
-
ENOMEM
;
}
else
{
cFYI
(
1
,(
"cifs dir notify on file %s"
,
full_path
));
/* CIFSSMBNotify(xid, pTcon, full_path, cifs_sb->local_nls);*/
rc
=
CIFSSMBOpen
(
xid
,
pTcon
,
full_path
,
FILE_OPEN
,
GENERIC_READ
|
SYNCHRONIZE
,
0
/* create options */
,
&
netfid
,
&
oplock
,
NULL
,
cifs_sb
->
local_nls
);
/* BB fixme - add this handle to a notify handle list */
if
(
rc
)
{
cFYI
(
1
,(
"Could not open directory for notify"
));
}
else
{
rc
=
CIFSSMBNotify
(
xid
,
pTcon
,
1
/* subdirs */
,
netfid
,
filter
,
cifs_sb
->
local_nls
);
/* BB add code to close file eventually (at unmount
it would close automatically but may be a way
to do it easily when inode freed or when
notify info is cleared/changed */
}
}
FreeXid
(
xid
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment