static void convert_attr(const struct fuse_setattr_in *attr, struct stat *stbuf) { stbuf->st_mode = attr->mode; stbuf->st_uid = attr->uid; stbuf->st_gid = attr->gid; stbuf->st_size = attr->size; stbuf->st_atime = attr->atime; stbuf->st_mtime = attr->mtime; ST_ATIM_NSEC_SET(stbuf, attr->atimensec); ST_MTIM_NSEC_SET(stbuf, attr->mtimensec); #ifdef __APPLE__ stbuf->st_flags = attr->flags; stbuf->st_ctime = attr->chgtime; stbuf->st_ctimensec = attr->chgtimensec; /* XXX: aaaaaaaaaaaargh */ stbuf->st_qspare[0] = attr->bkuptime; stbuf->st_lspare = attr->bkuptimensec; stbuf->st_qspare[1] = attr->crtime; stbuf->st_gen = attr->crtimensec; #endif /* __APPLE__ */ }
int hsi_nfs3_fattr2stat(struct fattr3 *attr, struct stat *st) { int err = 0; unsigned int type = 0; DEBUG_IN("%s", "\n"); st->st_dev = makedev(0, 0); /* ignored now */ st->st_ino = (ino_t) (attr->fileid);/*depend on 'use_ino' mount option*/ type = (unsigned int) (attr->type); st->st_mode = (mode_t) (attr->mode & 07777); switch (type) { case NF3REG : st->st_mode |= S_IFREG; break; case NF3DIR : st->st_mode |= S_IFDIR; break; case NF3BLK : st->st_mode |= S_IFBLK; break; case NF3CHR : st->st_mode |= S_IFCHR; break; case NF3LNK : st->st_mode |= S_IFLNK; break; case NF3SOCK : st->st_mode |= S_IFSOCK; break; case NF3FIFO : st->st_mode |= S_IFIFO; break; default : err = EINVAL; goto out; } st->st_nlink = (nlink_t) (attr->nlink); st->st_uid = (uid_t) (attr->uid); st->st_gid = (gid_t) (attr->gid); st->st_rdev = makedev(attr->rdev.major, attr->rdev.minor); st->st_size = (off_t) (attr->size); st->st_blksize = 0; /* ignored now */ st->st_blocks = (blkcnt_t) (attr->used / 512); st->st_atime = (time_t) (attr->atime.seconds); st->st_mtime = (time_t) (attr->mtime.seconds); st->st_ctime = (time_t) (attr->ctime.seconds); ST_ATIM_NSEC_SET(st, attr->atime.nseconds); ST_MTIM_NSEC_SET(st, attr->atime.nseconds); /* Don't we need ctime? */ out: DEBUG_OUT("with errno %d.\n", err); return err; }
static void convert_attr(const struct fuse_setattr_in *attr, struct stat *stbuf) { stbuf->st_mode = attr->mode; stbuf->st_uid = attr->uid; stbuf->st_gid = attr->gid; stbuf->st_size = attr->size; stbuf->st_atime = attr->atime; stbuf->st_mtime = attr->mtime; ST_ATIM_NSEC_SET(stbuf, attr->atimensec); ST_MTIM_NSEC_SET(stbuf, attr->mtimensec); }
static void convert_attr(const struct fuse_setattr_in *attr, struct stat *stbuf) { stbuf->st_mode = attr->mode; stbuf->st_uid = attr->uid; stbuf->st_gid = attr->gid; stbuf->st_size = attr->size; stbuf->st_atime = attr->atime; stbuf->st_mtime = attr->mtime; ST_ATIM_NSEC_SET(stbuf, attr->atimensec); ST_MTIM_NSEC_SET(stbuf, attr->mtimensec); #ifdef __APPLE__ stbuf->st_flags = attr->flags; stbuf->st_ctime = attr->chgtime; stbuf->st_ctimensec = attr->chgtimensec; #endif }