[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1969-ge0a6a34

Volker Lendecke vlendec at samba.org
Tue Jun 2 16:15:54 GMT 2009


The branch, master has been updated
       via  e0a6a344be326c58dc9307f286226f76f15f78e8 (commit)
      from  8d966fac41ff88f8c26c221fb03da4f9afba5897 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e0a6a344be326c58dc9307f286226f76f15f78e8
Author: Volker Lendecke <vl at samba.org>
Date:   Fri May 29 00:20:10 2009 +0200

    Support getting gpfs birthtime

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/gpfs.c     |   13 ++++++++
 source3/modules/vfs_gpfs.c |   68 ++++++++++++++++++++++++++++++++++++++++++++
 source3/modules/vfs_gpfs.h |    1 +
 3 files changed, 82 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c
index d20c024..a8b5576 100644
--- a/source3/modules/gpfs.c
+++ b/source3/modules/gpfs.c
@@ -37,6 +37,7 @@ static int (*gpfs_get_realfilename_path_fn)(char *pathname, char *filenamep,
 					    int *buflen);
 static int (*gpfs_set_winattrs_path_fn)(char *pathname, int flags, struct gpfs_winattr *attrs);
 static int (*gpfs_get_winattrs_path_fn)(char *pathname, struct gpfs_winattr *attrs);
+static int (*gpfs_get_winattrs_fn)(int fd, struct gpfs_winattr *attrs);
 
 
 bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
@@ -163,6 +164,17 @@ int get_gpfs_winattrs(char *pathname,struct gpfs_winattr *attrs)
         return gpfs_get_winattrs_path_fn(pathname, attrs);
 }
 
+int smbd_fget_gpfs_winattrs(int fd, struct gpfs_winattr *attrs)
+{
+
+        if ((!gpfs_winattr) || (gpfs_get_winattrs_fn == NULL)) {
+                errno = ENOSYS;
+                return -1;
+        }
+        DEBUG(10, ("gpfs_get_winattrs_path:open call %d\n", fd));
+        return gpfs_get_winattrs_fn(fd, attrs);
+}
+
 int set_gpfs_winattrs(char *pathname,int flags,struct gpfs_winattr *attrs)
 {
         if ((!gpfs_winattr) || (gpfs_set_winattrs_path_fn == NULL)) {
@@ -234,6 +246,7 @@ void init_gpfs(void)
 			   "gpfs_get_realfilename_path");
 	init_gpfs_function(&gpfs_get_winattrs_path_fn,"gpfs_get_winattrs_path");
         init_gpfs_function(&gpfs_set_winattrs_path_fn,"gpfs_set_winattrs_path");
+        init_gpfs_function(&gpfs_get_winattrs_fn,"gpfs_get_winattrs");
 
 
 	gpfs_share_modes = lp_parm_bool(-1, "gpfs", "sharemodes", True);
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 4215e13..26f9688 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -966,6 +966,62 @@ static size_t gpfs_get_xattr(struct vfs_handle_struct *handle,  const char *path
         return size;
 }
 
+static int vfs_gpfs_stat(struct vfs_handle_struct *handle, const char *fname,
+			 SMB_STRUCT_STAT *sbuf)
+{
+	struct gpfs_winattr attrs;
+	int ret;
+
+	ret = SMB_VFS_NEXT_STAT(handle, fname, sbuf);
+	if (ret == -1) {
+		return -1;
+	}
+	ret = get_gpfs_winattrs(CONST_DISCARD(char *, fname), &attrs);
+	if (ret == 0) {
+		sbuf->st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
+		sbuf->st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
+	}
+	return 0;
+}
+
+static int vfs_gpfs_fstat(struct vfs_handle_struct *handle,
+			  struct files_struct *fsp, SMB_STRUCT_STAT *sbuf)
+{
+	struct gpfs_winattr attrs;
+	int ret;
+
+	ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
+	if (ret == -1) {
+		return -1;
+	}
+	if ((fsp->fh == NULL) || (fsp->fh->fd == -1)) {
+		return 0;
+	}
+	ret = smbd_fget_gpfs_winattrs(fsp->fh->fd, &attrs);
+	if (ret == 0) {
+		sbuf->st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
+		sbuf->st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
+	}
+	return 0;
+}
+
+static int vfs_gpfs_lstat(struct vfs_handle_struct *handle, const char *path,
+			  SMB_STRUCT_STAT *sbuf)
+{
+	struct gpfs_winattr attrs;
+	int ret;
+
+	ret = SMB_VFS_NEXT_LSTAT(handle, path, sbuf);
+	if (ret == -1) {
+		return -1;
+	}
+	ret = get_gpfs_winattrs(CONST_DISCARD(char *, path), &attrs);
+	if (ret == 0) {
+		sbuf->st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
+		sbuf->st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
+	}
+	return 0;
+}
 
 /* VFS operations structure */
 
@@ -1035,6 +1091,18 @@ static vfs_op_tuple gpfs_op_tuples[] = {
           SMB_VFS_OP_GETXATTR,
           SMB_VFS_LAYER_TRANSPARENT },
 
+        { SMB_VFS_OP(vfs_gpfs_stat),
+          SMB_VFS_OP_STAT,
+          SMB_VFS_LAYER_TRANSPARENT },
+
+        { SMB_VFS_OP(vfs_gpfs_fstat),
+          SMB_VFS_OP_FSTAT,
+          SMB_VFS_LAYER_TRANSPARENT },
+
+        { SMB_VFS_OP(vfs_gpfs_lstat),
+          SMB_VFS_OP_LSTAT,
+          SMB_VFS_LAYER_TRANSPARENT },
+
         { SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP }
 
 };
diff --git a/source3/modules/vfs_gpfs.h b/source3/modules/vfs_gpfs.h
index e0c23dc..d2899b5 100644
--- a/source3/modules/vfs_gpfs.h
+++ b/source3/modules/vfs_gpfs.h
@@ -31,6 +31,7 @@ int smbd_gpfs_getacl(char *pathname, int flags, void *acl);
 int smbd_gpfs_putacl(char *pathname, int flags, void *acl);
 int smbd_gpfs_get_realfilename_path(char *pathname, char *filenamep,
 				    int *buflen);
+int smbd_fget_gpfs_winattrs(int fd, struct gpfs_winattr *attrs);
 int get_gpfs_winattrs(char * pathname,struct gpfs_winattr *attrs);
 int set_gpfs_winattrs(char * pathname,int flags,struct gpfs_winattr *attrs);
 void init_gpfs(void);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list