summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorUrban Widmark <urban@teststation.com>2002-09-29 02:02:49 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-29 02:02:49 -0700
commit62c4f318c08bc37fee233cd940111ec81bbefe9e (patch)
tree527534b98b19b1cfbd119cbe1b9f30520edb10ee /include
parentadd283989e10afc720bc5db3358e7c0d95d6765b (diff)
[PATCH] SMB Unix Extensions
This patch adds symlinks, hardlinks, device nodes, uid/gid, unix permissions vs servers that support it (ie samba). Most of this is the work of John Newbigin, I just modified it for 2.5. There are issues with what samba allows (eg you can't make arbitrary symlinks) and room for improvements (use the servers value for ino?). But it doesn't affect "normal" users.
Diffstat (limited to 'include')
-rw-r--r--include/linux/smb.h3
-rw-r--r--include/linux/smb_fs.h27
-rw-r--r--include/linux/smbno.h32
3 files changed, 48 insertions, 14 deletions
diff --git a/include/linux/smb.h b/include/linux/smb.h
index 5b8dce292377..9e4944b6121f 100644
--- a/include/linux/smb.h
+++ b/include/linux/smb.h
@@ -76,7 +76,6 @@ struct smb_nls_codepage {
* Contains all relevant data on a SMB networked file.
*/
struct smb_fattr {
-
__u16 attr;
unsigned long f_ino;
@@ -84,12 +83,14 @@ struct smb_fattr {
nlink_t f_nlink;
uid_t f_uid;
gid_t f_gid;
+ dev_t f_rdev;
loff_t f_size;
time_t f_atime;
time_t f_mtime;
time_t f_ctime;
unsigned long f_blksize;
unsigned long f_blocks;
+ int f_unix;
};
enum smb_conn_state {
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index be0f419928bc..41f9cd84c0b9 100644
--- a/include/linux/smb_fs.h
+++ b/include/linux/smb_fs.h
@@ -112,19 +112,20 @@ smb_kfree(void *obj)
/* NT1 protocol capability bits */
-#define SMB_CAP_RAW_MODE 0x0001
-#define SMB_CAP_MPX_MODE 0x0002
-#define SMB_CAP_UNICODE 0x0004
-#define SMB_CAP_LARGE_FILES 0x0008
-#define SMB_CAP_NT_SMBS 0x0010
-#define SMB_CAP_RPC_REMOTE_APIS 0x0020
-#define SMB_CAP_STATUS32 0x0040
-#define SMB_CAP_LEVEL_II_OPLOCKS 0x0080
-#define SMB_CAP_LOCK_AND_READ 0x0100
-#define SMB_CAP_NT_FIND 0x0200
-#define SMB_CAP_DFS 0x1000
-#define SMB_CAP_LARGE_READX 0x4000
-#define SMB_CAP_LARGE_WRITEX 0x8000
+#define SMB_CAP_RAW_MODE 0x00000001
+#define SMB_CAP_MPX_MODE 0x00000002
+#define SMB_CAP_UNICODE 0x00000004
+#define SMB_CAP_LARGE_FILES 0x00000008
+#define SMB_CAP_NT_SMBS 0x00000010
+#define SMB_CAP_RPC_REMOTE_APIS 0x00000020
+#define SMB_CAP_STATUS32 0x00000040
+#define SMB_CAP_LEVEL_II_OPLOCKS 0x00000080
+#define SMB_CAP_LOCK_AND_READ 0x00000100
+#define SMB_CAP_NT_FIND 0x00000200
+#define SMB_CAP_DFS 0x00001000
+#define SMB_CAP_LARGE_READX 0x00004000
+#define SMB_CAP_LARGE_WRITEX 0x00008000
+#define SMB_CAP_UNIX 0x00800000 /* unofficial ... */
/*
diff --git a/include/linux/smbno.h b/include/linux/smbno.h
index c1495bba359f..c202e2d6cb80 100644
--- a/include/linux/smbno.h
+++ b/include/linux/smbno.h
@@ -328,4 +328,36 @@
#define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000
#define SMB_FLAGS2_UNICODE_STRINGS 0x8000
+
+/*
+ * UNIX stuff (from samba trans2.h)
+ */
+#define MIN_UNIX_INFO_LEVEL 0x200
+#define MAX_UNIX_INFO_LEVEL 0x2FF
+#define SMB_FIND_FILE_UNIX 0x202
+#define SMB_QUERY_FILE_UNIX_BASIC 0x200
+#define SMB_QUERY_FILE_UNIX_LINK 0x201
+#define SMB_QUERY_FILE_UNIX_HLINK 0x202
+#define SMB_SET_FILE_UNIX_BASIC 0x200
+#define SMB_SET_FILE_UNIX_LINK 0x201
+#define SMB_SET_FILE_UNIX_HLINK 0x203
+#define SMB_QUERY_CIFS_UNIX_INFO 0x200
+
+/* values which means "don't change it" */
+#define SMB_MODE_NO_CHANGE 0xFFFFFFFF
+#define SMB_UID_NO_CHANGE 0xFFFFFFFF
+#define SMB_GID_NO_CHANGE 0xFFFFFFFF
+#define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFF
+#define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFF
+
+/* UNIX filetype mappings. */
+#define UNIX_TYPE_FILE 0
+#define UNIX_TYPE_DIR 1
+#define UNIX_TYPE_SYMLINK 2
+#define UNIX_TYPE_CHARDEV 3
+#define UNIX_TYPE_BLKDEV 4
+#define UNIX_TYPE_FIFO 5
+#define UNIX_TYPE_SOCKET 6
+#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
+
#endif /* _SMBNO_H_ */