From: <ta...@us...> - 2007-09-07 16:51:22
|
Revision: 3814 http://gfarm.svn.sourceforge.net/gfarm/?rev=3814&view=rev Author: tatebe Date: 2007-09-07 09:39:41 -0700 (Fri, 07 Sep 2007) Log Message: ----------- fill st_uid when it is my own file or directory Modified Paths: -------------- gfarm2fs/trunk/gfarm2fs.c Modified: gfarm2fs/trunk/gfarm2fs.c =================================================================== --- gfarm2fs/trunk/gfarm2fs.c 2007-09-07 08:33:21 UTC (rev 3813) +++ gfarm2fs/trunk/gfarm2fs.c 2007-09-07 16:39:41 UTC (rev 3814) @@ -4,12 +4,13 @@ * $Id$ */ - #include "config.h" #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> #include <string.h> #include <fcntl.h> #include <errno.h> @@ -31,10 +32,13 @@ #define GFS_BLKSIZE 8192 #define STAT_BLKSIZ 512 /* for st_blocks */ -static int +static uid_t get_uid(char *user) { - /* XXX FIXME */ + if (strcmp(gfarm_get_global_username(), user) == 0) + return getuid(); /* my own file */ + + /* XXX FIXME - some other's file */ return (0); } @@ -186,6 +190,7 @@ gfarm2fs_releasedir(const char *path, struct fuse_file_info *fi) { GFS_Dir dp = get_dirp(fi); + (void) path; gfs_closedir(dp); return (0); @@ -284,6 +289,7 @@ return (-gfarm_error_to_errno(e)); } +#if 0 static char * get_user(uid_t uid) { @@ -297,10 +303,14 @@ /* XXX FIXME */ return "group"; } +#endif static int gfarm2fs_chown(const char *path, uid_t uid, gid_t gid) { + /* XXX FIXME */ + return (-ENOSYS); +#if 0 gfarm_error_t e; char *user, *group; @@ -309,6 +319,7 @@ e = gfs_chown(path, user, group); return (-gfarm_error_to_errno(e)); +#endif } static int @@ -334,7 +345,6 @@ gfarm_error_t e; (void) path; - e = gfs_pio_truncate(get_filep(fi), size); return (-gfarm_error_to_errno(e)); } @@ -483,8 +493,8 @@ gfarm2fs_fsync(const char *path, int isdatasync, struct fuse_file_info *fi) { gfarm_error_t e; + (void) path; - if (isdatasync) e = gfs_pio_datasync(get_filep(fi)); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |