Skip to content

Commit

Permalink
add special inode operations
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Aug 29, 2021
1 parent 2319ccf commit 2ac3eb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci-ubuntu-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
sudo touch /mnt/acl_file
sudo setfacl -m d:u:root:r /mnt/acl_dir
sudo setfacl -m u:root:r /mnt/acl_file
sudo setfacl -m u:root:r /mnt/nod
- name: Test O_DIRECT
run: sudo dd if=/dev/zero of=/mnt/direct bs=1M count=1953 oflag=direct
- name: Test filesize
Expand Down
7 changes: 6 additions & 1 deletion nullfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ const struct inode_operations nullfs_file_inode_operations = {
.getattr = nullfs_getattr,
.set_acl = nullfs_set_acl,
};

const struct inode_operations nullfs_special_inode_operations = {
.setattr = simple_setattr,
.getattr = nullfs_getattr,
.set_acl = nullfs_set_acl,
};
static const struct address_space_operations nullfs_aops = {
.readpage = simple_readpage,
.write_begin = simple_write_begin,
Expand Down Expand Up @@ -334,6 +338,7 @@ struct inode *nullfs_get_inode(struct super_block *sb,
switch (mode & S_IFMT) {
default:
init_special_inode(inode, mode, dev);
inode->i_op = &nullfs_special_inode_operations;
break;
case S_IFREG:
inode->i_op = &nullfs_file_inode_operations;
Expand Down

0 comments on commit 2ac3eb5

Please sign in to comment.