Skip to content

Commit a21815d

Browse files
authored
Merge pull request #27 from terraluna977/master
Fix build on kernel 6.15
2 parents 4d15b5f + d29b31b commit a21815d

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
nullfsvfs (0.18) unstable; urgency=medium
2+
3+
* Support for kernel versions 6.15
4+
5+
-- Michael Ablassmeier <[email protected]> Wed, 02 Apr 2025 08:48:43 +0200
6+
17
nullfsvfs (0.17) unstable; urgency=medium
28

39
* Support for kernel versions 6.6/6.7

nullfs.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@
4242
#define NULLFS_MAGIC 0x19980123
4343
#define NULLFS_DEFAULT_MODE 0755
4444
#define NULLFS_SYSFS_MODE 0644
45-
#define NULLFS_VERSION "0.17"
45+
#define NULLFS_VERSION "0.18"
4646

4747
MODULE_AUTHOR("Michael Ablassmeier");
4848
MODULE_LICENSE("GPL");
4949
MODULE_VERSION(NULLFS_VERSION);
5050

51+
struct inode *nullfs_get_inode(struct super_block*, const struct inode*, umode_t, dev_t, struct dentry*);
52+
int nullfs_statfs(struct dentry*, struct kstatfs*);
53+
int nullfs_fill_super(struct super_block*, void*, int);
54+
5155
/*
5256
* POSIX ACL
5357
* setfacl is possible, but acls are not stored, of course
@@ -101,7 +105,7 @@ static ssize_t exclude_store(struct kobject *kobj, struct kobj_attribute *attr,
101105
if (p)
102106
*p = '\0';
103107
strncpy(exclude, buf, sizeof(exclude));
104-
printk(KERN_INFO "nullfs: will keep data for files matching: [%s]",
108+
printk(KERN_INFO "nullfs: will keep data for files matching: [%s]\n",
105109
exclude);
106110
return count;
107111
}
@@ -323,7 +327,7 @@ static int nullfs_parse_options(char *data, struct nullfs_mount_opts *opts)
323327
}
324328
}
325329
if(opts->write != NULL)
326-
printk(KERN_INFO "nullfs: will keep data for files matching: [%s]",
330+
printk(KERN_INFO "nullfs: will keep data for files matching: [%s]\n",
327331
opts->write);
328332
return 0;
329333
}
@@ -402,6 +406,8 @@ struct inode *nullfs_get_inode(struct super_block *sb,
402406
case S_IFDIR:
403407
inode->i_op = &nullfs_dir_inode_operations;
404408
inode->i_fop = &simple_dir_operations;
409+
410+
/* directory inodes start off with i_nlink == 2 (for "." entry) */
405411
inc_nlink(inode);
406412
break;
407413
case S_IFLNK:
@@ -455,7 +461,10 @@ static int nullfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
455461
return error;
456462
}
457463

458-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
464+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
465+
static struct dentry *nullfs_mkdir(struct mnt_idmap *idmap,
466+
struct inode * dir, struct dentry * dentry, umode_t mode)
467+
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
459468
static int nullfs_mkdir(struct mnt_idmap *idmap,
460469
struct inode * dir, struct dentry * dentry, umode_t mode)
461470
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
@@ -476,7 +485,12 @@ static int nullfs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode
476485

477486
if (!retval)
478487
inc_nlink(dir);
488+
489+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
490+
return ERR_PTR(retval);
491+
#else
479492
return retval;
493+
#endif
480494
}
481495

482496
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
@@ -501,7 +515,7 @@ static int nullfs_symlink(struct inode * dir, struct dentry *dentry, const char
501515
dget(dentry);
502516
#ifndef CURRENT_TIME
503517
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
504-
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
518+
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
505519
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
506520
dir->i_mtime = inode_set_ctime_current(dir);
507521
#else
@@ -559,7 +573,7 @@ static int nullfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode
559573
#else
560574
d_tmpfile(dentry, inode);
561575
#endif
562-
return 0;
576+
return finish_open_simple(file, 0);
563577
}
564578
#endif
565579

@@ -675,7 +689,7 @@ static int __init nullfs_init(void)
675689
kobject_put(exclude_kobj);
676690

677691
register_filesystem(&nullfs_type);
678-
printk(KERN_INFO "nullfs: version [%s] initialized", NULLFS_VERSION);
692+
printk(KERN_INFO "nullfs: version [%s] initialized\n", NULLFS_VERSION);
679693
return 0;
680694
}
681695

rpm/nullfsvfs-kmod.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
%{!?kversion: %global kversion %(uname -r)}
2020

2121
Name: %{kmod_name}-kmod
22-
Version: 0.17
22+
Version: 0.18
2323
Release: 1%{?dist}
2424
Summary: A virtual file system that behaves like /dev/null
2525
License: GPLv3+

0 commit comments

Comments
 (0)