[PATCH 027/112] fs: turn creat into static inline helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



creat is a oneliner that can be inlined at no extra cost, so move it
into a header.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 fs/fs.c         | 6 ------
 include/fcntl.h | 6 +++++-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index bd2f0b6294ff..7c4e2f250ea8 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -349,12 +349,6 @@ static int create(struct dentry *dir, struct dentry *dentry)
 	return inode->i_op->create(inode, dentry, S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO);
 }
 
-int creat(const char *pathname, mode_t mode)
-{
-	return open(pathname, O_CREAT | O_WRONLY | O_TRUNC);
-}
-EXPORT_SYMBOL(creat);
-
 static int fsdev_truncate(struct device *dev, FILE *f, loff_t length)
 {
 	struct fs_driver *fsdrv = f->fsdev->driver;
diff --git a/include/fcntl.h b/include/fcntl.h
index 1b4cd8ad3783..06289abc4376 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -29,6 +29,10 @@
 #define O_RWSIZE_8	010000000
 
 int open(const char *pathname, int flags, ...);
-int creat(const char *pathname, mode_t mode);
+
+static inline int creat(const char *pathname, mode_t mode)
+{
+	return open(pathname, O_CREAT | O_WRONLY | O_TRUNC);
+}
 
 #endif /* __FCNTL_H */
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux