Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/fs : Add "vFAT" file system support in TizenRT #2827

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NilabhShant
Copy link

  • This PR contains commits required to add vFAT file system in TizenRT and add functionality support for the same.

  • This patch has been back-ported from Nuttx.

@seinfra
Copy link

seinfra commented Mar 22, 2019

Target : [0e0eea3431e81a59d49b7ae93b1db1b5049d5b08] - Code Rule Check (C++) OK.

@seinfra
Copy link

seinfra commented Mar 22, 2019

Target : [0e0eea3431e81a59d49b7ae93b1db1b5049d5b08] - Code Rule Check Result:
os/fs/inode/inode.h:149: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/fs/inode/inode.h:150: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/fs/inode/inode.h:151: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/fs/inode/inode.h:152: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/fs/inode/inode.h:153: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/fs/inode/inode.h:155: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/fs/inode/inode.h:156: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/fs/inode/inode.h:157: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/include/tinyara/fs/dirent.h:95: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/include/tinyara/fs/dirent.h:96: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/include/tinyara/fs/dirent.h:97: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/include/tinyara/fs/dirent.h:98: ERROR: [IDT_M_TAB] please, no spaces at the start of a line
os/include/tinyara/fs/dirent.h:175: ERROR: [IDT_M_TAB] please, no spaces at the start of a line

os/fs/fat/Kconfig Show resolved Hide resolved
*/

struct inode_search_s {
FAR const char *path; /* Path of inode to find */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coding rule

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Done

@@ -66,6 +66,7 @@
/****************************************************************************
* Included Files
****************************************************************************/
#include <tinyara/compiler.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you include this header? Your new codes do not require it.

Copy link
Author

@NilabhShant NilabhShant Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I delete it
Please check

off_t fd_startcluster; /* Start cluster number of the directory */
off_t fd_currcluster; /* Current cluster number being read */
off_t fd_currsector; /* Current sector being read */
unsigned int fd_index; /* Current index of the directory entry to read */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coding rule

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

#define FATATTR_ARCHIVE 0x20

#define FATATTR_LONGNAME \
(FATATTR_READONLY|FATATTR_HIDDEN|FATATTR_SYSTEM|FATATTR_VOLUMEID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coding rule

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


int fat_getattrib(FAR const char *path, FAR fat_attrib_t *attrib);
int fat_setattrib(FAR const char *path, fat_attrib_t setbits,
fat_attrib_t clearbits);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check this file for coding rule

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. please check

@sunghan-chang
Copy link
Contributor

sunghan-chang commented Mar 22, 2019

@NilabhShant Could you check is it ok for patent?

#
###########################################################################
############################################################################
# Make.defs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct Path >
os/fs/fat/Make.defs

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Modified.
Please check

@NilabhShant NilabhShant force-pushed the STM32f4_Discovey_USB_Host branch from 0e0eea3 to fe684ac Compare March 22, 2019 10:38
@seinfra
Copy link

seinfra commented Mar 22, 2019

Target : [fe684acc626551a1018afa84355904cdc9a403c4] - Code Rule Check (C++) OK.

@seinfra
Copy link

seinfra commented Mar 22, 2019

Target : [fe684acc626551a1018afa84355904cdc9a403c4] - Code Rule Check OK.

@NilabhShant NilabhShant force-pushed the STM32f4_Discovey_USB_Host branch from fe684ac to cea4041 Compare March 22, 2019 11:13
@seinfra
Copy link

seinfra commented Mar 22, 2019

Target : [cea4041483fdb1a9c95e954277a72b32af3c185a] - Code Rule Check (C++) OK.

@seinfra
Copy link

seinfra commented Mar 22, 2019

Target : [cea4041483fdb1a9c95e954277a72b32af3c185a] - Code Rule Check OK.


/* Sanity checks */

DEBUGASSERT(filep->f_priv == NULL && filep->f_inode != NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also check for "filep" variable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to check for it because if filep is NULL then its members will be NULL .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it might result in assertion.

Copy link
Author

@NilabhShant NilabhShant Mar 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok Done


/* Synchronize the file buffers and disk content; update times */

ret = fat_sync(filep);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to check whether sync is successful?

Copy link
Author

@NilabhShant NilabhShant Mar 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is returning the status of sync at the end and this logic working fine in nuttx so its better to have it like this.

* both the "." and ".." entries.
*/

else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct coding guideline violation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
#

config FS_FAT
Copy link
Contributor

@yashwanth686007 yashwanth686007 Mar 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is only FAT32 is supported ? Or other versions too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my knowledge vFAT and FAT32

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes only FAT32 support

@NilabhShant NilabhShant force-pushed the STM32f4_Discovey_USB_Host branch from cea4041 to 168c77a Compare March 26, 2019 06:03
@seinfra
Copy link

seinfra commented Mar 26, 2019

Target : [168c77a8f7fde4579c7c518c842c6129ca84a2c8] - Code Rule Check (C++) OK.

@seinfra
Copy link

seinfra commented Mar 26, 2019

Target : [168c77a8f7fde4579c7c518c842c6129ca84a2c8] - Code Rule Check OK.

* reserved.
* Author: Gregory Nutt <[email protected]>
*
* References:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these references make sure that there will not be any licensing issues with this port?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nuttx guys mention that it is an unrestricted license.
So I think there will be no license issues.

@NilabhShant
Copy link
Author

NilabhShant commented Mar 26, 2019

@NilabhShant Could you check is it ok for patent?

@sunghan-chang As I back-ported from Nuttx and it is also a open source and those guys mention below reference

References:

  • Microsoft FAT documentation
    Some good ideas were leveraged from the FAT implementation:
    'Copyright (C) 2007, ChaN, all right reserved.'
    which has an unrestricted license.

But I am not very sure about it ,Please give me your opinion.

@@ -210,6 +210,7 @@ const struct mountpt_operations procfs_operations = {
NULL, /* sync */
procfs_dup, /* dup */
NULL, /* fstat */
NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention funcptr variable in comment section as reference.
Like /* truncate */

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok done, Please check

@@ -145,6 +145,7 @@ const struct mountpt_operations smartfs_operations = {
smartfs_sync, /* sync */
smartfs_dup, /* dup */
smartfs_fstat, /* fstat */
NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention funcptr variable in comment section as reference.
Like /* truncate */

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@NilabhShant NilabhShant force-pushed the STM32f4_Discovey_USB_Host branch from 168c77a to 490c142 Compare March 27, 2019 06:08
@seinfra
Copy link

seinfra commented Mar 27, 2019

Target : [490c1425f316e2d8a2ea5a6a82cee985accddea6] - Code Rule Check (C++) OK.

@seinfra
Copy link

seinfra commented Mar 27, 2019

Target : [490c1425f316e2d8a2ea5a6a82cee985accddea6] - Code Rule Check OK.

*/
/* 446@0: Generally unused and zero; but may
* include IDM Boot Manager menu entry at 8@394 */
#define PART_ENTRY(n) (446+((n) << 4)) /* n = 0,1,2,3 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct coding guideline violations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* Access to data in raw sector data */

#define UBYTE_VAL(p,o) (((uint8_t*)(p))[o])
#define UBYTE_PTR(p,o) &UBYTE_VAL(p,o)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, Please check

Nilabh added 2 commits March 28, 2019 11:52
This patch adds support for vFAT file system on TizenRT
back-ported from Nuttx

Signed-off-by: Nilabh <[email protected]>
This patch adds requried support for vFAT file system
in TizenRT.

Back-ported from Nuttx

Signed-off-by: Nilabh <[email protected]>
@NilabhShant NilabhShant force-pushed the STM32f4_Discovey_USB_Host branch from 490c142 to 9008bc0 Compare March 28, 2019 06:24
@seinfra
Copy link

seinfra commented Mar 28, 2019

Target : [9008bc0] - Code Rule Check (C++) OK.

@seinfra
Copy link

seinfra commented Mar 28, 2019

Target : [9008bc0] - Code Rule Check OK.

@NilabhShant
Copy link
Author

@sunghan-chang please review and approve this PR.

@seinfra
Copy link

seinfra commented Apr 24, 2019

Target : [9008bc0] - Code Rule Check (C++) OK.

1 similar comment
@seinfra
Copy link

seinfra commented Apr 24, 2019

Target : [9008bc0] - Code Rule Check (C++) OK.

# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
#

config FS_FAT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes only FAT32 support

@seinfra
Copy link

seinfra commented Nov 12, 2019

Target : [9008bc0] - Code Rule Check OK.

@seinfra
Copy link

seinfra commented Nov 12, 2019

Target : [9008bc0] - Code Rule Check (C++) OK.

@tizen-build
Copy link

Target : [9008bc0] - Code Rule Check OK.

1 similar comment
@tizen-build
Copy link

Target : [9008bc0] - Code Rule Check OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants