]> Pileus Git - ~andy/linux/blobdiff - fs/pstore/inode.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
[~andy/linux] / fs / pstore / inode.c
index 71bf5f4ae84c9a9044be1056e83582b7c72fd74c..12823845d32490d220d795ee46e1a328491a1585 100644 (file)
@@ -275,8 +275,8 @@ int pstore_is_mounted(void)
  * Set the mtime & ctime to the date that this record was originally stored.
  */
 int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count,
-                 char *data, size_t size, struct timespec time,
-                 struct pstore_info *psi)
+                 char *data, bool compressed, size_t size,
+                 struct timespec time, struct pstore_info *psi)
 {
        struct dentry           *root = pstore_sb->s_root;
        struct dentry           *dentry;
@@ -315,7 +315,8 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count,
 
        switch (type) {
        case PSTORE_TYPE_DMESG:
-               sprintf(name, "dmesg-%s-%lld", psname, id);
+               sprintf(name, "dmesg-%s-%lld%s", psname, id,
+                                               compressed ? ".enc.z" : "");
                break;
        case PSTORE_TYPE_CONSOLE:
                sprintf(name, "console-%s", psname);
@@ -345,9 +346,8 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count,
 
        mutex_lock(&root->d_inode->i_mutex);
 
-       rc = -ENOSPC;
        dentry = d_alloc_name(root, name);
-       if (IS_ERR(dentry))
+       if (!dentry)
                goto fail_lockedalloc;
 
        memcpy(private->data, data, size);