summaryrefslogtreecommitdiffstats
path: root/xlators/storage/bd_map/src/bd_map_help.c
diff options
context:
space:
mode:
authorM. Mohan Kumar <mohan@in.ibm.com>2012-11-29 21:46:05 +0530
committerVijay Bellur <vbellur@redhat.com>2012-11-29 09:35:43 -0800
commit2cc1fbf020798edee97d9f626a767ecec5deca69 (patch)
tree2aebe94eae56668faa112f917ef763c267c8856a /xlators/storage/bd_map/src/bd_map_help.c
parentee968619cf936f0e25299beb1996abc27ed3dc72 (diff)
BD Backend: Open,read and related calls support for LV
BUG: 805138 Change-Id: I811c179d4244342537dbedb8a24fd2ec628942ed Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Reviewed-on: http://review.gluster.org/3552 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/bd_map/src/bd_map_help.c')
-rw-r--r--xlators/storage/bd_map/src/bd_map_help.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/storage/bd_map/src/bd_map_help.c b/xlators/storage/bd_map/src/bd_map_help.c
index 2b5c321f6..3576d7056 100644
--- a/xlators/storage/bd_map/src/bd_map_help.c
+++ b/xlators/storage/bd_map/src/bd_map_help.c
@@ -47,6 +47,25 @@ static void bd_entry_get_ino (uint64_t *inode)
UNLOCK (&inode_lk);
}
+void bd_update_time (bd_entry_t *entry, int type)
+{
+ struct timespec ts;
+
+ clock_gettime (CLOCK_REALTIME, &ts);
+ if (type == 0) {
+ entry->attr->ia_mtime = ts.tv_sec;
+ entry->attr->ia_mtime_nsec = ts.tv_nsec;
+ entry->attr->ia_atime = ts.tv_sec;
+ entry->attr->ia_atime_nsec = ts.tv_nsec;
+ } else if (type == 1) {
+ entry->attr->ia_mtime = ts.tv_sec;
+ entry->attr->ia_mtime_nsec = ts.tv_nsec;
+ } else {
+ entry->attr->ia_atime = ts.tv_sec;
+ entry->attr->ia_atime_nsec = ts.tv_nsec;
+ }
+}
+
static bd_entry_t *bd_entry_init (const char *name)
{
bd_entry_t *bdentry;