Whamcloud - gitweb
file export-do_kern_mount.patch was initially added on branch b1_5.
[fs/lustre-release.git] / lustre / smfs / audit_ost.c
index 41348bf..9db7592 100644 (file)
@@ -47,9 +47,10 @@ static int audit_ost_get_id(struct inode * inode, struct lustre_id * id)
         ENTRY;
         if(fsfilt->fs_get_md(inode, id, sizeof(*id), EA_SID) <= 0)
                 RETURN(-ENODATA);
+
         RETURN(0);        
 }
-
+#if 0
 static int audit_ost_create_rec(struct inode * parent, void * arg,
                                 struct audit_priv * priv, char * buffer,
                                 __u32 * type)
@@ -111,7 +112,7 @@ int static audit_ost_setattr_rec(struct inode * inode, void * arg,
                 
         return len;
 }
-
+#endif
 int static audit_ost_rw_rec(struct inode * inode, void * arg, 
                             struct audit_priv * priv, char * buffer,
                             __u32 * type)
@@ -120,9 +121,13 @@ int static audit_ost_rw_rec(struct inode * inode, void * arg,
         struct audit_record * rec = (void*)buffer;
         char * pbuf = buffer + sizeof(*rec); 
         int len = sizeof(*rec);
+        struct lustre_id id;
+
+        if (audit_ost_get_id(inode, &id) < 0) 
+                CERROR("Cannot get lustre id from object EA\n");
 
         rec->opcode = msg->write ? AUDIT_WRITE : AUDIT_READ;
-        len += audit_rec_from_id(&pbuf, msg->id);
+        len += audit_rec_from_id(&pbuf, &id);
         *type = SMFS_AUDIT_GEN_REC;
         
         return len;
@@ -131,10 +136,12 @@ int static audit_ost_rw_rec(struct inode * inode, void * arg,
 static audit_get_op audit_ost_record[HOOK_MAX] = {
         [HOOK_SI_READ]      audit_ost_rw_rec,
         [HOOK_SI_WRITE]     audit_ost_rw_rec,
+        [HOOK_READ]         audit_ost_rw_rec,
+        [HOOK_WRITE]        audit_ost_rw_rec,
         [HOOK_CREATE]       NULL, /* audit_ost_create_rec, */
-        [HOOK_UNLINK]       audit_ost_unlink_rec,
-        [HOOK_SETATTR]      audit_ost_setattr_rec,
-        [HOOK_F_SETATTR]    audit_ost_setattr_rec
+        [HOOK_UNLINK]       NULL, //audit_ost_unlink_rec,
+        [HOOK_SETATTR]      NULL, //audit_ost_setattr_rec,
+        [HOOK_F_SETATTR]    NULL, //audit_ost_setattr_rec
 };
 
 int audit_ost_setup(struct obd_device * obd, struct super_block *sb,