diff options
author | David Howells <dhowells@redhat.com> | 2015-01-21 15:03:40 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-02-17 12:21:51 -0500 |
commit | e59b4e9187bd5175b9845dc10fedb0879b7efbfd (patch) | |
tree | d1194fe02bcb93cd0fbf4924c9756158717338e9 /drivers/net/ethernet/chelsio | |
parent | 77b3da6e3232d3b4d4b8addb4b05799fe98f3bf8 (diff) |
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/net/ethernet/chelsio')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c index c98a350d857e..4c7fe447e407 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | |||
@@ -91,12 +91,9 @@ static const struct file_operations mem_debugfs_fops = { | |||
91 | static void add_debugfs_mem(struct adapter *adap, const char *name, | 91 | static void add_debugfs_mem(struct adapter *adap, const char *name, |
92 | unsigned int idx, unsigned int size_mb) | 92 | unsigned int idx, unsigned int size_mb) |
93 | { | 93 | { |
94 | struct dentry *de; | 94 | debugfs_create_file_size(name, S_IRUSR, adap->debugfs_root, |
95 | 95 | (void *)adap + idx, &mem_debugfs_fops, | |
96 | de = debugfs_create_file(name, S_IRUSR, adap->debugfs_root, | 96 | size_mb << 20); |
97 | (void *)adap + idx, &mem_debugfs_fops); | ||
98 | if (de && de->d_inode) | ||
99 | de->d_inode->i_size = size_mb << 20; | ||
100 | } | 97 | } |
101 | 98 | ||
102 | /* Add an array of Debug FS files. | 99 | /* Add an array of Debug FS files. |