summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/csiostor
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-01-21 21:03:40 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2015-02-17 18:21:51 +0100
commite59b4e9187bd5175b9845dc10fedb0879b7efbfd (patch)
treed1194fe02bcb93cd0fbf4924c9756158717338e9 /drivers/scsi/csiostor
parentnew primitive: debugfs_create_automount() (diff)
downloadlinux-e59b4e9187bd5175b9845dc10fedb0879b7efbfd.tar.xz
linux-e59b4e9187bd5175b9845dc10fedb0879b7efbfd.zip
debugfs: Provide a file creation function that also takes an initial size
Provide a file creation function that also takes an initial size so that the caller doesn't have to set i_size, thus meaning that we don't have to call deal with ->d_inode in the callers. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/scsi/csiostor')
-rw-r--r--drivers/scsi/csiostor/csio_init.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index 34d20cc3e110..2617f15eaeeb 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -113,12 +113,9 @@ static const struct file_operations csio_mem_debugfs_fops = {
void csio_add_debugfs_mem(struct csio_hw *hw, const char *name,
unsigned int idx, unsigned int size_mb)
{
- struct dentry *de;
-
- de = debugfs_create_file(name, S_IRUSR, hw->debugfs_root,
- (void *)hw + idx, &csio_mem_debugfs_fops);
- if (de && de->d_inode)
- de->d_inode->i_size = size_mb << 20;
+ debugfs_create_file_size(name, S_IRUSR, hw->debugfs_root,
+ (void *)hw + idx, &csio_mem_debugfs_fops,
+ size_mb << 20);
}
static int csio_setup_debugfs(struct csio_hw *hw)