diff options
| author | Soumya Koduri <skoduri@redhat.com> | 2015-04-14 04:35:09 +0530 | 
|---|---|---|
| committer | Niels de Vos <ndevos@redhat.com> | 2015-04-19 01:21:07 -0700 | 
| commit | f45779067dbba3077b9c64c930fd4ddd1c51243e (patch) | |
| tree | 181b7dc3d509893eb7a7839a0ac21582dc7305ea /api/src | |
| parent | b464723a48c2e35e7f209c3f909c964b6ba7fb47 (diff) | |
gfapi: Modified CACHE_INVALIDATE flags
Have prefixed CACHE_INVALIDATE flags exposed via gfapi with 'GFAPI_'.
In addition as INODE_UPDATE is asynchronous and may need some
support in NFS-Ganesha, have taken it out for now. Will revisit it
later.
Change-Id: Icbbc2c92a61c9225b6c5bc8c4212e8c4a3a0a10f
BUG: 1200262
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/10225
Tested-by: NetBSD Build System
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api/src')
| -rw-r--r-- | api/src/glfs-handleops.c | 14 | ||||
| -rw-r--r-- | api/src/glfs-handles.h | 35 | 
2 files changed, 21 insertions, 28 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index 54702d89934..886eb3fc42c 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -1706,16 +1706,10 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct callback_arg *up_arg)                  switch (u_list->event_type) {                  case CACHE_INVALIDATION: -                        if (u_list->flags & (~(INODE_UPDATE_FLAGS))) { -                                /* Invalidate CACHE */ -                                reason = INODE_INVALIDATE; -                                gf_log (subvol->name, GF_LOG_DEBUG, -                                        "Reason - INODE_INVALIDATION"); -                        } else { -                                reason = INODE_UPDATE; -                                gf_log (subvol->name, GF_LOG_DEBUG, -                                        "Reason - INODE_UPDATE"); -                        } +                        /* XXX: Need to revisit this to support +                         * GFAPI_INODE_UPDATE if required. +                         */ +                        reason = GFAPI_INODE_INVALIDATE;                          break;                  default:                          break; diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h index 17b1defc733..02204a76385 100644 --- a/api/src/glfs-handles.h +++ b/api/src/glfs-handles.h @@ -61,20 +61,20 @@  #define GFAPI_HANDLE_LENGTH 16  /* These flags should be in sync to the ones defined in upcall.h */ -#define UP_NLINK   0x00000001   /* update nlink */ -#define UP_MODE    0x00000002   /* update mode and ctime */ -#define UP_OWN     0x00000004   /* update mode,uid,gid and ctime */ -#define UP_SIZE    0x00000008   /* update fsize */ -#define UP_TIMES   0x00000010   /* update all times */ -#define UP_ATIME   0x00000020   /* update atime only */ -#define UP_PERM    0x00000040   /* update fields needed for -                                   permission checking */ -#define UP_RENAME  0x00000080   /* this is a rename op - -                                   delete the cache entry */ - -#define INODE_UPDATE_FLAGS (UP_NLINK | UP_MODE | \ -                            UP_OWN | UP_SIZE | \ -                            UP_TIMES | UP_ATIME) +#define GFAPI_UP_NLINK   0x00000001   /* update nlink */ +#define GFAPI_UP_MODE    0x00000002   /* update mode and ctime */ +#define GFAPI_UP_OWN     0x00000004   /* update mode,uid,gid and ctime */ +#define GFAPI_UP_SIZE    0x00000008   /* update fsize */ +#define GFAPI_UP_TIMES   0x00000010   /* update all times */ +#define GFAPI_UP_ATIME   0x00000020   /* update atime only */ +#define GFAPI_UP_PERM    0x00000040   /* update fields needed for +                                         permission checking */ +#define GFAPI_UP_RENAME  0x00000080   /* this is a rename op - +                                         delete the cache entry */ + +#define GFAPI_INODE_UPDATE_FLAGS (GFAPI_UP_NLINK | GFAPI_UP_MODE | \ +                                  GFAPI_UP_OWN | GFAPI_UP_SIZE | \ +                                  GFAPI_UP_TIMES | GFAPI_UP_ATIME)  /* Portability non glibc c++ build systems */  #ifndef __THROW @@ -121,10 +121,9 @@ struct callback_arg {  };  /* reason list in callback_arg */ -enum callback_type { -        CBK_EVENT_NULL, -        INODE_INVALIDATE, -        INODE_UPDATE, +enum gfapi_callback_type { +        GFAPI_CBK_EVENT_NULL, +        GFAPI_INODE_INVALIDATE, /* invalidate cache entry */  };  /* Handle based operations */  | 
