From c5a11341b0a455350ac665d24eaefb960a433e61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 22 Apr 2013 19:06:49 +0200 Subject: [PATCH] Removed obsoleted references to utime_omit_ok When issuing an utimensat as a consequence of utime(2) or utimensat(2), fuse had temporarily defined a flag utime_omit_ok to identify whether the file system supports the values UTIME_OMIT and UTIME_NOW to mean specific timestamp updatings. The flag has been obsoleted and all file system are now supposed to comply with the convention. --- include/fuse-lite/fuse.h | 6 ------ libfuse-lite/fuse.c | 8 +------- src/ntfs-3g.c | 8 -------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/include/fuse-lite/fuse.h b/include/fuse-lite/fuse.h index 13c82251..f4986768 100644 --- a/include/fuse-lite/fuse.h +++ b/include/fuse-lite/fuse.h @@ -422,12 +422,6 @@ struct fuse_operations { int (*bmap) (const char *, size_t blocksize, uint64_t *idx); unsigned int flag_nullpath_ok : 1; - /** - * Flag indicating that the filesystem accepts special - * UTIME_NOW and UTIME_OMIT values in its utimens operation. - */ - unsigned int flag_utime_omit_ok : 1; - /** * Reserved flags, don't set */ diff --git a/libfuse-lite/fuse.c b/libfuse-lite/fuse.c index d55c9df5..f9782388 100644 --- a/libfuse-lite/fuse.c +++ b/libfuse-lite/fuse.c @@ -98,7 +98,6 @@ struct fuse { struct fuse_config conf; int intr_installed; struct fuse_fs *fs; - int utime_omit_ok; }; struct lock { @@ -1428,7 +1427,7 @@ static void fuse_lib_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, err = fuse_fs_truncate(f->fs, path, attr->st_size); } #ifdef HAVE_UTIMENSAT - if (!err && f->utime_omit_ok && + if (!err && (valid & (FUSE_SET_ATTR_ATIME | FUSE_SET_ATTR_MTIME))) { struct timespec tv[2]; @@ -2998,7 +2997,6 @@ struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args, goto out_free; f->fs = fs; - f->utime_omit_ok = fs->op.flag_utime_omit_ok; /* Oh f**k, this is ugly! */ if (!fs->op.lock) { @@ -3053,10 +3051,6 @@ struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args, fuse_session_add_chan(f->se, ch); -#ifndef __SOLARIS__ - if (f->conf.debug) - fprintf(stderr, "utime_omit_ok: %i\n", f->utime_omit_ok); -#endif /* ! __SOLARIS__ */ f->ctr = 0; f->generation = 0; /* FIXME: Dynamic hash table */ diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 2471cc2f..e898d21b 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -3306,14 +3306,6 @@ static void ntfs_fuse_destroy2(void *unused __attribute__((unused))) } static struct fuse_operations ntfs_3g_ops = { -#if defined(HAVE_UTIMENSAT) && (defined(FUSE_INTERNAL) || (FUSE_VERSION > 28)) - /* - * Accept UTIME_NOW and UTIME_OMIT in utimens, when - * using internal fuse or a fuse version since 2.9 - * (this field is not present in older versions) - */ - .flag_utime_omit_ok = 1, -#endif .getattr = ntfs_fuse_getattr, .readlink = ntfs_fuse_readlink, .readdir = ntfs_fuse_readdir, -- 2.11.0